From 92b652177b1cbd6b0af0ecc6488cd80b30b93e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Fri, 25 Sep 2026 11:00:58 +0200 Subject: [PATCH] Fixes #6129 --- lib/core/settings.py | 2 +- lib/request/httpshandler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index e7c1a3950..c6dc09eb5 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.9.22" +VERSION = "1.10.9.23" 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/request/httpshandler.py b/lib/request/httpshandler.py index 4e95c6006..b27764632 100644 --- a/lib/request/httpshandler.py +++ b/lib/request/httpshandler.py @@ -91,7 +91,8 @@ class HTTPSConnection(_http_client.HTTPSConnection): else: for header, value in conf.httpHeaders: if header.lower() == "host": - hostname = value + match = re.search(r"\A\[(?P.+)\](:\d+)?\Z", value.strip()) + hostname = match.group("hostname") if match else value.rsplit(":", 1)[0] if ":" in value else value break hostname = hostname if re.search(r"\A[\d.]+\Z", hostname or "") is None else None result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=hostname)