From 805120ac52932ce48e6d9320369568622d693550 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 14 Jul 2012 11:01:30 +0200 Subject: [PATCH] Minor refactoring --- lib/controller/controller.py | 2 +- lib/core/target.py | 2 +- lib/request/connect.py | 4 ++-- lib/techniques/brute/use.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 46c281e6d..a501ff325 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -399,7 +399,7 @@ def start(): if skip: continue - if not conf.paramDict.has_key(place): + if place not in conf.paramDict: continue paramDict = conf.paramDict[place] diff --git a/lib/core/target.py b/lib/core/target.py index 777498dc8..68f219b25 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -62,7 +62,7 @@ def __setRequestParams(): testableParameters = False # Perform checks on GET parameters - if conf.parameters.has_key(PLACE.GET) and conf.parameters[PLACE.GET]: + if conf.parameters.get(PLACE.GET): parameters = conf.parameters[PLACE.GET] paramDict = paramToDict(PLACE.GET, parameters) diff --git a/lib/request/connect.py b/lib/request/connect.py index 9060cb292..6251fda7e 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -236,7 +236,7 @@ class Connect: pass elif target: - if conf.parameters.has_key(PLACE.GET) and not get: + if PLACE.GET in conf.parameters and not get: get = conf.parameters[PLACE.GET] if get: @@ -245,7 +245,7 @@ class Connect: if conf.method == HTTPMETHOD.POST and not post: for place in (PLACE.POST, PLACE.SOAP): - if conf.parameters.has_key(place): + if place in conf.parameters: post = conf.parameters[place] break diff --git a/lib/techniques/brute/use.py b/lib/techniques/brute/use.py index 8ef34c9e5..cc35bedb9 100644 --- a/lib/techniques/brute/use.py +++ b/lib/techniques/brute/use.py @@ -123,7 +123,7 @@ def tableExists(tableFile, regex=None): logger.warn(warnMsg) else: for item in threadData.shared.outputs: - if not kb.data.cachedTables.has_key(conf.db): + if conf.db not in kb.data.cachedTables: kb.data.cachedTables[conf.db] = [item] else: kb.data.cachedTables[conf.db].append(item)