Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/tamper/escapequotes.py
2983 views
1
#!/usr/bin/env python
2
3
"""
4
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
5
See the file 'LICENSE' for copying permission
6
"""
7
8
from lib.core.enums import PRIORITY
9
10
__priority__ = PRIORITY.NORMAL
11
12
def dependencies():
13
pass
14
15
def tamper(payload, **kwargs):
16
"""
17
Slash escape single and double quotes (e.g. ' -> \')
18
19
>>> tamper('1" AND SLEEP(5)#')
20
'1\\\\" AND SLEEP(5)#'
21
"""
22
23
return payload.replace("'", "\\'").replace('"', '\\"')
24
25