diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index 830efdbaf..b67cdcc45 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -139,6 +139,10 @@ class Enumeration(GenericEnumeration): if not kb.data.cachedTables: errMsg = "unable to retrieve the tables for any database" raise sqlmapNoneDataException(errMsg) + else: + for db, tables in kb.data.cachedTables.items(): + if tables: + kb.data.cachedTables[db] = sorted(tables) return kb.data.cachedTables diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index be5cb43e9..f96367a8d 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -973,7 +973,9 @@ class Enumeration: else: raise sqlmapNoneDataException, errMsg else: - kb.data.cachedTables.sort() + for db, tables in kb.data.cachedTables.items(): + if tables: + kb.data.cachedTables[db] = sorted(tables) return kb.data.cachedTables