From a34c1b287c55154524eee07870aeed7bbf757628 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 12 Nov 2010 11:33:11 +0000 Subject: [PATCH] Bug fix related to properly identify and parse the version from the banner (used for --stacked-test and other matters on MySQL/PgSQL) --- lib/core/common.py | 5 ++--- plugins/generic/enumeration.py | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 8240fedc9..f59170ec7 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -919,11 +919,10 @@ def getDelayQuery(andCond=False): if not kb.data.banner: conf.dbmsHandler.getVersionFromBanner() - banVer = kb.bannerFp["dbmsVersion"] + banVer = kb.bannerFp["dbmsVersion"] if 'dbmsVersion' in kb.bannerFp else None - if (kb.dbms == DBMS.MYSQL and banVer >= "5.0.12") or (kb.dbms == DBMS.POSTGRESQL and banVer >= "8.2"): + if banVer is None or (kb.dbms == DBMS.MYSQL and banVer >= "5.0.12") or (kb.dbms == DBMS.POSTGRESQL and banVer >= "8.2"): query = queries[kb.dbms].timedelay.query % conf.timeSec - else: query = queries[kb.dbms].timedelay.query2 % conf.timeSec elif kb.dbms == DBMS.FIREBIRD: diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index af4b17245..583f8c9ff 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -88,9 +88,6 @@ class Enumeration: kb.data.banner = inject.getValue(query) bannerParser(kb.data.banner) - if kb.data.banner: - kb.bannerFp["dbmsVersion"] = kb.data.banner.replace(",", "").replace("-", "").replace(" ", "") - if conf.os and conf.os == "windows": kb.bannerFp["type"] = set([ "Windows" ])