This commit is contained in:
Miroslav Stampar 2023-01-23 16:40:41 +01:00
parent 1be7a5aea8
commit c8eea24ac4
5 changed files with 17 additions and 5 deletions

View File

@ -204,6 +204,7 @@ optDict = {
"General": {
"trafficFile": "string",
"abortOnEmpty": "boolean",
"answers": "string",
"batch": "boolean",
"base64Parameter": "string",

View File

@ -20,7 +20,7 @@ from thirdparty import six
from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.7.1.7"
VERSION = "1.7.1.8"
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

@ -628,6 +628,9 @@ def cmdLineParser(argv=None):
general.add_argument("-t", dest="trafficFile",
help="Log all HTTP traffic into a textual file")
general.add_argument("--abort-on-empty", dest="abortOnEmpty", action="store_true",
help="Abort data retrieval on empty results")
general.add_argument("--answers", dest="answers",
help="Set predefined answers (e.g. \"quit=N,follow=N\")")

View File

@ -501,6 +501,11 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
kb.safeCharEncode = False
if not any((kb.testMode, conf.dummy, conf.offline, conf.noCast, conf.hexConvert)) and value is None and Backend.getDbms() and conf.dbmsHandler and kb.fingerprinted:
if conf.abortOnEmpty:
errMsg = "aborting due to empty data retrieval"
logger.critical(errMsg)
raise SystemExit
else:
warnMsg = "in case of continuous data retrieval problems you are advised to try "
warnMsg += "a switch '--no-cast' "
warnMsg += "or switch '--hex'" if hasattr(queries[Backend.getIdentifiedDbms()], "hex") else ""

View File

@ -702,6 +702,9 @@ sessionFile =
# Log all HTTP traffic into a textual file.
trafficFile =
# Abort data retrieval on empty results.
abortOnEmpty = False
# Set predefined answers (e.g. "quit=N,follow=N").
answers =