From 69c679cf06cef0d81a178fe39c3c6b37967f6444 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 4 Jul 2021 23:07:55 +0200 Subject: [PATCH] Fixes #4728 --- lib/core/settings.py | 2 +- plugins/generic/databases.py | 8 ++++---- plugins/generic/users.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 3afebfda3..6b9b9a02b 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from thirdparty import six from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.6.5" +VERSION = "1.5.7.0" 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) diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index 256fd398a..6cd28b48b 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -618,7 +618,7 @@ class Databases(object): query = rootQuery.inband.query % (unsafeSQLIdentificatorNaming(tbl), unsafeSQLIdentificatorNaming(conf.db)) query += condQuery - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = re.sub("column_type", "data_type", query, flags=re.I) elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2, DBMS.DERBY, DBMS.ALTIBASE, DBMS.MIMERSQL): @@ -1022,7 +1022,7 @@ class Databases(object): rootQuery = queries[Backend.getIdentifiedDbms()].statements if any(isTechniqueAvailable(_) for _ in (PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.QUERY)) or conf.direct: - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = rootQuery.inband.query2 else: query = rootQuery.inband.query @@ -1049,7 +1049,7 @@ class Databases(object): query = rootQuery.blind.count - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = re.sub("INFORMATION_SCHEMA", "DATA_DICTIONARY", query, flags=re.I) count = inject.getValue(query, union=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS) @@ -1077,7 +1077,7 @@ class Databases(object): if isNoneValue(value): query = rootQuery.blind.query % index - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = re.sub("INFORMATION_SCHEMA", "DATA_DICTIONARY", query, flags=re.I) value = unArrayizeValue(inject.getValue(query, union=False, error=False)) diff --git a/plugins/generic/users.py b/plugins/generic/users.py index a8fa76ee4..9928b2d14 100644 --- a/plugins/generic/users.py +++ b/plugins/generic/users.py @@ -81,7 +81,7 @@ class Users(object): if Backend.isDbms(DBMS.MYSQL): self.getCurrentUser() - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): kb.data.isDba = "root" in (kb.data.currentUser or "") elif kb.data.currentUser: query = queries[Backend.getIdentifiedDbms()].is_dba.query % kb.data.currentUser.split("@")[0] @@ -106,7 +106,7 @@ class Users(object): condition |= (Backend.isDbms(DBMS.MYSQL) and not kb.data.has_information_schema) if any(isTechniqueAvailable(_) for _ in (PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.QUERY)) or conf.direct: - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = rootQuery.inband.query3 elif condition: query = rootQuery.inband.query2 @@ -126,7 +126,7 @@ class Users(object): infoMsg = "fetching number of database users" logger.info(infoMsg) - if Backend.isFork(FORK.DRIZZLE): + if Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = rootQuery.blind.count3 elif condition: query = rootQuery.blind.count2 @@ -147,7 +147,7 @@ class Users(object): for index in indexRange: if Backend.getIdentifiedDbms() in (DBMS.SYBASE, DBMS.MAXDB): query = rootQuery.blind.query % (kb.data.cachedUsers[-1] if kb.data.cachedUsers else " ") - elif Backend.isFork(FORK.DRIZZLE): + elif Backend.isDbms(DBMS.MYSQL) and Backend.isFork(FORK.DRIZZLE): query = rootQuery.blind.query3 % index elif condition: query = rootQuery.blind.query2 % index