Skip to content

Commit 7f62572

Browse files
authored
Add files via upload (#5189)
1 parent e846209 commit 7f62572

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

tamper/decentities.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2022 sqlmap developers (https://sqlmap.org/)
5+
See the file 'LICENSE' for copying permission
6+
"""
7+
8+
from lib.core.enums import PRIORITY
9+
10+
__priority__ = PRIORITY.LOW
11+
12+
def dependencies():
13+
pass
14+
15+
def tamper(payload, **kwargs):
16+
"""
17+
HTML encode in decimal (using code points) all characters (e.g. ' -> ')
18+
19+
>>> tamper("1' AND SLEEP(5)#")
20+
'1' AND SLEEP(5)#'
21+
"""
22+
23+
retVal = payload
24+
25+
if payload:
26+
retVal = ""
27+
i = 0
28+
29+
while i < len(payload):
30+
retVal += "&#%s;" % ord(payload[i])
31+
i += 1
32+
33+
return retVal

tamper/hexentities.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2022 sqlmap developers (https://sqlmap.org/)
5+
See the file 'LICENSE' for copying permission
6+
"""
7+
8+
from lib.core.enums import PRIORITY
9+
10+
__priority__ = PRIORITY.LOW
11+
12+
def dependencies():
13+
pass
14+
15+
def tamper(payload, **kwargs):
16+
"""
17+
HTML encode in hexadecimal (using code points) all characters (e.g. ' -> &#x31;)
18+
19+
>>> tamper("1' AND SLEEP(5)#")
20+
'&#x31;&#x27;&#x20;&#x41;&#x4e;&#x44;&#x20;&#x53;&#x4c;&#x45;&#x45;&#x50;&#x28;&#x35;&#x29;&#x23;'
21+
"""
22+
23+
retVal = payload
24+
25+
if payload:
26+
retVal = ""
27+
i = 0
28+
29+
while i < len(payload):
30+
retVal += "&#x%s;" % format(ord(payload[i]), "x")
31+
i += 1
32+
33+
return retVal

0 commit comments

Comments
 (0)