Adding warning for (unsupported) DISTINCT in provided SQL queries

This commit is contained in:
Miroslav Štampar 2026-11-12 20:07:55 +01:00
parent f4a4ae5027
commit f84b7fb70a
2 changed files with 3 additions and 1 deletions

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.86"
VERSION = "1.10.11.87"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View file

@ -677,6 +677,8 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
count = 0
if query and not re.search(r"COUNT.*FROM.*\(.*DISTINCT", query, re.I):
if fromUser and re.search(r"(?i)\bDISTINCT\b", query):
singleTimeWarnMessage("DISTINCT is not supported in provided SQL queries (results can contain duplicates)")
query = query.replace("DISTINCT ", "")
if not conf.forceDns: