diff --git a/doc/THANKS b/doc/THANKS index 7cb582d48..cc7ea3369 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -342,6 +342,7 @@ Anton Mogilin Anastasios Monachos for providing some useful data for suggesting a feature + for reporting a couple of bugs Kirill Morozov for reporting a bug diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 12c0ba5d3..63661477c 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -102,10 +102,12 @@ class Enumeration: infoMsg = "fetching banner" logger.info(infoMsg) - # Needed for IBM DB2 versions < 9 - if Backend.isDbms(DBMS.DB2) and int(Backend.getVersion().split(".")[0]) < 9: - query = queries[Backend.getIdentifiedDbms()].banner.query2 - kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=False)) + if Backend.isDbms(DBMS.DB2): + rootQuery = queries[DBMS.DB2].banner + for query in (rootQuery.query, rootQuery.query2): + kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=False)) + if kb.data.banner: + break else: query = queries[Backend.getIdentifiedDbms()].banner.query kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=False))