File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818from 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 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
Original file line number Diff line number Diff line change 55See the file 'LICENSE' for copying permission
66"""
77
8+ from lib .core .compat import xrange
9+ from lib .core .data import kb
810from lib .core .enums import PRIORITY
911
1012__priority__ = PRIORITY .HIGHEST
@@ -14,7 +16,7 @@ def dependencies():
1416
1517def 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
You can’t perform that action at this time.
0 commit comments