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

Skip to content

Commit 9f6eacb

Browse files
committed
Fixes #4444
1 parent e6d9dc4 commit 9f6eacb

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/core/common.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,10 +2900,12 @@ def urlencode(value, safe="%&=-_", convall=False, limit=False, spaceplus=False):
29002900
29012901
>>> urlencode('AND 1>(2+3)#')
29022902
'AND%201%3E%282%2B3%29%23'
2903-
>>> urlencode('AND COUNT(SELECT name FROM users WHERE name LIKE \\'%DBA%\\')>0')
2903+
>>> urlencode("AND COUNT(SELECT name FROM users WHERE name LIKE '%DBA%')>0")
29042904
'AND%20COUNT%28SELECT%20name%20FROM%20users%20WHERE%20name%20LIKE%20%27%25DBA%25%27%29%3E0'
2905-
>>> urlencode('AND COUNT(SELECT name FROM users WHERE name LIKE \\'%_SYSTEM%\\')>0')
2905+
>>> urlencode("AND COUNT(SELECT name FROM users WHERE name LIKE '%_SYSTEM%')>0")
29062906
'AND%20COUNT%28SELECT%20name%20FROM%20users%20WHERE%20name%20LIKE%20%27%25_SYSTEM%25%27%29%3E0'
2907+
>>> urlencode("SELECT NAME FROM TABLE WHERE VALUE LIKE '%SOME%BEGIN%'")
2908+
'SELECT%20NAME%20FROM%20TABLE%20WHERE%20VALUE%20LIKE%20%27%25SOME%25BEGIN%25%27'
29072909
"""
29082910

29092911
if conf.get("direct"):
@@ -2928,7 +2930,7 @@ def urlencode(value, safe="%&=-_", convall=False, limit=False, spaceplus=False):
29282930
# encoded (when not representing URL encoded char)
29292931
# except in cases when tampering scripts are used
29302932
if all('%' in _ for _ in (safe, value)) and not kb.tamperFunctions:
2931-
value = re.sub(r"(?<= ')%", "%25", value) # e.g. LIKE '%DBA%'
2933+
value = re.sub(r"(?i)\bLIKE\s+'[^']+'", lambda match: match.group(0).replace('%', "%25"), value)
29322934
value = re.sub(r"%(?![0-9a-fA-F]{2})", "%25", value)
29332935

29342936
while True:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

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

0 commit comments

Comments
 (0)