diff --git a/lib/core/common.py b/lib/core/common.py index ccb4b3fb4..1c7e98f1d 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1080,7 +1080,7 @@ def readInput(message, default=None, checkBatch=True, boolean=False): logger.debug(debugMsg) if retVal is None: - if checkBatch and conf.get("batch") or conf.get("api"): + if checkBatch and conf.get("batch") or any(conf.get(_) for _ in ("api", "nonInteractive")): if isListLike(default): options = ','.join(getUnicode(opt, UNICODE_ENCODING) for opt in default) elif default: diff --git a/lib/core/option.py b/lib/core/option.py index 307c1304e..d21f1e299 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -330,8 +330,13 @@ def _setRequestFromFile(): infoMsg = "parsing second-order HTTP request from '%s'" % conf.secondReq logger.info(infoMsg) - target = next(parseRequestFile(conf.secondReq, False)) - kb.secondReq = target + try: + target = next(parseRequestFile(conf.secondReq, False)) + kb.secondReq = target + except StopIteration: + errMsg = "specified second-order HTTP request file '%s' " % conf.secondReq + errMsg += "does not contain a valid HTTP request" + raise SqlmapDataException(errMsg) def _setCrawler(): if not conf.crawlDepth: diff --git a/lib/core/settings.py b/lib/core/settings.py index bd5690b56..4356b5d40 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.1.14" +VERSION = "1.4.1.15" 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/testing.py b/lib/core/testing.py index d26dc964c..980fa16dc 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -178,7 +178,7 @@ def fuzzTest(): open(config, "w+").write("\n".join(lines)) - cmd = "%s %s -c %s --batch --flush-session --technique=%s --banner" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), config, random.sample("BEUQ", 1)[0]) + cmd = "%s %s -c %s --non-interactive --flush-session --technique=%s --banner" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "sqlmap.py")), config, random.sample("BEUQ", 1)[0]) output = shellExec(cmd) if "Traceback" in output: diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 09c963d8f..91f871db9 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -781,6 +781,9 @@ def cmdLineParser(argv=None): parser.add_argument("--force-pivoting", dest="forcePivoting", action="store_true", help=SUPPRESS) + parser.add_argument("--non-interactive", dest="nonInteractive", action="store_true", + help=SUPPRESS) + parser.add_argument("--gui", dest="gui", action="store_true", help=SUPPRESS)