Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 158ae50

Browse files
committed
Bug fix for tamper script equaltolike (has been doing problems when used with MsSQL)
1 parent 058f63a commit 158ae50

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

tamper/equaltolike.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,10 @@ def tamper(payload, **kwargs):
3535
'SELECT * FROM users WHERE id LIKE 1'
3636
"""
3737

38-
def process(match):
39-
word = match.group()
40-
word = "%sLIKE%s" % (" " if word[0] != " " else "", " " if word[-1] != " " else "")
41-
42-
return word
43-
4438
retVal = payload
4539

4640
if payload:
47-
retVal = re.sub(r"\s*=\s*", lambda match: process(match), retVal)
41+
for regex, subst in ((r"\s+=\s+", " LIKE "), (r"\s+=", " LIKE"), (r"=\s+", "LIKE ")):
42+
retVal = re.sub(regex, subst, retVal)
4843

4944
return retVal

0 commit comments

Comments
 (0)