Skip to content

Commit 5380e81

Browse files
committed
Safer WAF heuristics in case of URI injections
1 parent 4cefff7 commit 5380e81

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

lib/controller/checks.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,14 +1332,19 @@ def checkWaf():
13321332
retVal = False
13331333
payload = "%d %s" % (randomInt(), IDS_WAF_CHECK_PAYLOAD)
13341334

1335-
value = "" if not conf.parameters.get(PLACE.GET) else conf.parameters[PLACE.GET] + DEFAULT_GET_POST_DELIMITER
1336-
value += "%s=%s" % (randomStr(), agent.addPayloadDelimiters(payload))
1335+
if PLACE.URI in conf.parameters:
1336+
place = PLACE.POST
1337+
value = "%s=%s" % (randomStr(), agent.addPayloadDelimiters(payload))
1338+
else:
1339+
place = PLACE.GET
1340+
value = "" if not conf.parameters.get(PLACE.GET) else conf.parameters[PLACE.GET] + DEFAULT_GET_POST_DELIMITER
1341+
value += "%s=%s" % (randomStr(), agent.addPayloadDelimiters(payload))
13371342

13381343
pushValue(conf.timeout)
13391344
conf.timeout = IDS_WAF_CHECK_TIMEOUT
13401345

13411346
try:
1342-
retVal = Request.queryPage(place=PLACE.GET, value=value, getRatioValue=True, noteResponseTime=False, silent=True)[1] < IDS_WAF_CHECK_RATIO
1347+
retVal = Request.queryPage(place=place, value=value, getRatioValue=True, noteResponseTime=False, silent=True)[1] < IDS_WAF_CHECK_RATIO
13431348
except SqlmapConnectionException:
13441349
retVal = True
13451350
finally:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.3.14"
22+
VERSION = "1.2.3.15"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ c88d66597f4aab719bde4542b0a1a6e0 extra/shutils/regressiontest.py
2121
1e5532ede194ac9c083891c2f02bca93 extra/sqlharvest/__init__.py
2222
b3e60ea4e18a65c48515d04aab28ff68 extra/sqlharvest/sqlharvest.py
2323
0f581182871148b0456a691ae85b04c0 lib/controller/action.py
24-
5132e59761d8bb617412d2aaaf987716 lib/controller/checks.py
24+
e8533a8a406fe58cc610337639ed4bb1 lib/controller/checks.py
2525
9fbd66da9b5cf58bbb8474ccf9252bb7 lib/controller/controller.py
2626
a7b0c8e5a18a3abe8803999dcfc4664f lib/controller/handler.py
2727
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
@@ -46,7 +46,7 @@ ffa5f01f39b17c8d73423acca6cfe86a lib/core/readlineng.py
4646
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4747
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
4848
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
49-
b7e3ed2ba524c6b532fcc13025bd7dc3 lib/core/settings.py
49+
32680252839964d1ff2c62207f64b3b0 lib/core/settings.py
5050
d0adc28a38e43a787df4471f7f027413 lib/core/shell.py
5151
63491be462c515a1a3880c27c2acc4a2 lib/core/subprocessng.py
5252
3cc852f927833895361973fbcfd156d2 lib/core/target.py

0 commit comments

Comments
 (0)