From 78e8a83c110846134e791cf465e0ade3ef217913 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 5 Dec 2008 15:32:59 +0000 Subject: [PATCH] Minor improvement to be able to provide CU as user value (-U) when enumerating users privileges or users passwords. --- plugins/generic/enumeration.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 35633ea31..24c498c27 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -170,10 +170,15 @@ class Enumeration: def getPasswordHashes(self): infoMsg = "fetching database users password hashes" - logger.info(infoMsg) rootQuery = queries[kb.dbms].passwords + if conf.user == "CU": + infoMsg += " for current user" + conf.user = self.getCurrentUser() + + logger.info(infoMsg) + if conf.unionUse: if kb.dbms == "Microsoft SQL Server" and kb.dbmsVersion[0] in ( "2005", "2008" ): query = rootQuery["inband"]["query2"] @@ -301,10 +306,15 @@ class Enumeration: def getPrivileges(self): infoMsg = "fetching database users privileges" - logger.info(infoMsg) rootQuery = queries[kb.dbms].privileges + if conf.user == "CU": + infoMsg += " for current user" + conf.user = self.getCurrentUser() + + logger.info(infoMsg) + # Set containing the list of DBMS administrators areAdmins = set()