diff --git a/lib/core/common.py b/lib/core/common.py index 0aa977cc6..4688cf4b4 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -4598,9 +4598,8 @@ def parseRequestFile(reqFile, checkParams=True): reqResList = re.finditer(BURP_REQUEST_REGEX, content, re.I | re.S) for match in reqResList: - request = match if isinstance(match, basestring) else match.group(0) + request = match if isinstance(match, basestring) else match.group(1) request = re.sub(r"\A[^\w]+", "", request) - schemePort = re.search(r"(http[\w]*)\:\/\/.*?\:([\d]+).+?={10,}", request, re.I | re.S) if schemePort: diff --git a/lib/core/option.py b/lib/core/option.py index 27b63e81f..56ce2ce98 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -100,6 +100,7 @@ from lib.core.optiondict import optDict from lib.core.settings import CODECS_LIST_PAGE from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR from lib.core.settings import DBMS_ALIASES +from lib.core.settings import DEFAULT_GET_POST_DELIMITER from lib.core.settings import DEFAULT_PAGE_ENCODING from lib.core.settings import DEFAULT_TOR_HTTP_PORTS from lib.core.settings import DEFAULT_TOR_SOCKS_PORTS @@ -223,10 +224,11 @@ def _setMultipleTargets(): if os.path.isfile(conf.logFile): for target in parseRequestFile(conf.logFile): - url = target[0] - if url not in seen: + url, _, data, _, _ = target + key = re.sub(r"(\w+=)[^%s ]*" % (conf.paramDel or DEFAULT_GET_POST_DELIMITER), r"\g<1>", "%s %s" % (url, data)) + if key not in seen: kb.targets.add(target) - seen.add(url) + seen.add(key) elif os.path.isdir(conf.logFile): files = os.listdir(conf.logFile) @@ -237,10 +239,11 @@ def _setMultipleTargets(): continue for target in parseRequestFile(os.path.join(conf.logFile, reqFile)): - url = target[0] - if url not in seen: + url, _, data, _, _ = target + key = re.sub(r"(\w+=)[^%s ]*" % (conf.paramDel or DEFAULT_GET_POST_DELIMITER), r"\g<1>", "%s %s" % (url, data)) + if key not in seen: kb.targets.add(target) - seen.add(url) + seen.add(key) else: errMsg = "the specified list of targets is not a file " diff --git a/lib/core/settings.py b/lib/core/settings.py index f271207ac..6139b4e9d 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.3.1.1" +VERSION = "1.3.1.2" 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) @@ -360,7 +360,7 @@ COMMON_PASSWORD_SUFFIXES += ("!", ".", "*", "!!", "?", ";", "..", "!!!", ", ", " WEBSCARAB_SPLITTER = "### Conversation" # Splitter used between requests in BURP log files -BURP_REQUEST_REGEX = r"={10,}\s+[^=]+={10,}\s(.+?)\s={10,}" +BURP_REQUEST_REGEX = r"={10,}\s+([A-Z]{3,} .+?)\s+={10,}" # Regex used for parsing XML Burp saved history items BURP_XML_HISTORY_REGEX = r'(\d+).+?