Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from thirdparty import six

# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.9.22"
VERSION = "1.10.9.24"
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)
Expand Down
3 changes: 2 additions & 1 deletion lib/request/httpshandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def create_sock():
else:
for header, value in conf.httpHeaders:
if header.lower() == "host":
hostname = value
match = re.search(r"\A\[(?P<hostname>.+)\](:\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)
Expand Down
13 changes: 12 additions & 1 deletion tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,25 @@ class TestMultiTargetTaskId(_CollectorCase):
def setUp(self):
super(TestMultiTargetTaskId, self).setUp()
from lib.core.dump import Dump
self._had_reportTaskId = "reportTaskId" in kb
self._saved_reportTaskId = kb.get("reportTaskId")
self._saved_dumper = conf.get("dumper")
self._saved_reportCollector = conf.get("reportCollector")
conf.dumper = Dump()
conf.reportCollector = self.c

def tearDown(self):
kb.reportTaskId = self._saved_reportTaskId
# restore to the PRIOR STATE exactly - if the key was absent before (the common case, since
# kb.reportTaskId is normally set lazily by a multi-target run), setting it to the saved None
# would instead leave it explicitly present with value None, which breaks the
# kb.get("reportTaskId", REPORT_TASKID) fallback used elsewhere (e.g. ReportErrorRecorder.emit())
# for the rest of the test process - order-dependent flakiness, since Python 2's unittest
# discover() does not sort tests/ (unlike Python 3's), so this class can run before
# TestReportErrorCapture depending on the checkout's raw directory order
if self._had_reportTaskId:
kb.reportTaskId = self._saved_reportTaskId
else:
del kb.reportTaskId
conf.dumper = self._saved_dumper
conf.reportCollector = self._saved_reportCollector
super(TestMultiTargetTaskId, self).tearDown()
Expand Down