Minor improvement for international strings in payloads

This commit is contained in:
Miroslav Stampar 2019-05-31 00:17:50 +02:00
parent 257fa3e9e4
commit 9b6d30da0d
3 changed files with 11 additions and 7 deletions

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.156"
VERSION = "1.3.5.157"
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

@ -12,9 +12,6 @@ from lib.core.settings import EXCLUDE_UNESCAPE
class Unescaper(AttribDict):
def escape(self, expression, quote=True, dbms=None):
if conf.noEscape:
return expression
if expression is None:
return expression

View File

@ -7,6 +7,8 @@ See the file 'LICENSE' for copying permission
import re
from lib.core.convert import getBytes
from lib.core.data import conf
from lib.core.exception import SqlmapUndefinedMethod
class Syntax(object):
@ -23,9 +25,14 @@ class Syntax(object):
if quote:
for item in re.findall(r"'[^']*'+", expression):
_ = item[1:-1]
if _:
retVal = retVal.replace(item, escaper(_))
original = item[1:-1]
if original:
replacement = escaper(original) if not conf.noEscape else original
if replacement != original:
retVal = retVal.replace(item, replacement)
elif len(original) != len(getBytes(original)) and "n'%s'" % original not in retVal:
retVal = retVal.replace("'%s'" % original, "n'%s'" % original)
else:
retVal = escaper(expression)