From 9289939cede92751551ae0027fd5f8697cbaaee7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 18 Apr 2019 11:07:58 +0200 Subject: [PATCH] Update for #3587 (multiple request files per option -r) --- lib/core/option.py | 29 ++++++++++++++++------------- lib/core/settings.py | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 3794cb1ae..d8097a7b5 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -293,22 +293,25 @@ def _setRequestFromFile(): """ if conf.requestFile: - conf.requestFile = safeExpandUser(conf.requestFile) - seen = set() + for requestFile in re.split(PARAMETER_SPLITTING_REGEX, conf.requestFile): + requestFile = safeExpandUser(requestFile) + seen = set() - if not checkFile(conf.requestFile, False): - errMsg = "specified HTTP request file '%s' " % conf.requestFile - errMsg += "does not exist" - raise SqlmapFilePathException(errMsg) + if not checkFile(requestFile, False): + errMsg = "specified HTTP request file '%s' " % requestFile + errMsg += "does not exist" + raise SqlmapFilePathException(errMsg) - infoMsg = "parsing HTTP request from '%s'" % conf.requestFile - logger.info(infoMsg) + infoMsg = "parsing HTTP request from '%s'" % requestFile + logger.info(infoMsg) - for target in parseRequestFile(conf.requestFile): - url = target[0] - if url not in seen: - kb.targets.add(target) - seen.add(url) + for target in parseRequestFile(requestFile): + url = target[0] + if url not in seen: + kb.targets.add(target) + if len(kb.targets) > 1: + conf.multipleTargets = True + seen.add(url) if conf.secondReq: conf.secondReq = safeExpandUser(conf.secondReq) diff --git a/lib/core/settings.py b/lib/core/settings.py index 707e070fa..eb52a52d5 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.3.4.19" +VERSION = "1.3.4.20" 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)