diff --git a/plugins/dbms/mssqlserver.py b/plugins/dbms/mssqlserver.py index 84be97dc0..32c229043 100644 --- a/plugins/dbms/mssqlserver.py +++ b/plugins/dbms/mssqlserver.py @@ -41,6 +41,7 @@ from lib.core.exception import sqlmapNoneDataException from lib.core.exception import sqlmapSyntaxException from lib.core.session import setDbms from lib.core.settings import MSSQL_ALIASES +from lib.core.settings import MSSQL_SYSTEM_DBS from lib.core.unescaper import unescaper from lib.parse.banner import bannerParser from lib.request import inject @@ -59,6 +60,7 @@ class MSSQLServerMap(Fingerprint, Enumeration, Filesystem, Takeover): """ def __init__(self): + self.excludeDbsList = MSSQL_SYSTEM_DBS Enumeration.__init__(self, "Microsoft SQL Server") unescaper.setUnescape(MSSQLServerMap.unescape) diff --git a/plugins/dbms/mysql.py b/plugins/dbms/mysql.py index c08c18da8..1ebb88534 100644 --- a/plugins/dbms/mysql.py +++ b/plugins/dbms/mysql.py @@ -40,6 +40,7 @@ from lib.core.data import paths from lib.core.exception import sqlmapSyntaxException from lib.core.session import setDbms from lib.core.settings import MYSQL_ALIASES +from lib.core.settings import MYSQL_SYSTEM_DBS from lib.core.shell import autoCompletion from lib.core.unescaper import unescaper from lib.request import inject @@ -58,6 +59,7 @@ class MySQLMap(Fingerprint, Enumeration, Filesystem, Takeover): """ def __init__(self): + self.excludeDbsList = MYSQL_SYSTEM_DBS Enumeration.__init__(self, "MySQL") unescaper.setUnescape(MySQLMap.unescape) diff --git a/plugins/dbms/oracle.py b/plugins/dbms/oracle.py index 80d1d9fa7..57ee93dff 100644 --- a/plugins/dbms/oracle.py +++ b/plugins/dbms/oracle.py @@ -52,6 +52,7 @@ class OracleMap(Fingerprint, Enumeration, Filesystem, Takeover): def __init__(self): + self.excludeDbsList = ORACLE_SYSTEM_DBS Enumeration.__init__(self, "Oracle") unescaper.setUnescape(OracleMap.unescape) diff --git a/plugins/dbms/postgresql.py b/plugins/dbms/postgresql.py index 0686d7532..03e1047f5 100644 --- a/plugins/dbms/postgresql.py +++ b/plugins/dbms/postgresql.py @@ -52,6 +52,7 @@ class PostgreSQLMap(Fingerprint, Enumeration, Filesystem, Takeover): """ def __init__(self): + self.excludeDbsList = PGSQL_SYSTEM_DBS Enumeration.__init__(self, "PostgreSQL") unescaper.setUnescape(PostgreSQLMap.unescape) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 92861ac08..02a43019f 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -39,10 +39,6 @@ from lib.core.exception import sqlmapMissingMandatoryOptionException from lib.core.exception import sqlmapNoneDataException from lib.core.exception import sqlmapUndefinedMethod 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.request import inject from lib.request.connect import Connect as Request @@ -70,15 +66,6 @@ class Enumeration: 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): pass @@ -535,7 +522,7 @@ class Enumeration: if kb.dbms == "MySQL" and not self.has_information_schema: warnMsg = "information_schema not available, " 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) logMsg = "fetching database names"