Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd74a20

Browse files
committed
Update regarding #3466
1 parent 82aa481 commit bd74a20

4 files changed

Lines changed: 35 additions & 16 deletions

File tree

lib/core/common.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,6 +3535,32 @@ def intersect(containerA, containerB, lowerCase=False):
35353535

35363536
return retVal
35373537

3538+
def decodeStringEscape(value):
3539+
"""
3540+
Decodes escaped string values (e.g. "\\t" -> "\t")
3541+
"""
3542+
3543+
retVal = value
3544+
3545+
if value and '\\' in value:
3546+
if isinstance(value, unicode):
3547+
retVal = retVal.encode(UNICODE_ENCODING)
3548+
3549+
try:
3550+
retVal = codecs.escape_decode(retVal)[0]
3551+
except:
3552+
try:
3553+
retVal = retVal.decode("string_escape")
3554+
except:
3555+
charset = string.whitespace.replace(" ", "")
3556+
for _ in charset:
3557+
retVal = retVal.replace(repr(_).strip("'"), _)
3558+
3559+
if isinstance(value, unicode):
3560+
retVal = getUnicode(retVal)
3561+
3562+
return retVal
3563+
35383564
def removeReflectiveValues(content, payload, suppressWarning=False):
35393565
"""
35403566
Neutralizes reflective values in a given content based on a payload

lib/core/option.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from lib.core.common import boldifyMessage
3434
from lib.core.common import checkFile
3535
from lib.core.common import dataToStdout
36+
from lib.core.common import decodeStringEscape
3637
from lib.core.common import getPublicTypeMembers
3738
from lib.core.common import getSafeExString
3839
from lib.core.common import findLocalPort
@@ -1500,11 +1501,8 @@ def _cleanupOptions():
15001501
else:
15011502
conf.rParam = []
15021503

1503-
if conf.paramDel and '\\' in conf.paramDel:
1504-
try:
1505-
conf.paramDel = conf.paramDel.decode("string_escape")
1506-
except ValueError:
1507-
pass
1504+
if conf.paramDel:
1505+
conf.paramDel = decodeStringEscape(conf.paramDel)
15081506

15091507
if conf.skip:
15101508
conf.skip = conf.skip.replace(" ", "")
@@ -1616,7 +1614,7 @@ class _(unicode):
16161614
conf.code = int(conf.code)
16171615

16181616
if conf.csvDel:
1619-
conf.csvDel = conf.csvDel.decode("string_escape") # e.g. '\\t' -> '\t'
1617+
conf.csvDel = decodeStringEscape(conf.csvDel)
16201618

16211619
if conf.torPort and isinstance(conf.torPort, basestring) and conf.torPort.isdigit():
16221620
conf.torPort = int(conf.torPort)
@@ -1629,12 +1627,7 @@ class _(unicode):
16291627
setPaths(paths.SQLMAP_ROOT_PATH)
16301628

16311629
if conf.string:
1632-
try:
1633-
conf.string = conf.string.decode("unicode_escape")
1634-
except:
1635-
charset = string.whitespace.replace(" ", "")
1636-
for _ in charset:
1637-
conf.string = conf.string.replace(_.encode("string_escape"), _)
1630+
conf.string = decodeStringEscape(conf.string)
16381631

16391632
if conf.getAll:
16401633
map(lambda _: conf.__setitem__(_, True), WIZARD.ALL)

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.3.1.83"
22+
VERSION = "1.3.2.0"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
3030
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
3131
ed7874be0d2d3802f3d20184f2b280d5 lib/core/agent.py
3232
a932126e7d80e545c5d44af178d0bc0c lib/core/bigarray.py
33-
872f111e8283a4d36cd56f19d26cd13d lib/core/common.py
33+
abbe98412255c4856ef30a15da8136a2 lib/core/common.py
3434
de8d27ae6241163ff9e97aa9e7c51a18 lib/core/convert.py
3535
abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py
3636
e1f7758f433202c50426efde5eb96768 lib/core/datatype.py
@@ -43,14 +43,14 @@ e1f7758f433202c50426efde5eb96768 lib/core/datatype.py
4343
fb6be55d21a70765e35549af2484f762 lib/core/__init__.py
4444
18c896b157b03af716542e5fe9233ef9 lib/core/log.py
4545
fa9f24e88c81a6cef52da3dd5e637010 lib/core/optiondict.py
46-
b39587efbf4aef1283c0bbf1e723a8ab lib/core/option.py
46+
9357506018d15f30cffb99a0005d7f1c lib/core/option.py
4747
fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py
4848
4b12aa67fbf6c973d12e54cf9cb54ea0 lib/core/profiling.py
4949
5e2c16a8e2daee22dd545df13386e7a3 lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
0e382a4dfbcfa74d104d172f53beff98 lib/core/settings.py
53+
6b0f9c399579d0b7fdc90a4653d16424 lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
9c7b5c6397fb3da33e7a4d7876d159c6 lib/core/target.py

0 commit comments

Comments
 (0)