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

Skip to content

Commit 1893053

Browse files
committed
more concise language
1 parent 138b803 commit 1893053

4 files changed

Lines changed: 22 additions & 15 deletions

File tree

lib/request/inject.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,18 @@ def __goInferenceProxy(expression, fromUser=False, expected=None, batch=False, r
291291
stopLimit = 1
292292

293293
elif (not count or int(count) == 0):
294-
warnMsg = "the SQL query provided does not "
295-
warnMsg += "return any output"
296-
logger.warn(warnMsg)
294+
if not count:
295+
warnMsg = "the SQL query provided does not "
296+
warnMsg += "return any output"
297+
logger.warn(warnMsg)
297298

298299
return None
299300

300301
elif (not count or int(count) == 0) and (not stopLimit or stopLimit == 0):
301-
warnMsg = "the SQL query provided does not "
302-
warnMsg += "return any output"
303-
logger.warn(warnMsg)
302+
if not count:
303+
warnMsg = "the SQL query provided does not "
304+
warnMsg += "return any output"
305+
logger.warn(warnMsg)
304306

305307
return None
306308

lib/techniques/error/use.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
320320
stopLimit = 1
321321

322322
elif (not count or int(count) == 0):
323-
warnMsg = "the SQL query provided does not "
324-
warnMsg += "return any output"
325-
logger.warn(warnMsg)
323+
if not count:
324+
warnMsg = "the SQL query provided does not "
325+
warnMsg += "return any output"
326+
logger.warn(warnMsg)
326327

327328
return outputs
328329

lib/techniques/union/use.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,10 @@ def unionUse(expression, unpack=True, dump=False):
261261
stopLimit = 1
262262

263263
elif (not count or int(count) == 0):
264-
warnMsg = "the SQL query provided does not "
265-
warnMsg += "return any output"
266-
logger.warn(warnMsg)
264+
if not count:
265+
warnMsg = "the SQL query provided does not "
266+
warnMsg += "return any output"
267+
logger.warn(warnMsg)
267268

268269
return value
269270

lib/utils/hash.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,16 @@ def attackCachedUsersPasswords():
315315

316316
def attackDumpedTable():
317317
if kb.data.dumpedTable:
318-
infoMsg = "analyzing table dump for possible password hashes"
319-
logger.info(infoMsg)
320-
321318
table = kb.data.dumpedTable
322319
columns = table.keys()
323320
count = table["__infos__"]["count"]
324321

322+
if not count:
323+
return
324+
325+
infoMsg = "analyzing table dump for possible password hashes"
326+
logger.info(infoMsg)
327+
325328
found = False
326329
colUser = ''
327330
colPasswords = set()

0 commit comments

Comments
 (0)