diff --git a/lib/core/common.py b/lib/core/common.py index c9c09977a..8fe6e0aaa 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2071,6 +2071,8 @@ def safeStringFormat(format_, params): >>> safeStringFormat('SELECT foo FROM %s LIMIT %d', ('bar', '1')) 'SELECT foo FROM bar LIMIT 1' + >>> safeStringFormat("SELECT foo FROM %s WHERE name LIKE '%susan%' LIMIT %d", ('bar', '1')) + "SELECT foo FROM bar WHERE name LIKE '%susan%' LIMIT 1" """ if format_.count(PAYLOAD_DELIMITER) == 2: @@ -2114,7 +2116,10 @@ def safeStringFormat(format_, params): warnMsg += "Please report by e-mail content \"%r | %r | %r\" to '%s'" % (format_, params, retVal, DEV_EMAIL_ADDRESS) raise SqlmapValueException(warnMsg) else: - retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count], retVal, 1) + try: + retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count], retVal, 1) + except re.error: + retVal = retVal.replace(match.group(0), match.group(0) % params[count], 1) count += 1 else: break diff --git a/lib/core/settings.py b/lib/core/settings.py index 7a91dd560..97686ba0c 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.10.0" +VERSION = "1.4.10.1" 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)