From 2e96e3c9248336a9b3e8208b57ce1628ade896b2 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 29 Apr 2014 23:26:45 +0200 Subject: [PATCH] Adding a hidden switch --ignore-401 --- lib/core/optiondict.py | 1 + lib/parse/cmdline.py | 3 +++ lib/request/connect.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/optiondict.py b/lib/core/optiondict.py index 7bede5304..9a1c0e450 100644 --- a/lib/core/optiondict.py +++ b/lib/core/optiondict.py @@ -224,6 +224,7 @@ optDict = { "cpuThrottle": "integer", "forceDns": "boolean", "identifyWaf": "boolean", + "ignore401": "boolean", "smokeTest": "boolean", "liveTest": "boolean", "stopFail": "boolean", diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index d3295c3a8..292482348 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -714,6 +714,9 @@ def cmdLineParser(): parser.add_option("--force-dns", dest="forceDns", action="store_true", help=SUPPRESS_HELP) + parser.add_option("--ignore-401", dest="ignore401", action="store_true", + help=SUPPRESS_HELP) + parser.add_option("--smoke-test", dest="smokeTest", action="store_true", help=SUPPRESS_HELP) diff --git a/lib/request/connect.py b/lib/request/connect.py index aeb85a36c..da5d9373c 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -493,7 +493,7 @@ class Connect(object): logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg) - if e.code == httplib.UNAUTHORIZED: + if e.code == httplib.UNAUTHORIZED and not conf.ignore401: errMsg = "not authorized, try to provide right HTTP " errMsg += "authentication type and valid credentials (%d)" % code raise SqlmapConnectionException(errMsg)