Minor correction of quote mechanism in tamper scripts

This commit is contained in:
Miroslav Štampar 2026-06-04 19:54:53 +02:00
parent 06b74f9390
commit f564db0d56
8 changed files with 20 additions and 20 deletions

View file

@ -43,10 +43,10 @@ def tamper(payload, **kwargs):
retVal += "/**/"
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == " " and not doublequote and not quote:

View file

@ -40,10 +40,10 @@ def tamper(payload, **kwargs):
retVal += "/**_**/"
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == " " and not doublequote and not quote:

View file

@ -67,10 +67,10 @@ def tamper(payload, **kwargs):
retVal += random.choice(blanks)
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == '#' or payload[i:i + 3] == '-- ':

View file

@ -57,10 +57,10 @@ def tamper(payload, **kwargs):
retVal += random.choice(blanks)
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == " " and not doublequote and not quote:

View file

@ -38,10 +38,10 @@ def tamper(payload, **kwargs):
retVal += "+"
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == " " and not doublequote and not quote:

View file

@ -52,10 +52,10 @@ def tamper(payload, **kwargs):
retVal += random.choice(blanks)
continue
elif payload[i] == '\'':
elif payload[i] == '\'' and (i == 0 or payload[i - 1] != '\\'):
quote = not quote
elif payload[i] == '"':
elif payload[i] == '"' and (i == 0 or payload[i - 1] != '\\'):
doublequote = not doublequote
elif payload[i] == ' ' and not doublequote and not quote: