diff --git a/plugins/dbms/maxdb/enumeration.py b/plugins/dbms/maxdb/enumeration.py index 8fd2f4680..1f2b38130 100644 --- a/plugins/dbms/maxdb/enumeration.py +++ b/plugins/dbms/maxdb/enumeration.py @@ -77,8 +77,8 @@ class Enumeration(GenericEnumeration): rootQuery = queries[Backend.getIdentifiedDbms()].tables for db in dbs: - if not isinstance(db, basestring): - db = db[0] + if isinstance(db, (tuple, list)): + db = db[0] if db else "" randStr = randomStr() query = rootQuery.inband.query % (("'%s'" % db) if db != "USER" else 'USER') diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index 6eb637f28..589d63536 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -88,8 +88,8 @@ class Enumeration(GenericEnumeration): if any(isTechniqueAvailable(_) for _ in (PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.ERROR)) or conf.direct: for db in dbs: - if not isinstance(db, basestring): - db = db[0] + if isinstance(db, (tuple, list)): + db = db[0] if db else "" if conf.excludeSysDbs and db in self.excludeDbsList: infoMsg = "skipping system database '%s'" % db diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index a3a74a174..bb69935d0 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -138,8 +138,8 @@ class Enumeration(GenericEnumeration): rootQuery = queries[Backend.getIdentifiedDbms()].tables for db in dbs: - if not isinstance(db, basestring): - db = db[0] + if isinstance(db, (tuple, list)): + db = db[0] if db else "" for blind in blinds: randStr = randomStr() diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 547bdde06..ec0b8da03 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -897,8 +897,8 @@ class Enumeration: value = map(lambda x: (dbs[0], x), value) for db, table in filterPairValues(value): - if not isinstance(db, basestring): - db = db[0] + if isinstance(db, (tuple, list)): + db = db[0] if db else "" db = safeSQLIdentificatorNaming(db) table = safeSQLIdentificatorNaming(table, True)