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

Skip to content

Commit 3258e29

Browse files
committed
Update for #4344
1 parent e0ea1ab commit 3258e29

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.9.13"
21+
VERSION = "1.4.9.14"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8+
from lib.core.compat import xrange
9+
from lib.core.data import kb
810
from lib.core.enums import PRIORITY
911

1012
__priority__ = PRIORITY.HIGHEST
@@ -14,7 +16,7 @@ def dependencies():
1416

1517
def tamper(payload, **kwargs):
1618
"""
17-
Replaces instances like 'SLEEP(x)' with "get_lock('sqlmap',x)"
19+
Replaces instances like 'SLEEP(5)' with (e.g.) "get_lock('ETgP',5)"
1820
1921
Requirement:
2022
* MySQL
@@ -28,19 +30,11 @@ def tamper(payload, **kwargs):
2830
2931
* Reference: https://zhuanlan.zhihu.com/p/35245598
3032
31-
>>> tamper('SLEEP(2)')
32-
"get_lock('sqlmap',2)"
33+
>>> tamper('SLEEP(5)') == "get_lock('%s',5)" % kb.aliasName
34+
True
3335
"""
3436

35-
if payload and payload.find("SLEEP") > -1:
36-
while payload.find("SLEEP(") > -1:
37-
index = payload.find("SLEEP(")
38-
depth = 1
39-
40-
num = payload[index+6]
41-
42-
newVal = "get_lock('sqlmap',%s)" % (num)
43-
payload = payload[:index] + newVal + payload[index+8:]
44-
37+
if payload:
38+
payload = payload.replace("SLEEP(", "get_lock('%s'," % kb.aliasName)
4539

4640
return payload

0 commit comments

Comments
 (0)