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

Skip to content

Commit bf55449

Browse files
committed
Minor style update
1 parent 9bdcb11 commit bf55449

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

lib/core/option.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import string
1515
import sys
1616
import threading
17+
import time
1718
import urllib2
1819
import urlparse
1920

@@ -580,10 +581,16 @@ def _findPageForms():
580581
page, _ = Request.queryPage(content=True)
581582
findPageForms(page, conf.url, True, True)
582583
else:
583-
for target in getFileItems(conf.bulkFile):
584+
targets = getFileItems(conf.bulkFile)
585+
for i in xrange(len(targets)):
584586
try:
587+
target = targets[i]
585588
page, _, _= Request.getPage(url=target.strip(), crawling=True, raise404=False)
586589
findPageForms(page, target, False, True)
590+
591+
if conf.verbose in (1, 2):
592+
status = '%d/%d links visited (%d%%)' % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
593+
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
587594
except Exception, ex:
588595
errMsg = "problem occured while searching for forms at '%s' ('%s')" % (target, ex)
589596
logger.error(errMsg)

lib/core/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def smokeTest():
7373
retVal = False
7474

7575
count += 1
76-
status = '%d/%d (%d%s) ' % (count, length, round(100.0*count/length), '%')
76+
status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length))
7777
dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
7878

7979
clearConsoleLine()

lib/techniques/blind/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def blindThread():
412412
if conf.verbose in (1, 2) and not showEta:
413413
_ = count - firstChar
414414
output += '_' * (min(length, conf.progressWidth) - len(output))
415-
status = ' %d/%d (%d%s)' % (_, length, round(100.0 * _ / length), '%')
415+
status = ' %d/%d (%d%%)' % (_, length, round(100.0 * _ / length))
416416
output += status if _ != length else " " * len(status)
417417

418418
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), filterControlChars(output)))

lib/techniques/brute/use.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def tableExistsThread():
101101
dataToStdout(infoMsg, True)
102102

103103
if conf.verbose in (1, 2):
104-
status = '%d/%d items (%d%s)' % (threadData.shared.count, threadData.shared.limit, round(100.0*threadData.shared.count/threadData.shared.limit), '%')
104+
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
105105
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
106106

107107
kb.locks.io.release()
@@ -192,7 +192,7 @@ def columnExistsThread():
192192
dataToStdout(infoMsg, True)
193193

194194
if conf.verbose in (1, 2):
195-
status = '%d/%d items (%d%s)' % (threadData.shared.count, threadData.shared.limit, round(100.0*threadData.shared.count/threadData.shared.limit), '%')
195+
status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
196196
dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
197197

198198
kb.locks.io.release()

lib/utils/crawler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def crawlThread():
9696

9797
if conf.verbose in (1, 2):
9898
threadData.shared.count += 1
99-
status = '%d/%d links visited (%d%s)' % (threadData.shared.count, threadData.shared.length, round(100.0*threadData.shared.count/threadData.shared.length), '%')
99+
status = '%d/%d links visited (%d%%)' % (threadData.shared.count, threadData.shared.length, round(100.0 * threadData.shared.count / threadData.shared.length))
100100
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
101101

102102
threadData.shared.deeper = set()

0 commit comments

Comments
 (0)