File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 19
19
from lib .core .enums import OS
20
20
21
21
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22
- VERSION = "1.1.12.21 "
22
+ VERSION = "1.1.12.22 "
23
23
TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
24
24
TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
25
25
VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
84
84
# Regular expression used for recognition of generic permission messages
85
85
PERMISSION_DENIED_REGEX = r"(command|permission|access)\s*(was|is)?\s*denied"
86
86
87
+ # Regular expression used in recognition of generic protection mechanisms
88
+ GENERIC_PROTECTION_REGEX = r"(?i)\b(rejected|blocked|protection|incident|denied|detected|dangerous|firewall)\b"
89
+
87
90
# Regular expression used for recognition of generic maximum connection messages
88
91
MAX_CONNECTIONS_REGEX = r"\bmax.+?\bconnection"
89
92
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ f872699e948d0692ce11b54781da814c lib/core/log.py
46
46
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
47
47
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
48
48
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49
- 8876dee2d5d1f9efbb520c78849b9a3a lib/core/settings.py
49
+ ea5aa15bc9cc2d2dc1b68c6e8121b650 lib/core/settings.py
50
50
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
51
51
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
52
52
d93501771b41315f9fb949305b6ed257 lib/core/target.py
@@ -407,7 +407,7 @@ d3aa7e5b222811f90c75aa8a0db509a3 waf/dosarrest.py
407
407
f4883f1443676f5291b1ef3e2cf0cbfd waf/edgecast.py
408
408
cd558b27d5bc4e42fcd5571d8c9c3a10 waf/expressionengine.py
409
409
6ccb307f53f878eacf9d08d0e97738e2 waf/fortiweb.py
410
- daf5235e066e18c0d9ba9f9b5bc9e47b waf/generic.py
410
+ 37c81331b70c755610a5c70ead8fc7b6 waf/generic.py
411
411
200d859893c4e84fbae9c32d5099ab65 waf/hyperguard.py
412
412
ced90975810f7f68103d38523567ab3f waf/incapsula.py
413
413
5fb9aaf874daa47ea2b672a22740e56b waf/__init__.py
Original file line number Diff line number Diff line change 5
5
See the file 'LICENSE' for copying permission
6
6
"""
7
7
8
- from lib .core .option import kb
8
+ import re
9
+
10
+ from lib .core .data import kb
11
+ from lib .core .settings import GENERIC_PROTECTION_REGEX
9
12
from lib .core .settings import IDS_WAF_CHECK_PAYLOAD
10
13
from lib .core .settings import WAF_ATTACK_VECTORS
11
14
14
17
def detect (get_page ):
15
18
retval = False
16
19
17
- page , headers , code = get_page ()
18
- if page is None or code >= 400 :
20
+ original , _ , code = get_page ()
21
+ if original is None or code >= 400 :
19
22
return False
20
23
21
24
for vector in WAF_ATTACK_VECTORS :
22
- page , _ , code = get_page (get = vector )
25
+ page , headers , code = get_page (get = vector )
23
26
24
- if code >= 400 or IDS_WAF_CHECK_PAYLOAD in vector and code is None :
27
+ if code >= 400 or ( IDS_WAF_CHECK_PAYLOAD in vector and ( code is None or re . search ( GENERIC_PROTECTION_REGEX , page or "" ) and not re . search ( GENERIC_PROTECTION_REGEX , original or "" ))) :
25
28
if code is not None :
26
29
kb .wafSpecificResponse = "HTTP/1.1 %s\n %s\n %s" % (code , "" .join (_ for _ in headers .headers or [] if not _ .startswith ("URI" )), page )
27
30
You can’t perform that action at this time.
0 commit comments