From ee3aeb8dcf80c4c1d9bfc79d086dca6f16232695 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 12 Jul 2012 01:16:00 +0100 Subject: [PATCH] actual implementation of issue #75, still some work to do --- lib/core/agent.py | 3 +++ plugins/generic/enumeration.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index d6aaaab82..2a2329184 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -798,6 +798,9 @@ class Agent: return unescaper.unescape(lengthExpr) + def forgeQueryOutputLengthZero(self, expression): + return self.forgeCaseStatement(self.forgeQueryOutputLength(expression)) + def forgeCaseStatement(self, expression): """ Take in input a query string and return its CASE statement query diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 522c9de57..6ef226d6c 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1740,7 +1740,12 @@ class Enumeration: elif Backend.isDbms(DBMS.FIREBIRD): query = rootQuery.blind.query % (index, column, tbl) - value = inject.getValue(query, inband=False, error=False, dump=True) + # Skip enumeration of cells that have a value length of 0 + if not inject.checkBooleanExpression(agent.forgeQueryOutputLengthZero(query)): + logger.debug(query) + value = "" + else: + value = inject.getValue(query, inband=False, error=False, dump=True) lengths[column] = max(lengths[column], len(value) if value else 0) entries[column].append(value)