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

Skip to content

Commit 89d2c7c

Browse files
committed
minor update
1 parent abb4018 commit 89d2c7c

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

lib/core/dump.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ def dbTableValues(self, tableValues):
411411
rtable.beginTransaction()
412412

413413
if count > TRIM_STDOUT_DUMP_SIZE:
414-
warnMsg = "console output will be trimmed "
415-
warnMsg += "due to the large table size"
414+
warnMsg = "console output will be trimmed to "
415+
warnMsg += "last %d rows due to " % TRIM_STDOUT_DUMP_SIZE
416+
warnMsg += "large table size"
416417
logger.warning(warnMsg)
417418

418419
for i in xrange(count):

lib/core/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,6 @@
431431

432432
# On huge tables there is a considerable slowdown if every row retrieval requires ORDER BY (most noticable in table dumping using ERROR injections)
433433
SLOW_ORDER_COUNT_THRESHOLD = 10000
434+
435+
# Give up on hash recognition if nothing was found in first given number of rows
436+
HASH_RECOGNITION_QUIT_THRESHOLD = 10000

lib/utils/hash.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
from lib.core.settings import DUMMY_USER_PREFIX
6363
from lib.core.settings import GENERAL_IP_ADDRESS_REGEX
6464
from lib.core.settings import HASH_MOD_ITEM_DISPLAY
65+
from lib.core.settings import HASH_RECOGNITION_QUIT_THRESHOLD
6566
from lib.core.settings import IS_WIN
6667
from lib.core.settings import ITOA64
6768
from lib.core.settings import PYVERSION
@@ -322,6 +323,7 @@ def attackDumpedTable():
322323
columns = table.keys()
323324
count = table["__infos__"]["count"]
324325

326+
found = False
325327
colUser = ''
326328
colPasswords = set()
327329
attack_dict = {}
@@ -332,6 +334,9 @@ def attackDumpedTable():
332334
break
333335

334336
for i in xrange(count):
337+
if not found and i > HASH_RECOGNITION_QUIT_THRESHOLD:
338+
break
339+
335340
for column in columns:
336341
if column == colUser or column == '__infos__':
337342
continue
@@ -342,6 +347,8 @@ def attackDumpedTable():
342347
value = table[column]['values'][i]
343348

344349
if hashRecognition(value):
350+
found = True
351+
345352
if colUser and i < len(table[colUser]['values']):
346353
if table[colUser]['values'][i] not in attack_dict:
347354
attack_dict[table[colUser]['values'][i]] = []

0 commit comments

Comments
 (0)