Skip to content

Commit 2fcbb57

Browse files
committed
Minor code restyling
1 parent 4b02ed4 commit 2fcbb57

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

plugins/dbms/mssqlserver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from lib.core.exception import sqlmapSyntaxException
4242
from lib.core.session import setDbms
4343
from lib.core.settings import MSSQL_ALIASES
44+
from lib.core.settings import MSSQL_SYSTEM_DBS
4445
from lib.core.unescaper import unescaper
4546
from lib.parse.banner import bannerParser
4647
from lib.request import inject
@@ -59,6 +60,7 @@ class MSSQLServerMap(Fingerprint, Enumeration, Filesystem, Takeover):
5960
"""
6061

6162
def __init__(self):
63+
self.excludeDbsList = MSSQL_SYSTEM_DBS
6264
Enumeration.__init__(self, "Microsoft SQL Server")
6365

6466
unescaper.setUnescape(MSSQLServerMap.unescape)

plugins/dbms/mysql.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from lib.core.exception import sqlmapSyntaxException
4141
from lib.core.session import setDbms
4242
from lib.core.settings import MYSQL_ALIASES
43+
from lib.core.settings import MYSQL_SYSTEM_DBS
4344
from lib.core.shell import autoCompletion
4445
from lib.core.unescaper import unescaper
4546
from lib.request import inject
@@ -58,6 +59,7 @@ class MySQLMap(Fingerprint, Enumeration, Filesystem, Takeover):
5859
"""
5960

6061
def __init__(self):
62+
self.excludeDbsList = MYSQL_SYSTEM_DBS
6163
Enumeration.__init__(self, "MySQL")
6264

6365
unescaper.setUnescape(MySQLMap.unescape)

plugins/dbms/oracle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class OracleMap(Fingerprint, Enumeration, Filesystem, Takeover):
5252

5353

5454
def __init__(self):
55+
self.excludeDbsList = ORACLE_SYSTEM_DBS
5556
Enumeration.__init__(self, "Oracle")
5657

5758
unescaper.setUnescape(OracleMap.unescape)

plugins/dbms/postgresql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class PostgreSQLMap(Fingerprint, Enumeration, Filesystem, Takeover):
5252
"""
5353

5454
def __init__(self):
55+
self.excludeDbsList = PGSQL_SYSTEM_DBS
5556
Enumeration.__init__(self, "PostgreSQL")
5657

5758
unescaper.setUnescape(PostgreSQLMap.unescape)

plugins/generic/enumeration.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
from lib.core.exception import sqlmapNoneDataException
4040
from lib.core.exception import sqlmapUndefinedMethod
4141
from lib.core.exception import sqlmapUnsupportedFeatureException
42-
from lib.core.settings import MYSQL_SYSTEM_DBS
43-
from lib.core.settings import PGSQL_SYSTEM_DBS
44-
from lib.core.settings import ORACLE_SYSTEM_DBS
45-
from lib.core.settings import MSSQL_SYSTEM_DBS
4642
from lib.core.shell import autoCompletion
4743
from lib.request import inject
4844
from lib.request.connect import Connect as Request
@@ -70,15 +66,6 @@ def __init__(self, dbms):
7066

7167
temp.inference = queries[dbms].inference
7268

73-
if dbms == "MySQL":
74-
self.excludeDbsList = MYSQL_SYSTEM_DBS
75-
elif dbms == "PostgreSQL":
76-
self.excludeDbsList = PGSQL_SYSTEM_DBS
77-
elif dbms == "Oracle":
78-
self.excludeDbsList = ORACLE_SYSTEM_DBS
79-
elif dbms == "Microsoft SQL Server":
80-
self.excludeDbsList = MSSQL_SYSTEM_DBS
81-
8269

8370
def forceDbmsEnum(self):
8471
pass
@@ -535,7 +522,7 @@ def getDbs(self):
535522
if kb.dbms == "MySQL" and not self.has_information_schema:
536523
warnMsg = "information_schema not available, "
537524
warnMsg += "back-end DBMS is MySQL < 5. database "
538-
warnMsg += "names will be fetched from 'mysql' table"
525+
warnMsg += "names will be fetched from 'mysql' database"
539526
logger.warn(warnMsg)
540527

541528
logMsg = "fetching database names"

0 commit comments

Comments
 (0)