Fixing checkSameHost to work with IPv6 addresses

This commit is contained in:
Miroslav Stampar
2026-01-28 19:01:07 +01:00
parent 0ce9d4aeb7
commit fcd3eae668
3 changed files with 14 additions and 4 deletions

View File

@@ -4811,7 +4811,17 @@ def checkSameHost(*urls):
value = "http://%s" % value
return value
return all(re.sub(r"(?i)\Awww\.", "", _urllib.parse.urlparse(_(url) or "").netloc.split(':')[0]) == re.sub(r"(?i)\Awww\.", "", _urllib.parse.urlparse(_(urls[0]) or "").netloc.split(':')[0]) for url in urls[1:])
first = _urllib.parse.urlparse(_(urls[0]) or "").hostname or ""
first = re.sub(r"(?i)\Awww\.", "", first)
for url in urls[1:]:
current = _urllib.parse.urlparse(_(url) or "").hostname or ""
current = re.sub(r"(?i)\Awww\.", "", current)
if current != first:
return False
return True
def getHostHeader(url):
"""

View File

@@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.1.69"
VERSION = "1.10.1.70"
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)