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

20 lines
531 B
Python

import re
import string
from lib.core.common import randomRange
from lib.core.exception import sqlmapUnsupportedFeatureException
"""
value -> chars from value with random case (e.g., INSERT->InsERt)
"""
def tamper(place, value):
retVal = value
if value:
retVal = ""
for i in xrange(len(value)):
if value[i].isalpha():
retVal += value[i].upper() if randomRange(0,1) else value[i].lower()
else:
retVal += value[i]
return retVal