implemented --randomize switch by request

This commit is contained in:
Miroslav Stampar
2011-08-29 12:50:52 +00:00
parent d283e3eb3c
commit ac00014c4a
7 changed files with 55 additions and 2 deletions

View File

@@ -2924,3 +2924,17 @@ def filterPairValues(values):
retVal = filter(lambda x: isinstance(x, (tuple, list, set)) and len(x) == 2, values)
return retVal
def randomizeParameterValue(value):
retVal = value
for match in re.finditer('[A-Z]+', value):
retVal = retVal.replace(match.group(), randomStr(len(match.group())).upper())
for match in re.finditer('[a-z]+', value):
retVal = retVal.replace(match.group(), randomStr(len(match.group())).lower())
for match in re.finditer('[0-9]+', value):
retVal = retVal.replace(match.group(), str(randomInt(len(match.group()))))
return retVal

View File

@@ -30,6 +30,7 @@ optDict = {
"dropSetCookie": "boolean",
"agent": "string",
"randomAgent": "boolean",
"rParam": "string",
"referer": "string",
"headers": "string",
"aType": "string",