mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Fix for a tamper script (in some cases comments were not inserted)
This commit is contained in:
parent
eaacbe0b12
commit
02da417b23
|
@ -26,7 +26,7 @@ def tamper(payload, **kwargs):
|
|||
retVal = payload
|
||||
|
||||
if payload:
|
||||
for match in re.finditer(r"[A-Za-z_]+", payload):
|
||||
for match in re.finditer(r"\b[A-Za-z_]+\b", payload):
|
||||
word = match.group()
|
||||
|
||||
if len(word) < 2:
|
||||
|
@ -39,6 +39,11 @@ def tamper(payload, **kwargs):
|
|||
_ += "%s%s" % ("/**/" if randomRange(0, 1) else "", word[i])
|
||||
|
||||
_ += word[-1]
|
||||
|
||||
if "/**/" not in _:
|
||||
index = randomRange(1, len(word) - 1)
|
||||
_ = word[:index] + "/**/" + word[index:]
|
||||
|
||||
retVal = retVal.replace(word, _)
|
||||
|
||||
return retVal
|
||||
|
|
Loading…
Reference in New Issue
Block a user