Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e9bf47

Browse files
committed
Heuristic check for WAF/IDS/IPS is now prone to tamper functions (Issue #1145)
1 parent 9e90e35 commit 2e9bf47

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

lib/controller/checks.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,22 +1101,17 @@ def checkWaf():
11011101
logger.debug(dbmMsg)
11021102

11031103
retVal = False
1104-
backup = dict(conf.parameters)
11051104
payload = "%d %s" % (randomInt(), IDS_WAF_CHECK_PAYLOAD)
11061105

1107-
conf.parameters = dict(backup)
1108-
conf.parameters[PLACE.GET] = "" if not conf.parameters.get(PLACE.GET) else conf.parameters[PLACE.GET] + DEFAULT_GET_POST_DELIMITER
1109-
conf.parameters[PLACE.GET] += "%s=%s" % (randomStr(), payload)
1110-
1111-
logger.log(CUSTOM_LOGGING.PAYLOAD, payload)
1106+
value = "" if not conf.parameters.get(PLACE.GET) else conf.parameters[PLACE.GET] + DEFAULT_GET_POST_DELIMITER
1107+
value += agent.addPayloadDelimiters("%s=%s" % (randomStr(), payload))
11121108

11131109
try:
1114-
retVal = Request.queryPage(getRatioValue=True, noteResponseTime=False, silent=True)[1] < IDS_WAF_CHECK_RATIO
1110+
retVal = Request.queryPage(place=PLACE.GET, value=value, getRatioValue=True, noteResponseTime=False, silent=True)[1] < IDS_WAF_CHECK_RATIO
11151111
except SqlmapConnectionException:
11161112
retVal = True
11171113
finally:
11181114
kb.matchRatio = None
1119-
conf.parameters = dict(backup)
11201115

11211116
if retVal:
11221117
warnMsg = "heuristics detected that the target "

0 commit comments

Comments
 (0)