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

Skip to content

Commit 074fbbc

Browse files
committed
Implementation for an Issue #1776
1 parent 5b0d597 commit 074fbbc

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

lib/core/settings.py

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

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.0.3.7"
23+
VERSION = "1.0.3.8"
2424
REVISION = getRevisionNumber()
2525
STABLE = VERSION.count('.') <= 2
2626
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

tamper/commalesslimit.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 os
9+
import re
10+
11+
from lib.core.common import singleTimeWarnMessage
12+
from lib.core.enums import PRIORITY
13+
14+
__priority__ = PRIORITY.HIGH
15+
16+
def dependencies():
17+
pass
18+
19+
def tamper(payload, **kwargs):
20+
"""
21+
Replaces instances like 'LIMIT M, N' with 'LIMIT N OFFSET M'
22+
23+
Requirement:
24+
* MySQL
25+
26+
Tested against:
27+
* MySQL 5.0 and 5.5
28+
29+
>>> tamper('LIMIT 2, 3')
30+
'LIMIT 3 OFFSET 2'
31+
"""
32+
33+
retVal = payload
34+
35+
match = re.search(r"(?i)LIMIT\s*(\d+),\s*(\d+)", payload or "")
36+
if match:
37+
retVal = retVal.replace(match.group(0), "LIMIT %s OFFSET %s" % (match.group(2), match.group(1)))
38+
39+
return retVal

0 commit comments

Comments
 (0)