From 23bf52e4961225cb2876caae5a1ab326dc2e3eb5 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 24 Oct 2011 09:55:50 +0000 Subject: [PATCH] minor refactoring --- lib/techniques/error/use.py | 2 +- lib/techniques/union/use.py | 2 +- plugins/generic/enumeration.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index 8a9e9bdf7..72bef1c8d 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -294,7 +294,7 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False): stopLimit = conf.limitStop # Count the number of SQL query entries output - countedExpression = expression.replace(expressionFields, "COUNT(*)", 1) + countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % '*', 1) if re.search(" ORDER BY ", expression, re.I): untilOrderChar = countedExpression.index(" ORDER BY ") diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 2472351a8..a76e338e9 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -234,7 +234,7 @@ def unionUse(expression, unpack=True, dump=False): stopLimit = conf.limitStop # Count the number of SQL query entries output - countedExpression = expression.replace(expressionFields, "COUNT(*)", 1) + countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % '*', 1) if re.search(" ORDER BY ", expression, re.I): untilOrderChar = countedExpression.index(" ORDER BY ") diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 7a85608e2..a8c36126a 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1322,9 +1322,9 @@ class Enumeration: def __tableGetCount(self, db, table): if Backend.isDbms(DBMS.DB2): - query = "SELECT COUNT(*) FROM %s.%s--" % (safeSQLIdentificatorNaming(db.upper()), safeSQLIdentificatorNaming(table.upper(), True)) + query = "SELECT %s FROM %s.%s--" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db.upper()), safeSQLIdentificatorNaming(table.upper(), True)) else: - query = "SELECT COUNT(*) FROM %s.%s" % (safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True)) + query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True)) count = inject.getValue(query, expected=EXPECTED.INT, charsetType=2)