mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-13 18:10:38 +03:00
Minor improvement for international strings in payloads
This commit is contained in:
parent
257fa3e9e4
commit
9b6d30da0d
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# 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 = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
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)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -12,9 +12,6 @@ from lib.core.settings import EXCLUDE_UNESCAPE
|
||||||
|
|
||||||
class Unescaper(AttribDict):
|
class Unescaper(AttribDict):
|
||||||
def escape(self, expression, quote=True, dbms=None):
|
def escape(self, expression, quote=True, dbms=None):
|
||||||
if conf.noEscape:
|
|
||||||
return expression
|
|
||||||
|
|
||||||
if expression is None:
|
if expression is None:
|
||||||
return expression
|
return expression
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ See the file 'LICENSE' for copying permission
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from lib.core.convert import getBytes
|
||||||
|
from lib.core.data import conf
|
||||||
from lib.core.exception import SqlmapUndefinedMethod
|
from lib.core.exception import SqlmapUndefinedMethod
|
||||||
|
|
||||||
class Syntax(object):
|
class Syntax(object):
|
||||||
|
@ -23,9 +25,14 @@ class Syntax(object):
|
||||||
|
|
||||||
if quote:
|
if quote:
|
||||||
for item in re.findall(r"'[^']*'+", expression):
|
for item in re.findall(r"'[^']*'+", expression):
|
||||||
_ = item[1:-1]
|
original = item[1:-1]
|
||||||
if _:
|
if original:
|
||||||
retVal = retVal.replace(item, escaper(_))
|
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:
|
else:
|
||||||
retVal = escaper(expression)
|
retVal = escaper(expression)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user