mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-30 10:09:03 +00:00
Fixing checkSameHost to work with IPv6 addresses
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user