sqlmap/tamper/doubleencode.py
Miroslav Stampar 058e1aecb4 minor update
2010-10-14 06:20:32 +00:00

16 lines
515 B
Python

import re
from lib.core.convert import urlencode
from lib.core.exception import sqlmapUnsupportedFeatureException
"""
Tampering value -> urlencode(value) (e.g., SELECT%20FIELD%20FROM%20TABLE -> SELECT%25%20FIELD%25%20FROM%25%20TABLE)
"""
def tamper(place, value):
if value:
if place != "URI":
value = urlencode(value)
else:
raise sqlmapUnsupportedFeatureException, "can't use tampering module '%s' with 'URI' type injections" % __name__
return value