Skip to content

Commit 92b6521

Browse files
committed
Fixes #6129
1 parent 8ac458c commit 92b6521

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎lib/core/settings.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty import six
2121

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

‎lib/request/httpshandler.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def create_sock():
9191
else:
9292
for header, value in conf.httpHeaders:
9393
if header.lower() == "host":
94-
hostname = value
94+
match = re.search(r"\A\[(?P<hostname>.+)\](:\d+)?\Z", value.strip())
95+
hostname = match.group("hostname") if match else value.rsplit(":", 1)[0] if ":" in value else value
9596
break
9697
hostname = hostname if re.search(r"\A[\d.]+\Z", hostname or "") is None else None
9798
result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=hostname)

0 commit comments

Comments
 (0)