diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 218f80fd2..5d920efb5 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -150,6 +150,9 @@ def cmdLineParser(argv=None): request.add_option("--auth-file", dest="authFile", help="HTTP authentication PEM cert/private key file") + request.add_option("--ignore-400", dest="ignore400", action="store_true", + help="Suppress HTTP Error 400 (Bad Request)") + request.add_option("--ignore-401", dest="ignore401", action="store_true", help="Ignore HTTP Error 401 (Unauthorized)") diff --git a/lib/request/connect.py b/lib/request/connect.py index 23b6b44ab..e73839e73 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -619,8 +619,9 @@ class Connect(object): else: raise SqlmapConnectionException(warnMsg) else: - debugMsg = "got HTTP error code: %d (%s)" % (code, status) - logger.debug(debugMsg) + if ex.code == httplib.BAD_REQUEST and not conf.ignore400: + debugMsg = "got HTTP error code: %d (%s)" % (code, status) + logger.debug(debugMsg) except (urllib2.URLError, socket.error, socket.timeout, httplib.HTTPException, struct.error, binascii.Error, ProxyError, SqlmapCompressionException, WebSocketException, TypeError, ValueError): tbMsg = traceback.format_exc()