Commits

gbrindisi committed bed11af

Improved cli

  • Participants
  • Parent commits 529c6d0
  • Branches clint-integration

Comments (0)

Files changed (2)

File core/engine.py

                 js.printResult()
 
     def _crawlTarget(self):
-        print "[+] Crawling links..."
+        print "\n[+] Crawling links..."
 
         # Build a queue and start crawlers 
         queue = self._getTargetsQueue()
             try:
                 if queue.empty() is True:
                     break
-                sys.stdout.write("\r    Remaining targets: %s" % queue.qsize())
-                sys.stdout.flush()
+                #x sys.stdout.write("\r    Remaining targets: %s" % queue.qsize())
+                #sys.stdout.flush()
             except KeyboardInterrupt:
-                print "[X] Interrupt! Killing threads..."
+                print colored.red("\n[X] Interrupt! Killing threads...")
                 queue = Queue.Queue()
                 break
         
         results = set(results)
         
         if errors:
-            print "[X] Crawl Errors:"
+            print " |- " + colored.red("CRAWL ERRORS!")
             for ek, ev in errors.iteritems():
-                print "    %s times %s" % (len(ev), ek)
-
-        print "[-] Found %s unique targets." % len(results)
-        
+                print " ||-- %s times %s" % (len(ev), ek)
+        if len(results) > 0:
+            print " |- " + colored.green("SUCCESS: ") +  "Found %s unique targets." % len(results)
+        else:
+            print " |- " + colored.yellow("WARNING: ") + "No new targets found."
 
         # Add targets
         for t in results:
             self.targets.append(t)
 
     def _crawlForms(self):
-        print "[+] Crawling for forms..."
+        print "\n[+] Crawling for forms..."
          
         queue = self._getTargetsQueue()
         crawlers = []
             try:
                 if queue.empty() is True:
                     break
-                sys.stdout.write("\r    Remaining targets: %s" % queue.qsize())
-                sys.stdout.flush()
+                #sys.stdout.write("\r    Remaining targets: %s" % queue.qsize())
+                #sys.stdout.flush()
             except KeyboardInterrupt:
-                print "[X] Interrupt! Killing threads..."
+                print "\n[X] Interrupt! Killing threads..."
                 queue = Queue.Queue()
                 break
         
         results = set(results)
 
         if errors:
-            print "[X] Crawl Errors:"
+            print " |- " + colored.red("CRAWL ERRORS!")
             for ek, ev in errors.iteritems():
-                print "    %s times %s" % (len(ev), ek)
+                print " ||- %s times %s" % (len(ev), ek)
 
-        print "[-] Found %s unique forms." % len(results)
+        if len(results) > 0:
+            print " |- " + colored.green("SUCCESS: ") + "Found %s unique forms." % len(results)
+        else:
+            print " |- " + colored.yellow("WARNING: ") + "No forms found."
 
         # Add targets
         for t in results:
         while True:
             try:
                 if queue.empty() is True:
-                    print "\n"
                     break
                 sys.stdout.write("\r    Remaining urls: %s" % queue.qsize())
                 sys.stdout.flush()
             self.results.append(r)
 
         if errors:
-            print "[X] Scan Errors:"
+            print " |- " + colored.red("SCAN ERRORS!")
             for ek, ev in errors.iteritems():
-                print "    %s times %s" % (len(ev), ek)
+                print " ||- %s times %s" % (len(ev), ek)
 
     def _scanDOMTargets(self):
         print "\n[+] Start DOM scanning (%s threads)" % self.getOption('threads')
         while True:
             try:
                 if queue.empty() is True:
-                    print "\n"
                     break
-                sys.stdout.write("\r    Remaining urls: %s" % queue.qsize())
-                sys.stdout.flush()
+                #sys.stdout.write("\r    Remaining urls: %s" % queue.qsize())
+                #sys.stdout.flush()
             except KeyboardInterrupt:
                 print "[X] Interrupt! Killing threads..."
                 queue = Queue.Queue()
                 self.javascript.append(r)
 
         if errors:
-            print "[X] Scan Errors:"
+            print " |- " + colored.red("SCAN ERRORS!")
             for ek, ev in errors.iteritems():
-                print "    %s times %s" % (len(ev), ek)
+                print " ||- %s times %s" % (len(ev), ek)
        
 
     def start(self):         

File xsssniper.py

             exit()
 
     # Build a first target
-    print "[+] Target: %s" % options.url
+    print "[+] TARGET: %s" % options.url
 
     if options.post is True:
+        print " |- METHOD: POST"
         if options.post_data is not None:
             print " |- POST data: %s" % options.post_data
             t = Target(options.url, method = 'POST', data = options.post_data)
             print " |- " + colored.red("ERROR: ") + "No POST data specified: use --data"
             exit()
     else:
+        print " |- METHOD: GET"
         t = Target(options.url)
 
     # Build a scanner