From d0fc7512dfe870c1738b966cf3c6e35bd3653e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Thu, 12 Nov 2026 16:25:57 +0100 Subject: [PATCH] Fix for -s with non-existent directory (traceback at the end of run) --- lib/core/settings.py | 2 +- lib/core/target.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 5737e0e34..3872c0b95 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -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) diff --git a/lib/core/target.py b/lib/core/target.py index b5afa1a08..0c73e59af 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -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: