From f87aa83e9b0633aec867c436e89281f00a2ed7cf Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 21 Feb 2021 22:49:57 +0100 Subject: [PATCH] Dirty implementation for #4571 --- lib/core/settings.py | 2 +- lib/parse/cmdline.py | 3 +++ lib/request/connect.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index d25a969e0..c5b5b2a73 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.2.21" +VERSION = "1.5.2.22" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 39676d89e..8efac88a7 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -794,6 +794,9 @@ def cmdLineParser(argv=None): parser.add_argument("--profile", dest="profile", action="store_true", help=SUPPRESS) + parser.add_argument("--localhost", dest="localhost", action="store_true", + help=SUPPRESS) + parser.add_argument("--force-dbms", dest="forceDbms", help=SUPPRESS) diff --git a/lib/request/connect.py b/lib/request/connect.py index 67eaf12a1..7c4e47bec 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -488,6 +488,9 @@ class Connect(object): header, value = line.split(':', 1) headers[header] = value + if conf.localhost: + headers[HTTP_HEADER.HOST] = "localhost" + for key, value in list(headers.items()): del headers[key] if isinstance(value, six.string_types):