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

Skip to content

Commit f433895

Browse files
committed
Minor update of #3527
1 parent a3fe4be commit f433895

3 files changed

Lines changed: 10 additions & 9 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.3.3.14"
22+
VERSION = "1.3.3.15"
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/substring2leftright.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ def tamper(payload, **kwargs):
2424
Note:
2525
* Useful to bypass weak web application firewalls that filter SUBSTRING (but not LEFT and RIGHT)
2626
27-
>>> tamper('SUBSTRING((X FROM 1 FOR 1))')
28-
'LEFT(X,1)'
29-
>>> tamper('SUBSTRING((X FROM 5 FOR 1))')
30-
'LEFT(RIGHT(X,-4),1)'
27+
>>> tamper('SUBSTRING((SELECT usename FROM pg_user)::text FROM 1 FOR 1)')
28+
'LEFT((SELECT usename FROM pg_user)::text,1)'
29+
>>> tamper('SUBSTRING((SELECT usename FROM pg_user)::text FROM 3 FOR 1)')
30+
'LEFT(RIGHT((SELECT usename FROM pg_user)::text,-2),1)'
3131
"""
3232

3333
retVal = payload
3434

3535
if payload:
36-
match = re.search(r"SUBSTRING\(\((.*)\sFROM\s(\d+)\sFOR\s1\)\)", payload)
36+
match = re.search(r"SUBSTRING\((.+?)\s+FROM[^)]+(\d+)[^)]+FOR[^)]+1\)", payload)
3737

3838
if match:
3939
pos = int(match.group(2))
4040
if pos == 1:
41-
_ = "LEFT((%s,1))" % (match.group(1))
41+
_ = "LEFT(%s,1)" % (match.group(1))
4242
else:
43-
_ = "LEFT(RIGHT((%s,%d),1))" % (match.group(1), 1-pos)
43+
_ = "LEFT(RIGHT(%s,%d),1)" % (match.group(1), 1 - pos)
4444

4545
retVal = retVal.replace(match.group(0), _)
4646

txt/checksum.md5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
e0e8419f3e68202e2cb336544c83c6cc lib/core/settings.py
53+
70d40f6779a871d6cd824aa8827426a8 lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
0a5b0a97a36c19022665f66858fd7450 lib/core/target.py
@@ -286,6 +286,7 @@ a308787c9dad835cb21498defcd218e6 tamper/space2mysqlblank.py
286286
dc99c639a9bdef91a4225d884c29bb40 tamper/space2plus.py
287287
190bc9adca68e4a628298b78e8e455e8 tamper/space2randomblank.py
288288
eec5c82c86f5108f9e08fb4207a8a9b1 tamper/sp_password.py
289+
abfdf3a9f02d0755b3c9db768bd87f9a tamper/substring2leftright.py
289290
64b9486995d38c99786f7ceefa22fbce tamper/symboliclogical.py
290291
08f2ce540ee1f73b6a211bffde18e697 tamper/unionalltounion.py
291292
628f74fc6049dd1450c832cabb28e0da tamper/unmagicquotes.py

0 commit comments

Comments
 (0)