mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-15 10:33:08 +03:00
Tamper function(s) refactoring (really no need for returning headers as they are passed by reference)
This commit is contained in:
parent
54fbb22ab8
commit
12fc9442b9
|
@ -48,7 +48,7 @@ class Agent:
|
||||||
|
|
||||||
if kb.tamperFunctions:
|
if kb.tamperFunctions:
|
||||||
for function in kb.tamperFunctions:
|
for function in kb.tamperFunctions:
|
||||||
query, _ = function(payload=query, headers=None)
|
query = function(payload=query)
|
||||||
|
|
||||||
return query
|
return query
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ class Connect:
|
||||||
if payload:
|
if payload:
|
||||||
if kb.tamperFunctions:
|
if kb.tamperFunctions:
|
||||||
for function in kb.tamperFunctions:
|
for function in kb.tamperFunctions:
|
||||||
payload, auxHeaders = function(payload=payload, headers=auxHeaders)
|
payload = function(payload=payload, headers=auxHeaders)
|
||||||
|
|
||||||
value = agent.replacePayload(value, payload)
|
value = agent.replacePayload(value, payload)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces apostrophe character with its UTF-8 full width counterpart
|
Replaces apostrophe character with its UTF-8 full width counterpart
|
||||||
|
|
||||||
|
@ -27,4 +27,4 @@ def tamper(payload, headers):
|
||||||
* http://lukasz.pilorz.net/testy/full_width_utf/index.phps
|
* http://lukasz.pilorz.net/testy/full_width_utf/index.phps
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return payload.replace('\'', "%EF%BC%87") if payload else payload, headers
|
return payload.replace('\'', "%EF%BC%87") if payload else payload
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces apostrophe character with its illegal double unicode counterpart
|
Replaces apostrophe character with its illegal double unicode counterpart
|
||||||
|
|
||||||
|
@ -21,4 +21,4 @@ def tamper(payload, headers):
|
||||||
* Output: AND %00%271%00%27=%00%271%00%27
|
* Output: AND %00%271%00%27=%00%271%00%27
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return payload.replace('\'', "%00%27") if payload else payload, headers
|
return payload.replace('\'', "%00%27") if payload else payload
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Appends encoded NULL byte character at the end of payload
|
Appends encoded NULL byte character at the end of payload
|
||||||
|
|
||||||
|
@ -31,4 +31,4 @@ def tamper(payload, headers):
|
||||||
Reference: http://projects.webappsec.org/w/page/13246949/Null-Byte-Injection
|
Reference: http://projects.webappsec.org/w/page/13246949/Null-Byte-Injection
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return "%s%%00" % payload if payload else payload, headers
|
return "%s%%00" % payload if payload else payload
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Base64 all characters in a given payload
|
Base64 all characters in a given payload
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ def tamper(payload, headers):
|
||||||
* Output: MScgQU5EIFNMRUVQKDUpIw==
|
* Output: MScgQU5EIFNMRUVQKDUpIw==
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return base64.b64encode(payload) if payload else payload, headers
|
return base64.b64encode(payload) if payload else payload
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.HIGHEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces greater than operator ('>') with 'NOT BETWEEN 0 AND #'
|
Replaces greater than operator ('>') with 'NOT BETWEEN 0 AND #'
|
||||||
|
|
||||||
|
@ -61,4 +61,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Double url-encodes all characters in a given payload (not processing
|
Double url-encodes all characters in a given payload (not processing
|
||||||
already encoded)
|
already encoded)
|
||||||
|
@ -43,4 +43,4 @@ def tamper(payload, headers):
|
||||||
retVal += '%%25%.2X' % ord(payload[i])
|
retVal += '%%25%.2X' % ord(payload[i])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Url-encodes all characters in a given payload (not processing already
|
Url-encodes all characters in a given payload (not processing already
|
||||||
encoded)
|
encoded)
|
||||||
|
@ -50,4 +50,4 @@ def tamper(payload, headers):
|
||||||
retVal += '%%%.2X' % ord(payload[i])
|
retVal += '%%%.2X' % ord(payload[i])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -16,7 +16,7 @@ __priority__ = PRIORITY.LOWEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against ASP or ASP.NET web applications" % os.path.basename(__file__).split(".")[0])
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against ASP or ASP.NET web applications" % os.path.basename(__file__).split(".")[0])
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Unicode-url-encodes non-encoded characters in a given payload (not
|
Unicode-url-encodes non-encoded characters in a given payload (not
|
||||||
processing already encoded)
|
processing already encoded)
|
||||||
|
@ -55,4 +55,4 @@ def tamper(payload, headers):
|
||||||
retVal += '%%u%.4X' % ord(payload[i])
|
retVal += '%%u%.4X' % ord(payload[i])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -17,7 +17,7 @@ __priority__ = PRIORITY.HIGHEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is unlikely to work against %s" % (os.path.basename(__file__).split(".")[0], DBMS.PGSQL))
|
singleTimeWarnMessage("tamper script '%s' is unlikely to work against %s" % (os.path.basename(__file__).split(".")[0], DBMS.PGSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces all occurances of operator equal ('=') with operator 'LIKE'
|
Replaces all occurances of operator equal ('=') with operator 'LIKE'
|
||||||
|
|
||||||
|
@ -47,4 +47,4 @@ def tamper(payload, headers):
|
||||||
if payload:
|
if payload:
|
||||||
retVal = re.sub(r"\s*=\s*", lambda match: process(match), retVal)
|
retVal = re.sub(r"\s*=\s*", lambda match: process(match), retVal)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
"""
|
"""
|
||||||
$Id$
|
|
||||||
|
|
||||||
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
@ -21,7 +19,7 @@ __priority__ = PRIORITY.HIGHER
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s < 5.1" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s < 5.1" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Adds versioned MySQL comment before each keyword
|
Adds versioned MySQL comment before each keyword
|
||||||
|
|
||||||
|
@ -55,4 +53,4 @@ def tamper(payload, headers):
|
||||||
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=\W|\Z)", lambda match: process(match), retVal)
|
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=\W|\Z)", lambda match: process(match), retVal)
|
||||||
retVal = retVal.replace(" /*!0", "/*!0")
|
retVal = retVal.replace(" /*!0", "/*!0")
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.HIGHEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces instances like 'IFNULL(A, B)' with 'IF(ISNULL(A), B, A)'
|
Replaces instances like 'IFNULL(A, B)' with 'IF(ISNULL(A), B, A)'
|
||||||
|
|
||||||
|
@ -61,4 +61,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
return payload, headers
|
return payload
|
||||||
|
|
|
@ -13,7 +13,7 @@ __priority__ = PRIORITY.HIGHER
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Embraces complete query with versioned comment
|
Embraces complete query with versioned comment
|
||||||
|
|
||||||
|
@ -43,4 +43,4 @@ def tamper(payload, headers):
|
||||||
if ' ' in payload:
|
if ' ' in payload:
|
||||||
retVal = "%s /*!30%s%s*/%s" % (payload[:payload.find(' ')], randomInt(3), payload[payload.find(' ') + 1:], postfix)
|
retVal = "%s /*!30%s%s*/%s" % (payload[:payload.find(' ')], randomInt(3), payload[payload.find(' ') + 1:], postfix)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.HIGHER
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Embraces complete query with zero-versioned comment
|
Embraces complete query with zero-versioned comment
|
||||||
|
|
||||||
|
@ -42,4 +42,4 @@ def tamper(payload, headers):
|
||||||
if ' ' in payload:
|
if ' ' in payload:
|
||||||
retVal = "%s /*!00000%s*/%s" % (payload[:payload.find(' ')], payload[payload.find(' ') + 1:], postfix)
|
retVal = "%s /*!00000%s*/%s" % (payload[:payload.find(' ')], payload[payload.find(' ') + 1:], postfix)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -16,7 +16,7 @@ __priority__ = PRIORITY.NORMAL
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Adds multiple spaces around SQL keywords
|
Adds multiple spaces around SQL keywords
|
||||||
|
|
||||||
|
@ -46,4 +46,4 @@ def tamper(payload, headers):
|
||||||
retVal = re.sub("(?<=\W)%s(?=[^A-Za-z_(]|\Z)" % word, "%s%s%s" % (' '*random.randrange(1,4), word, ' '*random.randrange(1,4)), retVal)
|
retVal = re.sub("(?<=\W)%s(?=[^A-Za-z_(]|\Z)" % word, "%s%s%s" % (' '*random.randrange(1,4), word, ' '*random.randrange(1,4)), retVal)
|
||||||
retVal = re.sub("(?<=\W)%s(?=[(])" % word, "%s%s" % (' '*random.randrange(1,4), word), retVal)
|
retVal = re.sub("(?<=\W)%s(?=[(])" % word, "%s%s" % (' '*random.randrange(1,4), word), retVal)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -13,7 +13,7 @@ from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
__priority__ = PRIORITY.NORMAL
|
__priority__ = PRIORITY.NORMAL
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces predefined SQL keywords with representations
|
Replaces predefined SQL keywords with representations
|
||||||
suitable for replacement (e.g. .replace("SELECT", "")) filters
|
suitable for replacement (e.g. .replace("SELECT", "")) filters
|
||||||
|
@ -38,4 +38,4 @@ def tamper(payload, headers):
|
||||||
_ = random.randint(1, len(keyword) - 1)
|
_ = random.randint(1, len(keyword) - 1)
|
||||||
retVal = re.sub(r"(?i)\b%s\b" % keyword, "%s%s%s" % (keyword[:_], keyword, keyword[_:]), retVal)
|
retVal = re.sub(r"(?i)\b%s\b" % keyword, "%s%s%s" % (keyword[:_], keyword, keyword[_:]), retVal)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -16,7 +16,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against ASP web applications" % os.path.basename(__file__).split(".")[0])
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against ASP web applications" % os.path.basename(__file__).split(".")[0])
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Adds a percentage sign ('%') infront of each character
|
Adds a percentage sign ('%') infront of each character
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ def tamper(payload, headers):
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -16,7 +16,7 @@ __priority__ = PRIORITY.NORMAL
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces each keyword character with random case value
|
Replaces each keyword character with random case value
|
||||||
|
|
||||||
|
@ -50,4 +50,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal = retVal.replace(word, _)
|
retVal = retVal.replace(word, _)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -13,7 +13,7 @@ from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
__priority__ = PRIORITY.LOW
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Add random comments to SQL keywords
|
Add random comments to SQL keywords
|
||||||
Example: 'INSERT' becomes 'IN/**/S/**/ERT'
|
Example: 'INSERT' becomes 'IN/**/S/**/ERT'
|
||||||
|
@ -37,4 +37,4 @@ def tamper(payload, headers):
|
||||||
_ += word[-1]
|
_ += word[-1]
|
||||||
retVal = retVal.replace(word, _)
|
retVal = retVal.replace(word, _)
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.NORMAL
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Appends special crafted string
|
Appends special crafted string
|
||||||
|
|
||||||
|
@ -27,4 +27,4 @@ def tamper(payload, headers):
|
||||||
* Reference: http://seclists.org/fulldisclosure/2011/May/163
|
* Reference: http://seclists.org/fulldisclosure/2011/May/163
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return payload + " and '0having'='0having'" if payload else payload, headers
|
return payload + " and '0having'='0having'" if payload else payload
|
||||||
|
|
|
@ -9,7 +9,7 @@ from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
__priority__ = PRIORITY.HIGH
|
__priority__ = PRIORITY.HIGH
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Appends 'sp_password' to the end of the payload for automatic obfuscation from DBMS logs
|
Appends 'sp_password' to the end of the payload for automatic obfuscation from DBMS logs
|
||||||
|
|
||||||
|
@ -30,4 +30,4 @@ def tamper(payload, headers):
|
||||||
if payload:
|
if payload:
|
||||||
retVal = "%s%ssp_password" % (payload, "-- " if not any(_ if _ in payload else None for _ in ('#', "-- ")) else "")
|
retVal = "%s%ssp_password" % (payload, "-- " if not any(_ if _ in payload else None for _ in ('#', "-- ")) else "")
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with comments '/**/'
|
Replaces space character (' ') with comments '/**/'
|
||||||
|
|
||||||
|
@ -55,4 +55,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -12,7 +12,7 @@ from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
__priority__ = PRIORITY.LOW
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a dash comment ('--') followed by
|
Replaces space character (' ') with a dash comment ('--') followed by
|
||||||
a random string and a new line ('\n')
|
a random string and a new line ('\n')
|
||||||
|
@ -46,4 +46,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -18,7 +18,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a pound character ('#') followed by
|
Replaces space character (' ') with a pound character ('#') followed by
|
||||||
a random string and a new line ('\n')
|
a random string and a new line ('\n')
|
||||||
|
@ -52,4 +52,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -21,7 +21,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s > 5.1.13" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s > 5.1.13" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a pound character ('#') followed by
|
Replaces space character (' ') with a pound character ('#') followed by
|
||||||
a random string and a new line ('\n')
|
a random string and a new line ('\n')
|
||||||
|
@ -66,4 +66,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -17,7 +17,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MSSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MSSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a random blank character from a
|
Replaces space character (' ') with a random blank character from a
|
||||||
valid set of alternate characters
|
valid set of alternate characters
|
||||||
|
@ -86,4 +86,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -9,7 +9,7 @@ from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
__priority__ = PRIORITY.LOW
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a pound character ('#') followed by
|
Replaces space character (' ') with a pound character ('#') followed by
|
||||||
a new line ('\n')
|
a new line ('\n')
|
||||||
|
@ -38,4 +38,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -17,7 +17,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a random blank character from a
|
Replaces space character (' ') with a random blank character from a
|
||||||
valid set of alternate characters
|
valid set of alternate characters
|
||||||
|
@ -69,4 +69,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -16,7 +16,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a dash comment ('--') followed by
|
Replaces space character (' ') with a dash comment ('--') followed by
|
||||||
a new line ('\n')
|
a new line ('\n')
|
||||||
|
@ -47,4 +47,4 @@ def tamper(payload, headers):
|
||||||
else:
|
else:
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -12,7 +12,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with plus ('+')
|
Replaces space character (' ') with plus ('+')
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.LOW
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces space character (' ') with a random blank character from a
|
Replaces space character (' ') with a random blank character from a
|
||||||
valid set of alternate characters
|
valid set of alternate characters
|
||||||
|
@ -64,4 +64,4 @@ def tamper(payload, headers):
|
||||||
|
|
||||||
retVal += payload[i]
|
retVal += payload[i]
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.HIGHEST
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces UNION ALL SELECT with UNION SELECT
|
Replaces UNION ALL SELECT with UNION SELECT
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ def tamper(payload, headers):
|
||||||
* Output: -1 UNION SELECT
|
* Output: -1 UNION SELECT
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return payload.replace("UNION ALL SELECT", "UNION SELECT") if payload else payload, headers
|
return payload.replace("UNION ALL SELECT", "UNION SELECT") if payload else payload
|
||||||
|
|
|
@ -14,7 +14,7 @@ __priority__ = PRIORITY.NORMAL
|
||||||
def dependencies():
|
def dependencies():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Replaces quote character (') with a multi-byte combo %bf%27 together with
|
Replaces quote character (') with a multi-byte combo %bf%27 together with
|
||||||
generic comment at the end (to make it work)
|
generic comment at the end (to make it work)
|
||||||
|
@ -48,4 +48,4 @@ def tamper(payload, headers):
|
||||||
retVal = re.sub("\s*(AND|OR)[\s(]+'[^']+'\s*(=|LIKE)\s*'.*", "", retVal)
|
retVal = re.sub("\s*(AND|OR)[\s(]+'[^']+'\s*(=|LIKE)\s*'.*", "", retVal)
|
||||||
retVal += "-- "
|
retVal += "-- "
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -18,7 +18,7 @@ __priority__ = PRIORITY.HIGHER
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Encloses each non-function keyword with versioned MySQL comment
|
Encloses each non-function keyword with versioned MySQL comment
|
||||||
|
|
||||||
|
@ -50,4 +50,4 @@ def tamper(payload, headers):
|
||||||
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=[^\w(]|\Z)", lambda match: process(match), retVal)
|
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=[^\w(]|\Z)", lambda match: process(match), retVal)
|
||||||
retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/")
|
retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/")
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
|
@ -19,7 +19,7 @@ __priority__ = PRIORITY.HIGHER
|
||||||
def dependencies():
|
def dependencies():
|
||||||
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s >= 5.1.13" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s >= 5.1.13" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
def tamper(payload, headers):
|
def tamper(payload, headers=None):
|
||||||
"""
|
"""
|
||||||
Encloses each keyword with versioned MySQL comment
|
Encloses each keyword with versioned MySQL comment
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ def tamper(payload, headers):
|
||||||
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=\W|\Z)", lambda match: process(match), retVal)
|
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=\W|\Z)", lambda match: process(match), retVal)
|
||||||
retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/")
|
retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/")
|
||||||
|
|
||||||
return retVal, headers
|
return retVal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user