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

Skip to content

Commit 81caf14

Browse files
committed
Adding switch --skip-waf
1 parent e81e474 commit 81caf14

5 files changed

Lines changed: 17 additions & 4 deletions

File tree

lib/controller/checks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,12 +1142,12 @@ def checkWaf():
11421142
Reference: http://seclists.org/nmap-dev/2011/q2/att-1005/http-waf-detect.nse
11431143
"""
11441144

1145-
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline)):
1145+
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline, conf.skipWaf)):
11461146
return None
11471147

1148-
dbmMsg = "heuristically checking if the target is protected by "
1149-
dbmMsg += "some kind of WAF/IPS/IDS"
1150-
logger.debug(dbmMsg)
1148+
infoMsg = "checking if the target is protected by "
1149+
infoMsg += "some kind of WAF/IPS/IDS"
1150+
logger.info(infoMsg)
11511151

11521152
retVal = False
11531153
payload = "%d %s" % (randomInt(), IDS_WAF_CHECK_PAYLOAD)

lib/core/option.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,10 @@ def _basicOptionValidation():
22952295
errMsg = "option '-d' is incompatible with option '-u' ('--url')"
22962296
raise SqlmapSyntaxException(errMsg)
22972297

2298+
if conf.identifyWaf and conf.skipWaf:
2299+
errMsg = "switch '--identify-waf' is incompatible with switch '--skip-waf'"
2300+
raise SqlmapSyntaxException(errMsg)
2301+
22982302
if conf.titles and conf.nullConnection:
22992303
errMsg = "switch '--titles' is incompatible with switch '--null-connection'"
23002304
raise SqlmapSyntaxException(errMsg)

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
"cpuThrottle": "integer",
232232
"forceDns": "boolean",
233233
"identifyWaf": "boolean",
234+
"skipWaf": "boolean",
234235
"ignore401": "boolean",
235236
"smokeTest": "boolean",
236237
"liveTest": "boolean",

lib/parse/cmdline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,10 @@ def cmdLineParser(argv=None):
713713
action="store_true",
714714
help="Make a thorough testing for a WAF/IPS/IDS protection")
715715

716+
miscellaneous.add_option("--skip-waf", dest="skipWaf",
717+
action="store_true",
718+
help="Skip heuristic detection of WAF/IPS/IDS protection")
719+
716720
miscellaneous.add_option("--mobile", dest="mobile",
717721
action="store_true",
718722
help="Imitate smartphone through HTTP User-Agent header")

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ googlePage = 1
750750
# Valid: True or False
751751
identifyWaf = False
752752

753+
# Skip heuristic detection of WAF/IPS/IDS protection.
754+
# Valid: True or False
755+
skipWaf = False
756+
753757
# Imitate smartphone through HTTP User-Agent header.
754758
# Valid: True or False
755759
mobile = False

0 commit comments

Comments
 (0)