Minor code restyling

This commit is contained in:
Bernardo Damele 2008-10-26 17:00:07 +00:00
parent 4b02ed45fa
commit 2fcbb57e1c
5 changed files with 7 additions and 14 deletions

View File

@ -41,6 +41,7 @@ from lib.core.exception import sqlmapNoneDataException
from lib.core.exception import sqlmapSyntaxException from lib.core.exception import sqlmapSyntaxException
from lib.core.session import setDbms from lib.core.session import setDbms
from lib.core.settings import MSSQL_ALIASES from lib.core.settings import MSSQL_ALIASES
from lib.core.settings import MSSQL_SYSTEM_DBS
from lib.core.unescaper import unescaper from lib.core.unescaper import unescaper
from lib.parse.banner import bannerParser from lib.parse.banner import bannerParser
from lib.request import inject from lib.request import inject
@ -59,6 +60,7 @@ class MSSQLServerMap(Fingerprint, Enumeration, Filesystem, Takeover):
""" """
def __init__(self): def __init__(self):
self.excludeDbsList = MSSQL_SYSTEM_DBS
Enumeration.__init__(self, "Microsoft SQL Server") Enumeration.__init__(self, "Microsoft SQL Server")
unescaper.setUnescape(MSSQLServerMap.unescape) unescaper.setUnescape(MSSQLServerMap.unescape)

View File

@ -40,6 +40,7 @@ from lib.core.data import paths
from lib.core.exception import sqlmapSyntaxException from lib.core.exception import sqlmapSyntaxException
from lib.core.session import setDbms from lib.core.session import setDbms
from lib.core.settings import MYSQL_ALIASES from lib.core.settings import MYSQL_ALIASES
from lib.core.settings import MYSQL_SYSTEM_DBS
from lib.core.shell import autoCompletion from lib.core.shell import autoCompletion
from lib.core.unescaper import unescaper from lib.core.unescaper import unescaper
from lib.request import inject from lib.request import inject
@ -58,6 +59,7 @@ class MySQLMap(Fingerprint, Enumeration, Filesystem, Takeover):
""" """
def __init__(self): def __init__(self):
self.excludeDbsList = MYSQL_SYSTEM_DBS
Enumeration.__init__(self, "MySQL") Enumeration.__init__(self, "MySQL")
unescaper.setUnescape(MySQLMap.unescape) unescaper.setUnescape(MySQLMap.unescape)

View File

@ -52,6 +52,7 @@ class OracleMap(Fingerprint, Enumeration, Filesystem, Takeover):
def __init__(self): def __init__(self):
self.excludeDbsList = ORACLE_SYSTEM_DBS
Enumeration.__init__(self, "Oracle") Enumeration.__init__(self, "Oracle")
unescaper.setUnescape(OracleMap.unescape) unescaper.setUnescape(OracleMap.unescape)

View File

@ -52,6 +52,7 @@ class PostgreSQLMap(Fingerprint, Enumeration, Filesystem, Takeover):
""" """
def __init__(self): def __init__(self):
self.excludeDbsList = PGSQL_SYSTEM_DBS
Enumeration.__init__(self, "PostgreSQL") Enumeration.__init__(self, "PostgreSQL")
unescaper.setUnescape(PostgreSQLMap.unescape) unescaper.setUnescape(PostgreSQLMap.unescape)

View File

@ -39,10 +39,6 @@ from lib.core.exception import sqlmapMissingMandatoryOptionException
from lib.core.exception import sqlmapNoneDataException from lib.core.exception import sqlmapNoneDataException
from lib.core.exception import sqlmapUndefinedMethod from lib.core.exception import sqlmapUndefinedMethod
from lib.core.exception import sqlmapUnsupportedFeatureException from lib.core.exception import sqlmapUnsupportedFeatureException
from lib.core.settings import MYSQL_SYSTEM_DBS
from lib.core.settings import PGSQL_SYSTEM_DBS
from lib.core.settings import ORACLE_SYSTEM_DBS
from lib.core.settings import MSSQL_SYSTEM_DBS
from lib.core.shell import autoCompletion from lib.core.shell import autoCompletion
from lib.request import inject from lib.request import inject
from lib.request.connect import Connect as Request from lib.request.connect import Connect as Request
@ -70,15 +66,6 @@ class Enumeration:
temp.inference = queries[dbms].inference temp.inference = queries[dbms].inference
if dbms == "MySQL":
self.excludeDbsList = MYSQL_SYSTEM_DBS
elif dbms == "PostgreSQL":
self.excludeDbsList = PGSQL_SYSTEM_DBS
elif dbms == "Oracle":
self.excludeDbsList = ORACLE_SYSTEM_DBS
elif dbms == "Microsoft SQL Server":
self.excludeDbsList = MSSQL_SYSTEM_DBS
def forceDbmsEnum(self): def forceDbmsEnum(self):
pass pass
@ -535,7 +522,7 @@ class Enumeration:
if kb.dbms == "MySQL" and not self.has_information_schema: if kb.dbms == "MySQL" and not self.has_information_schema:
warnMsg = "information_schema not available, " warnMsg = "information_schema not available, "
warnMsg += "back-end DBMS is MySQL < 5. database " warnMsg += "back-end DBMS is MySQL < 5. database "
warnMsg += "names will be fetched from 'mysql' table" warnMsg += "names will be fetched from 'mysql' database"
logger.warn(warnMsg) logger.warn(warnMsg)
logMsg = "fetching database names" logMsg = "fetching database names"