File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from lib .core .enums import OS
2020
2121# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22- VERSION = "1.1.12.21 "
22+ VERSION = "1.1.12.22 "
2323TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2424TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2525VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
8484# Regular expression used for recognition of generic permission messages
8585PERMISSION_DENIED_REGEX = r"(command|permission|access)\s*(was|is)?\s*denied"
8686
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+
8790# Regular expression used for recognition of generic maximum connection messages
8891MAX_CONNECTIONS_REGEX = r"\bmax.+?\bconnection"
8992
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ f872699e948d0692ce11b54781da814c lib/core/log.py
4646760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
484802d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49- 8876dee2d5d1f9efbb520c78849b9a3a lib/core/settings.py
49+ ea5aa15bc9cc2d2dc1b68c6e8121b650 lib/core/settings.py
505035bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252d93501771b41315f9fb949305b6ed257 lib/core/target.py
@@ -407,7 +407,7 @@ d3aa7e5b222811f90c75aa8a0db509a3 waf/dosarrest.py
407407f4883f1443676f5291b1ef3e2cf0cbfd waf/edgecast.py
408408cd558b27d5bc4e42fcd5571d8c9c3a10 waf/expressionengine.py
4094096ccb307f53f878eacf9d08d0e97738e2 waf/fortiweb.py
410- daf5235e066e18c0d9ba9f9b5bc9e47b waf/generic.py
410+ 37c81331b70c755610a5c70ead8fc7b6 waf/generic.py
411411200d859893c4e84fbae9c32d5099ab65 waf/hyperguard.py
412412ced90975810f7f68103d38523567ab3f waf/incapsula.py
4134135fb9aaf874daa47ea2b672a22740e56b waf/__init__.py
Original file line number Diff line number Diff line change 55See the file 'LICENSE' for copying permission
66"""
77
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
912from lib .core .settings import IDS_WAF_CHECK_PAYLOAD
1013from lib .core .settings import WAF_ATTACK_VECTORS
1114
1417def detect (get_page ):
1518 retval = False
1619
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 :
1922 return False
2023
2124 for vector in WAF_ATTACK_VECTORS :
22- page , _ , code = get_page (get = vector )
25+ page , headers , code = get_page (get = vector )
2326
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 "" ))) :
2528 if code is not None :
2629 kb .wafSpecificResponse = "HTTP/1.1 %s\n %s\n %s" % (code , "" .join (_ for _ in headers .headers or [] if not _ .startswith ("URI" )), page )
2730
You can’t perform that action at this time.
0 commit comments