Fix for direct connections (-d) sharing session data among different databases (e.g. SQLite files)

This commit is contained in:
Miroslav Štampar 2026-11-12 16:57:46 +01:00
parent 11d3ee00e6
commit c209a97131
2 changed files with 3 additions and 3 deletions

View file

@ -5389,7 +5389,7 @@ def hashDBWrite(key, value, serialize=False):
"""
if conf.hashDB:
_ = '|'.join((str(_) if not isinstance(_, six.string_types) else _) for _ in (conf.hostname, conf.path.strip('/') if conf.path is not None else conf.port, key, HASHDB_MILESTONE_VALUE))
_ = '|'.join((str(_) if not isinstance(_, six.string_types) else _) for _ in (conf.hostname, conf.path.strip('/') if conf.path is not None else ("%s:%s" % (conf.port, conf.dbmsDb) if conf.direct else conf.port), key, HASHDB_MILESTONE_VALUE)) # Note: in case of direct connection, database (e.g. SQLite file) is part of the key
conf.hashDB.write(_, value, serialize)
def hashDBRetrieve(key, unserialize=False, checkConf=False):
@ -5400,7 +5400,7 @@ def hashDBRetrieve(key, unserialize=False, checkConf=False):
retVal = None
if conf.hashDB:
_ = '|'.join((str(_) if not isinstance(_, six.string_types) else _) for _ in (conf.hostname, conf.path.strip('/') if conf.path is not None else conf.port, key, HASHDB_MILESTONE_VALUE))
_ = '|'.join((str(_) if not isinstance(_, six.string_types) else _) for _ in (conf.hostname, conf.path.strip('/') if conf.path is not None else ("%s:%s" % (conf.port, conf.dbmsDb) if conf.direct else conf.port), key, HASHDB_MILESTONE_VALUE)) # Note: in case of direct connection, database (e.g. SQLite file) is part of the key
retVal = conf.hashDB.retrieve(_, unserialize) if kb.resumeValues and not (checkConf and any((conf.flushSession, conf.freshQueries))) else None
if not kb.inferenceMode and not kb.fileReadMode and isinstance(retVal, six.string_types) and any(_ in retVal for _ in (PARTIAL_VALUE_MARKER, PARTIAL_HEX_VALUE_MARKER)):

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.11.58"
VERSION = "1.10.11.59"
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)