Skip to content

Commit 68ee1f3

Browse files
committed
1 parent 62ae149 commit 68ee1f3

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ def getSQLSnippet(dbms, sfile, **variables):
19851985
retVal = re.sub(r";\s+", "; ", retVal).strip("\r\n")
19861986

19871987
for _ in variables.keys():
1988-
retVal = re.sub(r"%%%s%%" % _, variables[_], retVal)
1988+
retVal = re.sub(r"%%%s%%" % _, variables[_].replace('\\', r'\\'), retVal)
19891989

19901990
for _ in re.findall(r"%RANDSTR\d+%", retVal, re.I):
19911991
retVal = retVal.replace(_, randomStr())

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.1.7.30"
22+
VERSION = "1.1.7.31"
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)

lib/request/connect.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,33 +1075,33 @@ def _randomizeParameter(paramString, randomParameter):
10751075
if kb.postHint in (POST_HINT.XML, POST_HINT.SOAP):
10761076
if re.search(r"<%s\b" % re.escape(name), post):
10771077
found = True
1078-
post = re.sub(r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re.escape(name), re.escape(name)), "\g<1>%s\g<3>" % value, post)
1078+
post = re.sub(r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re.escape(name), re.escape(name)), "\g<1>%s\g<3>" % value.replace('\\', r'\\'), post)
10791079
elif re.search(r"\b%s>" % re.escape(name), post):
10801080
found = True
1081-
post = re.sub(r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re.escape(name), re.escape(name)), "\g<1>%s\g<3>" % value, post)
1081+
post = re.sub(r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re.escape(name), re.escape(name)), "\g<1>%s\g<3>" % value.replace('\\', r'\\'), post)
10821082

10831083
regex = r"\b(%s)\b([^\w]+)(\w+)" % re.escape(name)
10841084
if not found and re.search(regex, (post or "")):
10851085
found = True
1086-
post = re.sub(regex, "\g<1>\g<2>%s" % value, post)
1086+
post = re.sub(regex, "\g<1>\g<2>%s" % value.replace('\\', r'\\'), post)
10871087

10881088
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re.escape(delimiter), re.escape(name), re.escape(delimiter))
10891089
if not found and re.search(regex, (post or "")):
10901090
found = True
1091-
post = re.sub(regex, "\g<1>%s\g<3>" % value, post)
1091+
post = re.sub(regex, "\g<1>%s\g<3>" % value.replace('\\', r'\\'), post)
10921092

10931093
if re.search(regex, (get or "")):
10941094
found = True
1095-
get = re.sub(regex, "\g<1>%s\g<3>" % value, get)
1095+
get = re.sub(regex, "\g<1>%s\g<3>" % value.replace('\\', r'\\'), get)
10961096

10971097
if re.search(regex, (query or "")):
10981098
found = True
1099-
uri = re.sub(regex.replace(r"\A", r"\?"), "\g<1>%s\g<3>" % value, uri)
1099+
uri = re.sub(regex.replace(r"\A", r"\?"), "\g<1>%s\g<3>" % value.replace('\\', r'\\'), uri)
11001100

11011101
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER), name, re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER))
11021102
if re.search(regex, (cookie or "")):
11031103
found = True
1104-
cookie = re.sub(regex, "\g<1>%s\g<3>" % value, cookie)
1104+
cookie = re.sub(regex, "\g<1>%s\g<3>" % value.replace('\\', r'\\'), cookie)
11051105

11061106
if not found:
11071107
if post is not None:

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ a66093c734c7f94ecdf94d882c2d8b89 lib/controller/controller.py
2727
310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py
2828
ca0a4eba91d73c9d7adedabf528ca4f1 lib/core/agent.py
2929
6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py
30-
0040490cdda0118a065ddc2e5bb8d108 lib/core/common.py
30+
1f88ce54a27cb98c301ea0c3fb83bce0 lib/core/common.py
3131
5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py
3232
a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py
3333
7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py
@@ -46,7 +46,7 @@ fbf750dc617c3549ee423d6c2334ba4d lib/core/option.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
090fae09761979f7e5127173bfb0d359 lib/core/settings.py
49+
d6dc3f75b2f3aff43a7f3382059bea76 lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
85e3a98bc9ba62125baa13e864f37a3f lib/core/target.py
@@ -68,7 +68,7 @@ ad74fc58fc7214802fd27067bce18dd2 lib/core/unescaper.py
6868
403d873f1d2fd0c7f73d83f104e41850 lib/request/basicauthhandler.py
6969
3ba1c71e68953d34fc526a9d79d5a457 lib/request/basic.py
7070
ef48de622b0a6b4a71df64b0d2785ef8 lib/request/comparison.py
71-
44528a7580f8ca598312e8c7b1d47c78 lib/request/connect.py
71+
e7ee2724486004129d4006f235b8556d lib/request/connect.py
7272
fb6b788d0016ab4ec5e5f661f0f702ad lib/request/direct.py
7373
cc1163d38e9b7ee5db2adac6784c02bb lib/request/dns.py
7474
5dcdb37823a0b5eff65cd1018bcf09e4 lib/request/httpshandler.py

0 commit comments

Comments
 (0)