Commits

WebBreacher committed cfca996

Added verbose flag

Comments (0)

Files changed (1)

     parser.add_option('-x', help='xml input mode. path to Nessus/Nmap XML file.', dest='xml_file', type='string', action='store')
     parser.add_option('-s', help='single input mode. path to target, remote URL or local path.', dest='target', type='string', action='store')
     parser.add_option('-t', help='socket timeout in seconds. default is 8 seconds.', dest='timeout', type='int', action='store')
+    parser.add_option('-v', help='verbose mode', dest='verbose', action='store_true', default=False)
     (opts, args) = parser.parse_args()
 
     # process options
     tot = len(targets) * 2
     try:
         for target in targets:
-            #print '[*] %s' % (target)
-            printProgress(cnt, tot)
+            if opts.verbose:
+                printProgress(cnt, tot, target)
+            else:
+                printProgress(cnt, tot)
             filename = '%s.png' % re.sub('\W','',target)
             filepath = '%s/%s' % (directory, filename)
             getCapture(target, filepath, timeout)
             cnt += 1
-            printProgress(cnt, tot)
             target_data = {}
             target_data['url'] = target
             target_data['path'] = filename
     if stderr: response += str(stderr)
     return proc.returncode, response.strip()
 
-def printProgress(cnt, tot):
+def printProgress(cnt, tot, target=''):
     percent = 100 * float(cnt) / float(tot)
-    sys.stdout.write('[%-40s] %d%%\r' % ('='*int(float(percent)/100*40), percent))
+    sys.stdout.write('[%-40s] %d%%   %s\r' % ('='*int(float(percent)/100*40), percent, target))
     sys.stdout.flush()
     return ''