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

Skip to content

Commit b3b5bd2

Browse files
committed
Adding new tamper script (on request from @MilanGabor)
1 parent edcfffc commit b3b5bd2

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.9.13"
22+
VERSION = "1.0.9.14"
2323
REVISION = getRevisionNumber()
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}

tamper/htmlencode.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2016 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.LOW
13+
14+
def dependencies():
15+
pass
16+
17+
def tamper(payload, **kwargs):
18+
"""
19+
HTML encode (using code points) all non-alphanumeric characters
20+
21+
>>> tamper("1' AND SLEEP(5)#")
22+
'1&#39;&#32;AND&#32;SLEEP&#40;5&#41;&#35;'
23+
"""
24+
25+
return re.sub(r"[^\w]", lambda match: "&#%d;" % ord(match.group(0)), payload) if payload else payload

txt/checksum.md5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
7bf39beeda908ad06081385433db8567 lib/core/settings.py
48+
32b9841850e40a039b5ae467197ce9e1 lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
0bc2fae1dec18cdd11954b22358293f2 lib/core/target.py
@@ -235,6 +235,7 @@ e2aca0ea57afc24dd154472034dc9c8c tamper/commalessmid.py
235235
11bb0652668bb6624494567fd92933b3 tamper/escapequotes.py
236236
731c25dd33fca28514930d4409daaaa3 tamper/greatest.py
237237
1becabc90d81c70fd24b54cae03a3702 tamper/halfversionedmorekeywords.py
238+
61add9dce3c0c9035901db87fa969c89 tamper/htmlencode.py
238239
17313c5a68aa44325616e0e38869b98e tamper/ifnull2ifisnull.py
239240
dd71bbc7f76ef55a2c9c16645347ead8 tamper/informationschemacomment.py
240241
cc9c82cfffd8ee9b25ba3af6284f057e tamper/__init__.py

0 commit comments

Comments
 (0)