From 1d4b10dbd180397ee1cb81f9ab79430037ce6a00 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 8 Feb 2012 13:55:50 +0000 Subject: [PATCH] bug fix --- doc/THANKS | 1 + plugins/generic/enumeration.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) 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))