minor refactoring

This commit is contained in:
Miroslav Stampar 2012-04-15 17:17:30 +00:00
parent 965c1511a6
commit ccd6fb70a8
6 changed files with 7 additions and 32 deletions

View File

@ -29,9 +29,4 @@ def tamper(payload):
* http://lukasz.pilorz.net/testy/full_width_utf/index.phps
"""
retVal = payload
if payload:
retVal = payload.replace('\'', '%EF%BC%87')
return retVal
return payload.replace('\'', '%EF%BC%87') if payload else payload

View File

@ -23,9 +23,4 @@ def tamper(payload):
* Output: AND %00%271%00%27=%00%271%00%27
"""
retVal = payload
if payload:
retVal = payload.replace('\'', '%00%27')
return retVal
return payload.replace('\'', '%00%27') if payload else payload

View File

@ -33,9 +33,4 @@ def tamper(payload):
Reference: http://projects.webappsec.org/w/page/13246949/Null-Byte-Injection
"""
retVal = payload
if payload:
retVal = "%s%%00" % payload
return retVal
return "%s%%00" % payload if payload else payload

View File

@ -25,9 +25,4 @@ def tamper(payload):
* Output: MScgQU5EIFNMRUVQKDUpIw==
"""
retVal = payload
if payload:
retVal = base64.b64encode(payload)
return retVal
return base64.b64encode(payload) if payload else payload

View File

@ -29,9 +29,4 @@ def tamper(payload):
* Reference: http://seclists.org/fulldisclosure/2011/May/163
"""
retVal = payload
if payload:
retVal += " and '0having'='0having'"
return retVal
return payload + " and '0having'='0having'" if payload else payload

View File

@ -40,7 +40,7 @@ def tamper(payload):
# LF 0A new line
# FF 0C new page
# CR 0D carriage return
blanks = ['%09', '%0A', '%0C', '%0D']
blanks = ("%09", "%0A", "%0C", "%0D")
retVal = payload
if payload:
@ -60,7 +60,7 @@ def tamper(payload):
elif payload[i] == '"':
doublequote = not doublequote
elif payload[i] == " " and not doublequote and not quote:
elif payload[i] == ' ' and not doublequote and not quote:
retVal += random.choice(blanks)
continue