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>) # after the prefix or it is in GROUP BY / ORDER BY (<clause>)
elif kb.technique == PAYLOAD.TECHNIQUE.STACKED: elif kb.technique == PAYLOAD.TECHNIQUE.STACKED:
query = kb.injection.prefix 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 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 query = prefix
# In any other case prepend with the full 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" infoMsg = "first request to Google to get the session cookie"
logger.info(infoMsg) logger.info(infoMsg)
handlers = [ proxyHandler ] handlers = [proxyHandler]
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html # Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
if conf.keepAlive: if conf.keepAlive:
@ -1003,8 +1003,8 @@ def _setPrefixSuffix():
boundary = AttribDict() boundary = AttribDict()
boundary.level = 1 boundary.level = 1
boundary.clause = [ 0 ] boundary.clause = [0]
boundary.where = [ 1, 2, 3 ] boundary.where = [1, 2, 3]
boundary.prefix = conf.prefix boundary.prefix = conf.prefix
boundary.suffix = conf.suffix boundary.suffix = conf.suffix
@ -1022,7 +1022,7 @@ def _setPrefixSuffix():
# user who provides --prefix/--suffix does not want other boundaries # user who provides --prefix/--suffix does not want other boundaries
# to be tested for # to be tested for
conf.boundaries = [ boundary ] conf.boundaries = [boundary]
def _setAuthCred(): def _setAuthCred():
""" """
@ -1523,7 +1523,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
# Active back-end DBMS fingerprint # Active back-end DBMS fingerprint
kb.dbms = None kb.dbms = None
kb.dbmsVersion = [ UNKNOWN_DBMS_VERSION ] kb.dbmsVersion = [UNKNOWN_DBMS_VERSION]
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0] kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
kb.dep = None kb.dep = None

View File

@ -40,7 +40,7 @@ class CompleterNG(rlcompleter.Completer):
matches = [] matches = []
n = len(text) n = len(text)
for ns in [ self.namespace ]: for ns in (self.namespace,):
for word in ns: for word in ns:
if word[:n] == text: if word[:n] == text:
matches.append(word) 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: if conf.threads > 1 and isinstance(length, int) and length > 1:
threadData = getCurrentThreadData() threadData = getCurrentThreadData()
threadData.shared.value = [ None ] * length threadData.shared.value = [None] * length
threadData.shared.index = [ firstChar ] # As list for python nested function scoping threadData.shared.index = [firstChar] # As list for python nested function scoping
threadData.shared.start = firstChar threadData.shared.start = firstChar
try: try:

View File

@ -42,7 +42,7 @@ class Enumeration(GenericEnumeration):
areAdmins = set() areAdmins = set()
if conf.user: if conf.user:
users = [ conf.user ] users = [conf.user]
elif not len(kb.data.cachedUsers): elif not len(kb.data.cachedUsers):
users = self.getUsers() users = self.getUsers()
else: else:
@ -203,7 +203,7 @@ class Enumeration(GenericEnumeration):
if not isNoneValue(values): if not isNoneValue(values):
if isinstance(values, basestring): if isinstance(values, basestring):
values = [ values ] values = [values]
for foundTbl in values: for foundTbl in values:
if foundTbl is None: if foundTbl is None:
@ -325,7 +325,7 @@ class Enumeration(GenericEnumeration):
if not isNoneValue(values): if not isNoneValue(values):
if isinstance(values, basestring): if isinstance(values, basestring):
values = [ values ] values = [values]
for foundTbl in values: for foundTbl in values:
foundTbl = safeSQLIdentificatorNaming(foundTbl, True) foundTbl = safeSQLIdentificatorNaming(foundTbl, True)
@ -353,7 +353,7 @@ class Enumeration(GenericEnumeration):
if db in foundCols[column]: if db in foundCols[column]:
foundCols[column][db].append(foundTbl) foundCols[column][db].append(foundTbl)
else: else:
foundCols[column][db] = [ foundTbl ] foundCols[column][db] = [foundTbl]
else: else:
foundCols[column][db] = [] foundCols[column][db] = []

View File

@ -24,10 +24,10 @@ class PostgreSQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous,
self.excludeDbsList = PGSQL_SYSTEM_DBS self.excludeDbsList = PGSQL_SYSTEM_DBS
self.sysUdfs = { self.sysUdfs = {
# UDF name: UDF parameters' input data-type and return data-type # UDF name: UDF parameters' input data-type and return data-type
"sys_exec": { "input": [ "text" ], "return": "int4" }, "sys_exec": { "input": ["text"], "return": "int4" },
"sys_eval": { "input": [ "text" ], "return": "text" }, "sys_eval": { "input": ["text"], "return": "text" },
"sys_bineval": { "input": [ "text" ], "return": "int4" }, "sys_bineval": { "input": ["text"], "return": "int4" },
"sys_fileread": { "input": [ "text" ], "return": "text" } "sys_fileread": { "input": ["text"], "return": "text" }
} }
Syntax.__init__(self) Syntax.__init__(self)

View File

@ -60,7 +60,7 @@ class Enumeration(GenericEnumeration):
areAdmins = set() areAdmins = set()
if conf.user: if conf.user:
users = [ conf.user ] users = [conf.user]
elif not len(kb.data.cachedUsers): elif not len(kb.data.cachedUsers):
users = self.getUsers() users = self.getUsers()
else: else:

View File

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