mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-11 16:43:36 +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
|
retVal = payload
|
||||||
|
|
||||||
if 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()
|
word = match.group()
|
||||||
|
|
||||||
if len(word) < 2:
|
if len(word) < 2:
|
||||||
|
@ -39,6 +39,11 @@ def tamper(payload, **kwargs):
|
||||||
_ += "%s%s" % ("/**/" if randomRange(0, 1) else "", word[i])
|
_ += "%s%s" % ("/**/" if randomRange(0, 1) else "", word[i])
|
||||||
|
|
||||||
_ += word[-1]
|
_ += word[-1]
|
||||||
|
|
||||||
|
if "/**/" not in _:
|
||||||
|
index = randomRange(1, len(word) - 1)
|
||||||
|
_ = word[:index] + "/**/" + word[index:]
|
||||||
|
|
||||||
retVal = retVal.replace(word, _)
|
retVal = retVal.replace(word, _)
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user