2022-02-23 14:11:27 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
"""
|
2024-01-04 01:11:52 +03:00
|
|
|
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
|
2022-02-23 14:11:27 +03:00
|
|
|
See the file 'LICENSE' for copying permission
|
|
|
|
"""
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
from lib.core.enums import PRIORITY
|
|
|
|
|
2022-02-23 14:13:30 +03:00
|
|
|
__priority__ = PRIORITY.HIGHEST
|
2022-02-23 14:11:27 +03:00
|
|
|
|
|
|
|
def dependencies():
|
|
|
|
pass
|
|
|
|
|
|
|
|
def tamper(payload, **kwargs):
|
|
|
|
"""
|
|
|
|
Replaces ORD() occurences with equivalent ASCII() calls
|
|
|
|
|
2022-02-23 14:13:30 +03:00
|
|
|
Requirement:
|
|
|
|
* MySQL
|
|
|
|
|
2022-02-23 14:11:27 +03:00
|
|
|
>>> tamper("ORD('42')")
|
|
|
|
"ASCII('42')"
|
|
|
|
"""
|
|
|
|
|
|
|
|
retVal = payload
|
|
|
|
|
|
|
|
if payload:
|
2022-02-23 14:13:30 +03:00
|
|
|
retVal = re.sub(r"(?i)\bORD\(", "ASCII(", payload)
|
2022-02-23 14:11:27 +03:00
|
|
|
|
|
|
|
return retVal
|