2020-07-27 14:49:48 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
"""
|
2020-12-31 13:46:27 +03:00
|
|
|
Copyright (c) 2006-2021 sqlmap developers (http://sqlmap.org/)
|
2020-07-27 14:49:48 +03:00
|
|
|
See the file 'LICENSE' for copying permission
|
|
|
|
"""
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
from lib.core.enums import PRIORITY
|
|
|
|
|
|
|
|
__priority__ = PRIORITY.HIGHEST
|
|
|
|
|
|
|
|
def dependencies():
|
|
|
|
pass
|
|
|
|
|
|
|
|
def tamper(payload, **kwargs):
|
|
|
|
"""
|
|
|
|
Replaces instances of <int> UNION with <int>e0UNION
|
|
|
|
|
|
|
|
Requirement:
|
|
|
|
* MySQL
|
|
|
|
* MsSQL
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
* Reference: https://media.blackhat.com/us-13/US-13-Salgado-SQLi-Optimization-and-Obfuscation-Techniques-Slides.pdf
|
|
|
|
|
|
|
|
>>> tamper('1 UNION ALL SELECT')
|
|
|
|
'1e0UNION ALL SELECT'
|
|
|
|
"""
|
|
|
|
|
2020-11-10 01:02:48 +03:00
|
|
|
return re.sub(r"(?i)(\d+)\s+(UNION )", r"\g<1>e0\g<2>", payload) if payload else payload
|