From 529595fd8537324dbb0ce329495ba7b1fac6b2d0 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 29 Apr 2011 22:37:43 +0000 Subject: [PATCH] Moved method below --- plugins/generic/enumeration.py | 62 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 5b294ea2d..315bb8953 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -903,37 +903,6 @@ class Enumeration: return kb.data.cachedTables - def getSchema(self): - infoMsg = "enumerating database management system schema" - logger.info(infoMsg) - - pushValue(conf.db) - pushValue(conf.tbl) - - conf.db = None - conf.tbl = None - - self.getTables() - - infoMsg = "fetched tables: " - infoMsg += ", ".join(["%s" % ", ".join("%s%s%s" % (db, ".." if \ - Backend.isDbms(DBMS.MSSQL) or Backend.isDbms(DBMS.SYBASE) \ - else ".", t) for t in tbl) for db, tbl in \ - kb.data.cachedTables.items()]) - logger.info(infoMsg) - - for db, tables in kb.data.cachedTables.items(): - for tbl in tables: - conf.db = db - conf.tbl = tbl - - self.getColumns() - - conf.tbl = popValue() - conf.db = popValue() - - return kb.data.cachedColumns - def getColumns(self, onlyColNames=False): bruteForce = False @@ -1174,6 +1143,37 @@ class Enumeration: return kb.data.cachedColumns + def getSchema(self): + infoMsg = "enumerating database management system schema" + logger.info(infoMsg) + + pushValue(conf.db) + pushValue(conf.tbl) + + conf.db = None + conf.tbl = None + + self.getTables() + + infoMsg = "fetched tables: " + infoMsg += ", ".join(["%s" % ", ".join("%s%s%s" % (db, ".." if \ + Backend.isDbms(DBMS.MSSQL) or Backend.isDbms(DBMS.SYBASE) \ + else ".", t) for t in tbl) for db, tbl in \ + kb.data.cachedTables.items()]) + logger.info(infoMsg) + + for db, tables in kb.data.cachedTables.items(): + for tbl in tables: + conf.db = db + conf.tbl = tbl + + self.getColumns() + + conf.tbl = popValue() + conf.db = popValue() + + return kb.data.cachedColumns + def __pivotDumpTable(self, table, colList, count=None, blind=True): lengths = {} entries = {}