Be more user friendly on messages and minor code layout improvement

This commit is contained in:
Bernardo Damele 2008-11-02 18:23:42 +00:00
parent 09ca578ca1
commit 03b90e0a3f
6 changed files with 15 additions and 8 deletions

View File

@ -91,7 +91,8 @@ class Dump:
def lister(self, header, elements):
self.__write("%s [%d]:" % (header, len(elements)))
if elements:
self.__write("%s [%d]:" % (header, len(elements)))
try:
elements = set(elements)
@ -106,13 +107,15 @@ class Dump:
elif isinstance(element, (list, tuple, set)):
self.__write("[*] " + ", ".join(e for e in element))
self.__write("")
if elements:
self.__write("")
def userSettings(self, header, userSettings, subHeader):
self.__areAdmins = set()
self.__write("%s:" % header)
if userSettings:
self.__write("%s:" % header)
if isinstance(userSettings, (tuple, list, set)):
self.__areAdmins = userSettings[1]

View File

@ -195,7 +195,7 @@ class MSSQLServerMap(Fingerprint, Enumeration, Filesystem, Takeover):
def getPrivileges(self):
warnMsg = "this plugin can not fetch database users privileges"
warnMsg = "on MySQL is it not possible to fetch database users privileges"
logger.warn(warnMsg)
return {}

View File

@ -210,7 +210,7 @@ class OracleMap(Fingerprint, Enumeration, Filesystem, Takeover):
def getDbs(self):
warnMsg = "this plugin can not enumerate databases"
warnMsg = "on Oracle it is not possible to enumerate databases"
logger.warn(warnMsg)
return []

View File

@ -33,10 +33,10 @@ class Filesystem:
"""
def readFile(self, rFile):
errMsg = "this plugin does not support OS file reading yet"
errMsg = "OS file reading not yet implemented for this DBMS"
raise sqlmapUnsupportedFeatureException, errMsg
def writeFile(self, wFile):
errMsg = "this plugin does not support OS file writing yet"
errMsg = "OS file writing not yet implemented for this DBMS"
raise sqlmapUnsupportedFeatureException, errMsg

View File

@ -33,5 +33,5 @@ class Takeover:
"""
def osShell(self):
errMsg = "this plugin does not support OS shell functionality yet"
errMsg = "OS shell functionality not yet implemented for this DBMS"
raise sqlmapUnsupportedFeatureException, errMsg

View File

@ -72,16 +72,20 @@ def main():
if conf.start:
start()
except exceptionsTuple, e:
logger.error(e)
except KeyboardInterrupt:
print
errMsg = "user aborted"
logger.error(errMsg)
except EOFError:
print
errMsg = "exit"
logger.error(errMsg)
except:
errMsg = unhandledException()
logger.error(errMsg)