else: print '[*] No report files found to open, perhaps no hosts were successful' return False if __name__ == "__main__": if len(sys.argv) < 2: print 'Recategorize a previously completed EyeWitness scan to account for updates. This can take a while!\n' print '[*] Usage: python Recategorize.py <dbpath>' print 'DBPath should point to the ew.db file in your EyeWitness output folder' sys.exit() db_path = sys.argv[1] if not os.path.isfile(db_path): print '[*] No valid db path provided' sys.exit() dbm = DB_Manager(db_path) dbm.open_connection() cli_parsed = dbm.get_options() cli_parsed.d = os.path.dirname(db_path) cli_parsed.results = 50 files = glob.glob(cli_parsed.d + '/report*.html') for f in files: os.remove(f) results = dbm.recategorize() print 'Writing report' sort_data_and_write(cli_parsed, results) newfiles = glob.glob(cli_parsed.d + '/report.html') if open_file_input(cli_parsed): for f in newfiles: webbrowser.open(f) sys.exit()
print '[*] No report files found to open, perhaps no hosts were successful' return False if __name__ == "__main__": if len(sys.argv) < 3: print 'Search a previously completed EyeWitness scan (HTTP page title/source)\n' print '[*] Usage: python Search.py <dbpath> <searchterm>' print 'DBPath should point to the ew.db file in your EyeWitness output folder' sys.exit() db_path = sys.argv[1] if not os.path.isfile(db_path): print '[*] No valid db path provided' sys.exit() search_term = sys.argv[2] dbm = DB_Manager(db_path) dbm.open_connection() results = dbm.search_for_term(search_term) if len(results) == 0: print 'No results found!' sys.exit() else: print 'Found {0} Results!'.format(str(len(results))) cli_parsed = dbm.get_options() cli_parsed.results = 25 oldfiles = glob.glob(os.path.join(cli_parsed.d, "*search*.html")) for f in oldfiles: os.remove(f) search_report(cli_parsed, results, search_term) newfiles = glob.glob(os.path.join(cli_parsed.d, "search.html")) if open_file_input(cli_parsed):
except ValueError: print("Please respond with y or n", end=' ') else: print( '[*] No report files found to open, perhaps no hosts were successful' ) return False if __name__ == "__main__": if len(sys.argv) < 2: print( 'Create a file containing urls for splash pages and 404s to feed to Mikto\n' ) print('[*] Usage: python MiktoList.py <dbpath> <outfile>') print( 'DBPath should point to the ew.db file in your EyeWitness output folder' ) sys.exit() db_path = sys.argv[1] outfile = sys.argv[2] if not os.path.isfile(db_path): print('[*] No valid db path provided') sys.exit() dbm = DB_Manager(db_path) dbm.open_connection() results = dbm.get_mikto_results() with open(outfile, 'w') as f: f.writelines([x.remote_system + '\n' for x in results]) print('Wrote {0} URLs to {1}'.format(len(results), outfile))
print('[*] No report files found to open, perhaps no hosts were successful') return False if __name__ == "__main__": if len(sys.argv) < 3: print('Search a previously completed EyeWitness scan (HTTP page title/source)\n') print('[*] Usage: python Search.py <dbpath> <searchterm>') print('DBPath should point to the ew.db file in your EyeWitness output folder') sys.exit() db_path = sys.argv[1] if not os.path.isfile(db_path): print('[*] No valid db path provided') sys.exit() search_term = sys.argv[2] dbm = DB_Manager(db_path) dbm.open_connection() results = dbm.search_for_term(search_term) if len(results) == 0: print('No results found!') sys.exit() else: print('Found {0} Results!'.format(str(len(results)))) cli_parsed = dbm.get_options() cli_parsed.results = 25 cli_parsed.d = os.path.dirname(db_path) oldfiles = glob.glob(os.path.join(cli_parsed.d, "*search*.html")) for f in oldfiles: os.remove(f) search_report(cli_parsed, results, search_term) newfiles = glob.glob(os.path.join(cli_parsed.d, "search.html"))
print 'Would you like to open the report now? [Y/n]', while True: try: response = raw_input().lower() if response is "": return True else: return strtobool(response) except ValueError: print "Please respond with y or n", else: print '[*] No report files found to open, perhaps no hosts were successful' return False if __name__ == "__main__": if len(sys.argv) < 2: print 'Create a file containing urls for splash pages and 404s to feed to Mikto\n' print '[*] Usage: python MiktoList.py <dbpath> <outfile>' print 'DBPath should point to the ew.db file in your EyeWitness output folder' sys.exit() db_path = sys.argv[1] outfile = sys.argv[2] if not os.path.isfile(db_path): print '[*] No valid db path provided' sys.exit() dbm = DB_Manager(db_path) dbm.open_connection() results = dbm.get_mikto_results() with open(outfile, 'w') as f: f.writelines([x.remote_system + '\n' for x in results]) print 'Wrote {0} URLs to {1}'.format(len(results), outfile)