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

Skip to content

Commit 9acf122

Browse files
committed
Patch for an Issue #2396
1 parent 2ed144e commit 9acf122

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

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.2.8"
22+
VERSION = "1.1.2.9"
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)

tamper/plus2concat.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
See the file 'doc/COPYING' for copying permission
66
"""
77

8+
import re
9+
810
from lib.core.common import zeroDepthSearch
911
from lib.core.enums import PRIORITY
1012

@@ -35,6 +37,7 @@ def tamper(payload, **kwargs):
3537
if payload:
3638
while True:
3739
indexes = zeroDepthSearch(retVal, '+')
40+
3841
if indexes:
3942
first, last = 0, 0
4043
for i in xrange(1, len(indexes)):
@@ -52,6 +55,19 @@ def tamper(payload, **kwargs):
5255

5356
retVal = "%sCONCAT(%s)%s" % (retVal[:start], ''.join(chars)[start:end], retVal[end:])
5457
else:
55-
break
58+
match = re.search(r"\((CHAR\(\d+.+CHAR\(\d+\))\)", retVal)
59+
if match:
60+
part = match.group(0)
61+
indexes = set(zeroDepthSearch(match.group(1), '+'))
62+
if not indexes:
63+
break
64+
chars = [char for char in part]
65+
for i in xrange(1, len(chars)):
66+
if i - 1 in indexes:
67+
chars[i] = ','
68+
replacement = "CONCAT%s" % "".join(chars)
69+
retVal = retVal.replace(part, replacement)
70+
else:
71+
break
5672

5773
return retVal

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ e544108e2238d756c94a240e8a1ce061 lib/core/optiondict.py
4545
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4646
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4747
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
48-
bf27a71ebdeee395ebaabde9ed6974fe lib/core/settings.py
48+
f108158ecd5c238a5f94f6f80d5f4c1a lib/core/settings.py
4949
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5050
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5151
afd0636d2e93c23f4f0a5c9b6023ea17 lib/core/target.py
@@ -252,7 +252,7 @@ a3a0e76922b4f40f422a0daca4e71af3 tamper/htmlencode.py
252252
54e1793f30c755202ee1acaacfac45fb tamper/nonrecursivereplacement.py
253253
00ba60e5869055aaa7ba0cd23b5ed1f4 tamper/overlongutf8.py
254254
3cadacb0f39de03e0f8612c656104e03 tamper/percentage.py
255-
7805efc7af932c2ab452f41967f9eb7b tamper/plus2concat.py
255+
dfaa889d125c34c7b2b468012d2b5279 tamper/plus2concat.py
256256
24753ed4e8ceab6f1a1fc13ee621943b tamper/randomcase.py
257257
4d5fdfe77668fa44967e1d44f8a50ce7 tamper/randomcomments.py
258258
22561b429f41fc0bdd23e36b9a8de9e5 tamper/securesphere.py

0 commit comments

Comments
 (0)