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

Skip to content

Commit 6fd3c27

Browse files
committed
Update for an Issue #672
1 parent e0fb21c commit 6fd3c27

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

doc/THANKS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ Dirk Jagdmann, <[email protected]>
238238
Luke Jahnke, <[email protected]>
239239
* for reporting a bug when running against MySQL < 5.0
240240

241+
Andrew Kitis <[email protected]>
242+
* for contributing a tamper script lowercase.py
243+
241244
David Klein, <[email protected]>
242245
* for reporting a minor code improvement
243246

tamper/lowercase.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
5+
See the file 'doc/COPYING' for copying permission
6+
"""
7+
8+
import re
9+
10+
from lib.core.data import kb
11+
from lib.core.enums import PRIORITY
12+
13+
__priority__ = PRIORITY.NORMAL
14+
15+
def dependencies():
16+
pass
17+
18+
def tamper(payload, **kwargs):
19+
"""
20+
Replaces each keyword character with lower case value
21+
22+
Tested against:
23+
* Microsoft SQL Server 2005
24+
* MySQL 4, 5.0 and 5.5
25+
* Oracle 10g
26+
* PostgreSQL 8.3, 8.4, 9.0
27+
28+
Notes:
29+
* Useful to bypass very weak and bespoke web application firewalls
30+
that has poorly written permissive regular expressions
31+
* This tamper script should work against all (?) databases
32+
33+
>>> tamper('INSERT')
34+
'insert'
35+
"""
36+
37+
retVal = payload
38+
39+
if payload:
40+
for match in re.finditer(r"[A-Za-z_]+", retVal):
41+
word = match.group()
42+
43+
if word.upper() in kb.keywords:
44+
retVal = retVal.replace(word, word.lower())
45+
46+
return retVal

0 commit comments

Comments
 (0)