diff --git a/tamper/apostrophemask.py b/tamper/apostrophemask.py index 13c644b5b..6e366b2e1 100644 --- a/tamper/apostrophemask.py +++ b/tamper/apostrophemask.py @@ -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 diff --git a/tamper/apostrophenullencode.py b/tamper/apostrophenullencode.py index 4029f2ee1..5606bfd57 100644 --- a/tamper/apostrophenullencode.py +++ b/tamper/apostrophenullencode.py @@ -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 diff --git a/tamper/appendnullbyte.py b/tamper/appendnullbyte.py index 2fec7e1c4..b0293d94c 100644 --- a/tamper/appendnullbyte.py +++ b/tamper/appendnullbyte.py @@ -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 diff --git a/tamper/base64encode.py b/tamper/base64encode.py index 7f08faf76..73045a03c 100644 --- a/tamper/base64encode.py +++ b/tamper/base64encode.py @@ -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 diff --git a/tamper/securesphere.py b/tamper/securesphere.py index fd59fdddb..88ebb6cd2 100644 --- a/tamper/securesphere.py +++ b/tamper/securesphere.py @@ -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 diff --git a/tamper/space2randomblank.py b/tamper/space2randomblank.py index edeb28f85..5ea7ae35c 100644 --- a/tamper/space2randomblank.py +++ b/tamper/space2randomblank.py @@ -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