Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca1c0c2

Browse files
committed
Minor style update
1 parent 7ea846e commit ca1c0c2

8 files changed

Lines changed: 20 additions & 20 deletions

File tree

lib/core/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def prefixQuery(self, expression, prefix=None, where=None, clause=None):
166166
# after the prefix or it is in GROUP BY / ORDER BY (<clause>)
167167
elif kb.technique == PAYLOAD.TECHNIQUE.STACKED:
168168
query = kb.injection.prefix
169-
elif kb.injection.clause == [2, 3] or kb.injection.clause == [ 2 ] or kb.injection.clause == [ 3 ]:
169+
elif kb.injection.clause == [2, 3] or kb.injection.clause == [2] or kb.injection.clause == [3]:
170170
query = kb.injection.prefix
171-
elif clause == [2, 3] or clause == [ 2 ] or clause == [ 3 ]:
171+
elif clause == [2, 3] or clause == [2] or clause == [3]:
172172
query = prefix
173173

174174
# In any other case prepend with the full prefix

lib/core/option.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def _setGoogleDorking():
484484
infoMsg = "first request to Google to get the session cookie"
485485
logger.info(infoMsg)
486486

487-
handlers = [ proxyHandler ]
487+
handlers = [proxyHandler]
488488

489489
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
490490
if conf.keepAlive:
@@ -1003,8 +1003,8 @@ def _setPrefixSuffix():
10031003
boundary = AttribDict()
10041004

10051005
boundary.level = 1
1006-
boundary.clause = [ 0 ]
1007-
boundary.where = [ 1, 2, 3 ]
1006+
boundary.clause = [0]
1007+
boundary.where = [1, 2, 3]
10081008
boundary.prefix = conf.prefix
10091009
boundary.suffix = conf.suffix
10101010

@@ -1022,7 +1022,7 @@ def _setPrefixSuffix():
10221022

10231023
# user who provides --prefix/--suffix does not want other boundaries
10241024
# to be tested for
1025-
conf.boundaries = [ boundary ]
1025+
conf.boundaries = [boundary]
10261026

10271027
def _setAuthCred():
10281028
"""
@@ -1523,7 +1523,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
15231523

15241524
# Active back-end DBMS fingerprint
15251525
kb.dbms = None
1526-
kb.dbmsVersion = [ UNKNOWN_DBMS_VERSION ]
1526+
kb.dbmsVersion = [UNKNOWN_DBMS_VERSION]
15271527

15281528
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
15291529
kb.dep = None

lib/core/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def global_matches(self, text):
4040
matches = []
4141
n = len(text)
4242

43-
for ns in [ self.namespace ]:
43+
for ns in (self.namespace,):
4444
for word in ns:
4545
if word[:n] == text:
4646
matches.append(word)

lib/techniques/blind/inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ def etaProgressUpdate(charTime, index):
347347
if conf.threads > 1 and isinstance(length, int) and length > 1:
348348
threadData = getCurrentThreadData()
349349

350-
threadData.shared.value = [ None ] * length
351-
threadData.shared.index = [ firstChar ] # As list for python nested function scoping
350+
threadData.shared.value = [None] * length
351+
threadData.shared.index = [firstChar] # As list for python nested function scoping
352352
threadData.shared.start = firstChar
353353

354354
try:

plugins/dbms/mssqlserver/enumeration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def getPrivileges(self, *args):
4242
areAdmins = set()
4343

4444
if conf.user:
45-
users = [ conf.user ]
45+
users = [conf.user]
4646
elif not len(kb.data.cachedUsers):
4747
users = self.getUsers()
4848
else:
@@ -203,7 +203,7 @@ def searchTable(self):
203203

204204
if not isNoneValue(values):
205205
if isinstance(values, basestring):
206-
values = [ values ]
206+
values = [values]
207207

208208
for foundTbl in values:
209209
if foundTbl is None:
@@ -325,7 +325,7 @@ def searchColumn(self):
325325

326326
if not isNoneValue(values):
327327
if isinstance(values, basestring):
328-
values = [ values ]
328+
values = [values]
329329

330330
for foundTbl in values:
331331
foundTbl = safeSQLIdentificatorNaming(foundTbl, True)
@@ -353,7 +353,7 @@ def searchColumn(self):
353353
if db in foundCols[column]:
354354
foundCols[column][db].append(foundTbl)
355355
else:
356-
foundCols[column][db] = [ foundTbl ]
356+
foundCols[column][db] = [foundTbl]
357357
else:
358358
foundCols[column][db] = []
359359

plugins/dbms/postgresql/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def __init__(self):
2424
self.excludeDbsList = PGSQL_SYSTEM_DBS
2525
self.sysUdfs = {
2626
# UDF name: UDF parameters' input data-type and return data-type
27-
"sys_exec": { "input": [ "text" ], "return": "int4" },
28-
"sys_eval": { "input": [ "text" ], "return": "text" },
29-
"sys_bineval": { "input": [ "text" ], "return": "int4" },
30-
"sys_fileread": { "input": [ "text" ], "return": "text" }
27+
"sys_exec": { "input": ["text"], "return": "int4" },
28+
"sys_eval": { "input": ["text"], "return": "text" },
29+
"sys_bineval": { "input": ["text"], "return": "int4" },
30+
"sys_fileread": { "input": ["text"], "return": "text" }
3131
}
3232

3333
Syntax.__init__(self)

plugins/dbms/sybase/enumeration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def getPrivileges(self, *args):
6060
areAdmins = set()
6161

6262
if conf.user:
63-
users = [ conf.user ]
63+
users = [conf.user]
6464
elif not len(kb.data.cachedUsers):
6565
users = self.getUsers()
6666
else:

plugins/generic/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def fileEncode(self, fileName, encoding, single):
132132
elif encoding == "base64":
133133
content = "'%s'" % content
134134

135-
retVal = [ content ]
135+
retVal = [content]
136136

137137
return retVal
138138

0 commit comments

Comments
 (0)