Fix for -s with non-existent directory (traceback at the end of run)

This commit is contained in:
Miroslav Štampar 2026-11-12 16:25:57 +01:00
parent d646b00ceb
commit d0fc7512df
2 changed files with 5 additions and 1 deletions

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.50"
VERSION = "1.10.11.51"
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)

View file

@ -486,6 +486,10 @@ def _setHashDB():
if not conf.hashDBFile:
conf.hashDBFile = conf.sessionFile or os.path.join(conf.outputPath, SESSION_SQLITE_FILE)
if conf.sessionFile and not os.path.isdir(os.path.dirname(os.path.abspath(conf.hashDBFile))):
errMsg = "directory of the provided session file '%s' does not exist" % conf.sessionFile
raise SqlmapFilePathException(errMsg)
if conf.flushSession:
if os.path.exists(conf.hashDBFile):
if conf.hashDB: