Skip to content

Commit f84b7fb

Browse files
committed
Adding warning for (unsupported) DISTINCT in provided SQL queries
1 parent f4a4ae5 commit f84b7fb

2 files changed

Lines changed: 3 additions & 1 deletion

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 thirdparty import six
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.10.11.86"
22+
VERSION = "1.10.11.87"
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)

‎lib/request/inject.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
677677
count = 0
678678

679679
if query and not re.search(r"COUNT.*FROM.*\(.*DISTINCT", query, re.I):
680+
if fromUser and re.search(r"(?i)\bDISTINCT\b", query):
681+
singleTimeWarnMessage("DISTINCT is not supported in provided SQL queries (results can contain duplicates)")
680682
query = query.replace("DISTINCT ", "")
681683

682684
if not conf.forceDns:

0 commit comments

Comments
 (0)