From d06182347f6807ac001d0a6048bf249dc8c6a150 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 29 Feb 2012 13:56:40 +0000 Subject: [PATCH] fixing few potential problems --- lib/core/common.py | 2 +- plugins/dbms/mssqlserver/enumeration.py | 7 ++++--- plugins/generic/enumeration.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index eb1a915ba..294d3269b 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2767,7 +2767,7 @@ def isNoneValue(value): """ if isinstance(value, basestring): - return value == "None" + return value in ("None", "") elif isinstance(value, (list, tuple)): if len(value) == 1: return isNoneValue(value[0]) diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index 69ff21f92..d0653cbee 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -135,9 +135,10 @@ class Enumeration(GenericEnumeration): _ = (rootQuery.blind.query if query == rootQuery.blind.count else rootQuery.blind.query2 if query == rootQuery.blind.count2 else rootQuery.blind.query3).replace("%s", db) % index table = inject.getValue(_, inband=False, error=False) - kb.hintValue = table - table = safeSQLIdentificatorNaming(table, True) - tables.append(table) + if not isNoneValue(table): + kb.hintValue = table + table = safeSQLIdentificatorNaming(table, True) + tables.append(table) if tables: kb.data.cachedTables[db] = tables diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index f7abc80af..bdcd32d55 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1449,7 +1449,7 @@ class Enumeration: value = inject.getValue(query, blind=False) if column == colList[0]: - if isNoneValue(value) or not value: + if isNoneValue(value): breakRetrieval = True break else: