Minor style update

This commit is contained in:
Miroslav Stampar 2013-01-10 11:54:07 +01:00
parent 7ea846e111
commit ca1c0c2a1d
8 changed files with 20 additions and 20 deletions

View File

@ -166,9 +166,9 @@ class Agent(object):
# after the prefix or it is in GROUP BY / ORDER BY (<clause>)
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

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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] = []

View File

@ -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)

View File

@ -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:

View File

@ -132,7 +132,7 @@ class Filesystem:
elif encoding == "base64":
content = "'%s'" % content
retVal = [ content ]
retVal = [content]
return retVal