Compare commits
7 Commits
b2880b4993
...
06af7068d2
Author | SHA1 | Date |
---|---|---|
|
06af7068d2 | 7 months ago |
|
01d9031e65 | 7 months ago |
|
2f377ec379 | 7 months ago |
|
951c2d6d9c | 7 months ago |
|
ef5f6eee11 | 7 months ago |
|
7486672d56 | 7 months ago |
|
8d2bd8e457 | 7 months ago |
Binary file not shown.
@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
import string
|
||||
# 导入 Python 的 string 模块,它包含了许多用于字符串操作的常量和类
|
||||
|
||||
from lib.core.enums import PRIORITY
|
||||
|
||||
__priority__ = PRIORITY.LOW
|
||||
|
||||
def dependencies():
|
||||
pass
|
||||
|
||||
def tamper(payload, **kwargs):
|
||||
"""
|
||||
Double URL-encodes all characters in a given payload (not processing already encoded) (e.g. SELECT -> %2553%2545%254C%2545%2543%2554)
|
||||
|
||||
Notes:
|
||||
* Useful to bypass some weak web application firewalls that do not double URL-decode the request before processing it through their ruleset
|
||||
|
||||
>>> tamper('SELECT FIELD FROM%20TABLE')
|
||||
'%2553%2545%254C%2545%2543%2554%2520%2546%2549%2545%254C%2544%2520%2546%2552%254F%254D%2520%2554%2541%2542%254C%2545'
|
||||
"""
|
||||
|
||||
retVal = payload
|
||||
|
||||
if payload:
|
||||
retVal = ""
|
||||
i = 0
|
||||
|
||||
while i < len(payload):
|
||||
if payload[i] == '%' and (i < len(payload) - 2) and payload[i + 1:i + 2] in string.hexdigits and payload[i + 2:i + 3] in string.hexdigits:
|
||||
retVal += '%%25%s' % payload[i + 1:i + 3]
|
||||
i += 3
|
||||
else:
|
||||
retVal += '%%25%.2X' % ord(payload[i])
|
||||
i += 1
|
||||
|
||||
return retVal
|
Loading…
Reference in new issue