diff --git a/lib/core/agent.py b/lib/core/agent.py index 817c38f9d..4bcb409c8 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -166,9 +166,9 @@ class Agent(object): # after the prefix or it is in GROUP BY / ORDER BY () elif kb.technique == PAYLOAD.TECHNIQUE.STACKED: query = kb.injection.prefix - elif kb.injection.clause == [2, 3] or kb.injection.clause == [ 2 ] or kb.injection.clause == [ 3 ]: + elif kb.injection.clause == [2, 3] or kb.injection.clause == [2] or kb.injection.clause == [3]: query = kb.injection.prefix - elif clause == [2, 3] or clause == [ 2 ] or clause == [ 3 ]: + elif clause == [2, 3] or clause == [2] or clause == [3]: query = prefix # In any other case prepend with the full prefix diff --git a/lib/core/option.py b/lib/core/option.py index 77347d90b..d914cef95 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -484,7 +484,7 @@ def _setGoogleDorking(): infoMsg = "first request to Google to get the session cookie" logger.info(infoMsg) - handlers = [ proxyHandler ] + handlers = [proxyHandler] # Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html if conf.keepAlive: @@ -1003,8 +1003,8 @@ def _setPrefixSuffix(): boundary = AttribDict() boundary.level = 1 - boundary.clause = [ 0 ] - boundary.where = [ 1, 2, 3 ] + boundary.clause = [0] + boundary.where = [1, 2, 3] boundary.prefix = conf.prefix boundary.suffix = conf.suffix @@ -1022,7 +1022,7 @@ def _setPrefixSuffix(): # user who provides --prefix/--suffix does not want other boundaries # to be tested for - conf.boundaries = [ boundary ] + conf.boundaries = [boundary] def _setAuthCred(): """ @@ -1523,7 +1523,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): # Active back-end DBMS fingerprint kb.dbms = None - kb.dbmsVersion = [ UNKNOWN_DBMS_VERSION ] + kb.dbmsVersion = [UNKNOWN_DBMS_VERSION] kb.delayCandidates = TIME_DELAY_CANDIDATES * [0] kb.dep = None diff --git a/lib/core/shell.py b/lib/core/shell.py index f287a2f12..fe476ecd6 100644 --- a/lib/core/shell.py +++ b/lib/core/shell.py @@ -40,7 +40,7 @@ class CompleterNG(rlcompleter.Completer): matches = [] n = len(text) - for ns in [ self.namespace ]: + for ns in (self.namespace,): for word in ns: if word[:n] == text: matches.append(word) diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index e39cbeac1..7821a84f6 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -347,8 +347,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if conf.threads > 1 and isinstance(length, int) and length > 1: threadData = getCurrentThreadData() - threadData.shared.value = [ None ] * length - threadData.shared.index = [ firstChar ] # As list for python nested function scoping + threadData.shared.value = [None] * length + threadData.shared.index = [firstChar] # As list for python nested function scoping threadData.shared.start = firstChar try: diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index e1d990b5e..082bec7b3 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -42,7 +42,7 @@ class Enumeration(GenericEnumeration): areAdmins = set() if conf.user: - users = [ conf.user ] + users = [conf.user] elif not len(kb.data.cachedUsers): users = self.getUsers() else: @@ -203,7 +203,7 @@ class Enumeration(GenericEnumeration): if not isNoneValue(values): if isinstance(values, basestring): - values = [ values ] + values = [values] for foundTbl in values: if foundTbl is None: @@ -325,7 +325,7 @@ class Enumeration(GenericEnumeration): if not isNoneValue(values): if isinstance(values, basestring): - values = [ values ] + values = [values] for foundTbl in values: foundTbl = safeSQLIdentificatorNaming(foundTbl, True) @@ -353,7 +353,7 @@ class Enumeration(GenericEnumeration): if db in foundCols[column]: foundCols[column][db].append(foundTbl) else: - foundCols[column][db] = [ foundTbl ] + foundCols[column][db] = [foundTbl] else: foundCols[column][db] = [] diff --git a/plugins/dbms/postgresql/__init__.py b/plugins/dbms/postgresql/__init__.py index 5b7116e61..f2f6f0140 100644 --- a/plugins/dbms/postgresql/__init__.py +++ b/plugins/dbms/postgresql/__init__.py @@ -24,10 +24,10 @@ class PostgreSQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, self.excludeDbsList = PGSQL_SYSTEM_DBS self.sysUdfs = { # UDF name: UDF parameters' input data-type and return data-type - "sys_exec": { "input": [ "text" ], "return": "int4" }, - "sys_eval": { "input": [ "text" ], "return": "text" }, - "sys_bineval": { "input": [ "text" ], "return": "int4" }, - "sys_fileread": { "input": [ "text" ], "return": "text" } + "sys_exec": { "input": ["text"], "return": "int4" }, + "sys_eval": { "input": ["text"], "return": "text" }, + "sys_bineval": { "input": ["text"], "return": "int4" }, + "sys_fileread": { "input": ["text"], "return": "text" } } Syntax.__init__(self) diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index 4620aeff4..928902757 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -60,7 +60,7 @@ class Enumeration(GenericEnumeration): areAdmins = set() if conf.user: - users = [ conf.user ] + users = [conf.user] elif not len(kb.data.cachedUsers): users = self.getUsers() else: diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 41a5d015a..74b3378b3 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -132,7 +132,7 @@ class Filesystem: elif encoding == "base64": content = "'%s'" % content - retVal = [ content ] + retVal = [content] return retVal