Commits

Tim Tomes committed 13bb8b7 Merge

Merged in zgrace/peepingtom (pull request #6)

Add output directory option

Comments (0)

Files changed (1)

     parser.add_argument('-x', help='xml input mode. path to Nessus/Nmap XML file.', dest='xml_file', action='store')
     parser.add_argument('-s', help='single input mode. path to target, remote URL or local path.', dest='target', action='store')
     parser.add_argument('-t', help='socket timeout in seconds. default is 8 seconds.', dest='timeout', type=int, action='store')
+    parser.add_argument('-o', help='output directory', dest='output', action='store')
     parser.add_argument('-v', help='verbose mode', dest='verbose', action='store_true', default=False)
     parser.add_argument('-b', help='open results in browser', dest='browser', action='store_true', default=False)
     opts = parser.parse_args()
         return
     timeout = opts.timeout if opts.timeout else 8
 
-    print '[*] Analyzing %d targets.' % (len(targets))
-
     # setup data storage location
-    random.seed()
-    directory = time.strftime('%y%m%d_%H%M%S', time.localtime()) + '_%04d' % random.randint(1, 10000)
+    if opts.output:
+        directory = opts.output
+        if os.path.isdir(directory):
+            print '[!] Output directory already exists: \'%s\'' % directory
+            return
+    else:
+        random.seed()
+        directory = time.strftime('%y%m%d_%H%M%S', time.localtime()) + '_%04d' % random.randint(1, 10000)
+
+    print '[*] Analyzing %d targets.' % (len(targets))
     print '[*] Storing data in \'%s/\'' % (directory)
     os.mkdir(directory)
     report = 'peepingtom.html'