mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-29 10:59:03 +00:00
Minor code style updates
This commit is contained in:
@@ -7,7 +7,6 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import re
|
||||
|
||||
from lib.core.data import kb
|
||||
from lib.core.enums import PRIORITY
|
||||
|
||||
__priority__ = PRIORITY.NORMAL
|
||||
|
||||
@@ -46,7 +46,7 @@ def tamper(payload, **kwargs):
|
||||
_ = "%s %s NOT BETWEEN 0 AND %s" % (match.group(2), match.group(4), match.group(5))
|
||||
retVal = retVal.replace(match.group(0), _)
|
||||
else:
|
||||
retVal = re.sub(r"\s*>\s*(\d+|'[^']+'|\w+\(\d+\))", " NOT BETWEEN 0 AND \g<1>", payload)
|
||||
retVal = re.sub(r"\s*>\s*(\d+|'[^']+'|\w+\(\d+\))", r" NOT BETWEEN 0 AND \g<1>", payload)
|
||||
|
||||
if retVal == payload:
|
||||
match = re.search(r"(?i)(\b(AND|OR)\b\s+)(?!.*\b(AND|OR)\b)([^=]+?)\s*=\s*(\w+)\s*", payload)
|
||||
|
||||
@@ -35,6 +35,6 @@ def tamper(payload, **kwargs):
|
||||
retVal = payload
|
||||
|
||||
if payload:
|
||||
retVal = re.sub(r"\b(\w+)\(", "\g<1>/**/(", retVal)
|
||||
retVal = re.sub(r"\b(\w+)\(", r"\g<1>/**/(", retVal)
|
||||
|
||||
return retVal
|
||||
|
||||
@@ -22,6 +22,6 @@ def tamper(payload, **kwargs):
|
||||
retVal = payload
|
||||
|
||||
if payload:
|
||||
retVal = re.sub(r"(?i)(information_schema)\.", "\g<1>/**/.", payload)
|
||||
retVal = re.sub(r"(?i)(information_schema)\.", r"\g<1>/**/.", payload)
|
||||
|
||||
return retVal
|
||||
|
||||
@@ -43,7 +43,7 @@ def tamper(payload, **kwargs):
|
||||
words.add(word)
|
||||
|
||||
for word in words:
|
||||
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(r"(?<=\W)%s(?=[^A-Za-z_(]|\Z)" % word, "%s%s%s" % (' ' * random.randrange(1, 4), word, ' ' * random.randrange(1, 4)), retVal)
|
||||
retVal = re.sub(r"(?<=\W)%s(?=[(])" % word, "%s%s" % (' ' * random.randrange(1, 4), word), retVal)
|
||||
|
||||
return retVal
|
||||
|
||||
Reference in New Issue
Block a user