Skip to content

Commit c62b0f7

Browse files
committed
New tamper script
1 parent 699c965 commit c62b0f7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tamper/symboliclogical.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
5+
See the file 'doc/COPYING' for copying permission
6+
"""
7+
8+
import re
9+
10+
from lib.core.enums import PRIORITY
11+
12+
__priority__ = PRIORITY.LOWEST
13+
14+
def dependencies():
15+
pass
16+
17+
def tamper(payload, **kwargs):
18+
"""
19+
Replaces AND and OR logical operators with their symbolic counterparts (&& and ||)
20+
21+
>>> tamper("1 AND '1'='1")
22+
'1 && '1'='1'
23+
"""
24+
25+
retVal = payload
26+
27+
if payload:
28+
retVal = re.sub(r"(?i)\bAND\b", "&&", re.sub(r"(?i)\bOR\b", "||", payload))
29+
30+
return retVal

0 commit comments

Comments
 (0)