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

Skip to content

Commit 2496db9

Browse files
committed
Update for #2690
1 parent a324901 commit 2496db9

3 files changed

Lines changed: 48 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.enums import OS
2020

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

tamper/least.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2017 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.HIGHEST
13+
14+
def dependencies():
15+
pass
16+
17+
def tamper(payload, **kwargs):
18+
"""
19+
Replaces greater than operator ('>') with 'LEAST' counterpart
20+
21+
Tested against:
22+
* MySQL 4, 5.0 and 5.5
23+
* Oracle 10g
24+
* PostgreSQL 8.3, 8.4, 9.0
25+
26+
Notes:
27+
* Useful to bypass weak and bespoke web application firewalls that
28+
filter the greater than character
29+
* The LEAST clause is a widespread SQL command. Hence, this
30+
tamper script should work against majority of databases
31+
32+
>>> tamper('1 AND A > B')
33+
'1 AND LEAST(A,B+1)=B+1'
34+
"""
35+
36+
retVal = payload
37+
38+
if payload:
39+
match = re.search(r"(?i)(\b(AND|OR)\b\s+)([^>]+?)\s*>\s*(\w+|'[^']+')", payload)
40+
41+
if match:
42+
_ = "%sLEAST(%s,%s+1)=%s+1" % (match.group(1), match.group(3), match.group(4), match.group(4))
43+
retVal = retVal.replace(match.group(0), _)
44+
45+
return retVal

txt/checksum.md5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ c5f09788ee8ff9c9d12a052986875bc6 lib/core/option.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
0462adcff8d2d98318bbcaf29e9c9ca9 lib/core/settings.py
49+
9abee47afec6feac53642cc460bee926 lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
1576b63db3261e2afd5459189abf967b lib/core/target.py
@@ -246,6 +246,7 @@ a3a0e76922b4f40f422a0daca4e71af3 tamper/htmlencode.py
246246
6fa2d48bf8a1020a07d1cb95a14688a8 tamper/ifnull2ifisnull.py
247247
8f1626a68b060162023e67b4a4cd9295 tamper/informationschemacomment.py
248248
310efc965c862cfbd7b0da5150a5ad36 tamper/__init__.py
249+
bff6c89873a75248f6bd68b62a6d86cf tamper/least.py
249250
8b9ed7d7d9c8197f34b9d8e36323b60e tamper/lowercase.py
250251
377bffa19f0b7ca0616fcea2681db827 tamper/modsecurityversioned.py
251252
14a2c4ea49661056a7a6077f91fbc2ed tamper/modsecurityzeroversioned.py

0 commit comments

Comments
 (0)