From cc9711ef5b444c505cde838d1cbbea4bf377e87d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 15 May 2019 10:30:47 +0200 Subject: [PATCH] Couple of drei updates --- lib/core/settings.py | 2 +- lib/techniques/union/use.py | 2 +- plugins/dbms/maxdb/enumeration.py | 4 ++-- plugins/dbms/sybase/enumeration.py | 8 ++++---- plugins/generic/databases.py | 4 ++-- plugins/generic/entries.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 9d5f1843f..70ad1958f 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.3.5.91" +VERSION = "1.3.5.92" 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/lib/techniques/union/use.py b/lib/techniques/union/use.py index f7fa70206..6cebf45be 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -352,7 +352,7 @@ def unionUse(expression, unpack=True, dump=False): key = re.sub(r"[^A-Za-z0-9]", "", item).lower() if key not in filtered or re.search(r"[^A-Za-z0-9]", item): filtered[key] = item - items = list(filtered.values()) + items = list(six.itervalues(filtered)) items = [items] index = None for index in xrange(1 + len(threadData.shared.buffered)): diff --git a/plugins/dbms/maxdb/enumeration.py b/plugins/dbms/maxdb/enumeration.py index a57bb26e2..557a6b8c1 100644 --- a/plugins/dbms/maxdb/enumeration.py +++ b/plugins/dbms/maxdb/enumeration.py @@ -49,7 +49,7 @@ class Enumeration(GenericEnumeration): retVal = pivotDumpTable("(%s) AS %s" % (query, kb.aliasName), ['%s.schemaname' % kb.aliasName], blind=True) if retVal: - kb.data.cachedDbs = list(retVal[0].values())[0] + kb.data.cachedDbs = six.itervalues(retVal[0]).next() if kb.data.cachedDbs: kb.data.cachedDbs.sort() @@ -134,7 +134,7 @@ class Enumeration(GenericEnumeration): if len(kb.data.cachedTables) > 0: tblList = list(kb.data.cachedTables.values()) - if isListLike(tblList[0]): + if tblList and isListLike(tblList[0]): tblList = tblList[0] else: errMsg = "unable to retrieve the tables " diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index 475ae54af..953d469f3 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -103,7 +103,7 @@ class Enumeration(GenericEnumeration): retVal = pivotDumpTable("(%s) AS %s" % (query, kb.aliasName), ['%s.name' % kb.aliasName], blind=blind, alias=kb.aliasName) if retVal: - kb.data.cachedDbs = list(retVal[0].values())[0] + kb.data.cachedDbs = six.itervalues(retVal[0]).next() break if kb.data.cachedDbs: @@ -147,7 +147,7 @@ class Enumeration(GenericEnumeration): retVal = pivotDumpTable("(%s) AS %s" % (query, kb.aliasName), ['%s.name' % kb.aliasName], blind=blind, alias=kb.aliasName) if retVal: - for table in list(retVal[0].values())[0]: + for table in six.itervalues(retVal[0]).next(): if db not in kb.data.cachedTables: kb.data.cachedTables[db] = [table] else: @@ -196,9 +196,9 @@ class Enumeration(GenericEnumeration): self.getTables() if len(kb.data.cachedTables) > 0: - tblList = list(kb.data.cachedTables.values()) + tblList = list(six.itervalues(kb.data.cachedTables)) - if isListLike(tblList[0]): + if tblList and isListLike(tblList[0]): tblList = tblList[0] else: errMsg = "unable to retrieve the tables " diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index c47b72873..a2e463c3b 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -478,9 +478,9 @@ class Databases: if conf.db in kb.data.cachedTables: tblList = kb.data.cachedTables[conf.db] else: - tblList = list(kb.data.cachedTables.values()) + tblList = list(six.itervalues(kb.data.cachedTables)) - if isListLike(tblList[0]): + if tblList and isListLike(tblList[0]): tblList = tblList[0] tblList = list(tblList) diff --git a/plugins/generic/entries.py b/plugins/generic/entries.py index 7f3c21542..1e072d771 100644 --- a/plugins/generic/entries.py +++ b/plugins/generic/entries.py @@ -93,9 +93,9 @@ class Entries: self.getTables() if len(kb.data.cachedTables) > 0: - tblList = list(kb.data.cachedTables.values()) + tblList = list(six.itervalues(kb.data.cachedTables)) - if isListLike(tblList[0]): + if tblList and isListLike(tblList[0]): tblList = tblList[0] elif not conf.search: errMsg = "unable to retrieve the tables "