From 47565f9459adb92aa460171407fc8935312bd029 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Mon, 17 Jan 2011 21:13:59 +0000 Subject: [PATCH] Minor code refactoring --- lib/controller/checks.py | 4 ++-- lib/controller/handler.py | 5 ++--- lib/core/common.py | 4 ++-- lib/core/option.py | 2 +- plugins/generic/fingerprint.py | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 4ab8b6ba6..f7c145a8a 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -381,7 +381,7 @@ def checkSqlInjection(place, parameter, value): # Set fingerprinted DBMS according to the # current test settings for proper unescaping - kb.misc.fpDbms = dbms + kb.misc.forcedDbms = dbms if not getIdentifiedDBMS(): warnMsg = "using unescaped version of the test " @@ -402,7 +402,7 @@ def checkSqlInjection(place, parameter, value): # by unionTest() directly where = vector[6] - kb.misc.fpDbms = None + kb.misc.forcedDbms = None # If the injection test was successful feed the injection # object with the test's details diff --git a/lib/controller/handler.py b/lib/controller/handler.py index a4dae69d1..5b06b2c45 100644 --- a/lib/controller/handler.py +++ b/lib/controller/handler.py @@ -101,6 +101,5 @@ def setHandler(): else: conf.dbmsConnector = None - # At this point proper back-end DBMS will be identified (kb.dbms) - # so we have to force DBMS - kb.misc.fpDbms = None + # At this point proper back-end DBMS is fingerprinted (kb.dbms) + kb.misc.forcedDbms = None diff --git a/lib/core/common.py b/lib/core/common.py index 4212bef3e..a4103aa66 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2077,8 +2077,8 @@ def getErrorParsedDBMSes(): def getIdentifiedDBMS(): dbms = None - if kb.misc.fpDbms is not None: - dbms = kb.misc.fpDbms + if kb.misc.forcedDbms is not None: + dbms = kb.misc.forcedDbms elif kb.dbms is not None: dbms = kb.dbms elif conf.dbms is not None: diff --git a/lib/core/option.py b/lib/core/option.py index 5a2fb8706..c609f94fd 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1171,7 +1171,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): kb.misc.start = ":%s:" % randomStr(length=3, lowercase=True) kb.misc.stop = ":%s:" % randomStr(length=3, lowercase=True) kb.misc.space = ":%s:" % randomStr(length=1, lowercase=True) - kb.misc.fpDbms = None + kb.misc.forcedDbms = None if flushAll: kb.keywords = set(getFileItems(paths.SQL_KEYWORDS)) diff --git a/plugins/generic/fingerprint.py b/plugins/generic/fingerprint.py index 793640235..a8fe44739 100644 --- a/plugins/generic/fingerprint.py +++ b/plugins/generic/fingerprint.py @@ -18,7 +18,7 @@ class Fingerprint: """ def __init__(self, dbms): - kb.misc.fpDbms = dbms + kb.misc.forcedDbms = dbms def getFingerprint(self): errMsg = "'getFingerprint' method must be defined "