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

Skip to content

Commit 453a6fb

Browse files
committed
Update for #3831
1 parent 9d0f446 commit 453a6fb

6 files changed

Lines changed: 14 additions & 5 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ def checkConnection(suppressOutput=False):
15181518
warnMsg += "which could interfere with the results of the tests"
15191519
logger.warn(warnMsg)
15201520
elif wasLastResponseHTTPError():
1521-
if getLastRequestHTTPError() != conf.ignoreCode:
1521+
if getLastRequestHTTPError() not in (conf.ignoreCode or []):
15221522
warnMsg = "the web server responded with an HTTP error code (%d) " % getLastRequestHTTPError()
15231523
warnMsg += "which could interfere with the results of the tests"
15241524
logger.warn(warnMsg)

lib/core/option.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,15 @@ def _cleanupOptions():
15551555
else:
15561556
conf.testParameter = []
15571557

1558+
if conf.ignoreCode:
1559+
try:
1560+
conf.ignoreCode = [int(_) for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.ignoreCode)]
1561+
except ValueError:
1562+
errMsg = "options '--ignore-code' should contain a list of integer values"
1563+
raise SqlmapSyntaxException(errMsg)
1564+
else:
1565+
conf.ignoreCode = []
1566+
15581567
if conf.paramFilter:
15591568
conf.paramFilter = [_.strip() for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.paramFilter.upper())]
15601569
else:

lib/core/optiondict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"authType": "string",
3939
"authCred": "string",
4040
"authFile": "string",
41-
"ignoreCode": "integer",
41+
"ignoreCode": "string",
4242
"ignoreProxy": "boolean",
4343
"ignoreRedirects": "boolean",
4444
"ignoreTimeouts": "boolean",

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

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

lib/parse/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def cmdLineParser(argv=None):
176176
request.add_argument("--auth-file", dest="authFile",
177177
help="HTTP authentication PEM cert/private key file")
178178

179-
request.add_argument("--ignore-code", dest="ignoreCode", type=int,
179+
request.add_argument("--ignore-code", dest="ignoreCode",
180180
help="Ignore (problematic) HTTP error code (e.g. 401)")
181181

182182
request.add_argument("--ignore-proxy", dest="ignoreProxy", action="store_true",

lib/request/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ class _(dict):
646646
if not multipart:
647647
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
648648

649-
if ex.code != conf.ignoreCode:
649+
if ex.code not in (conf.ignoreCode or []):
650650
if ex.code == _http_client.UNAUTHORIZED:
651651
errMsg = "not authorized, try to provide right HTTP "
652652
errMsg += "authentication type and valid credentials (%d)" % code

0 commit comments

Comments
 (0)