| 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. | #!/usr/bin/python #This script helps you scan a list of sites with nikto. #It will create a file in your output dir for each site in #your list with the site name. Put this script in the same #dir as nikto.pl and change your OUTPUT_PATH below. #http://www.darkc0de.com #d3hydr8[at]gmail[dot]com #Change this first!!! #------------------------------------------ OUTPUT_PATH = "/home/d3hydr8/tools/nikto/output" #------------------------------------------ import commands, sys, getopt, StringIO, re, string, os def niktoscan(site): #Change your nikto options here. command = "perl nikto.pl -host "+site+" -Cgidirs all" nikout = StringIO.StringIO(commands.getstatusoutput(command)[1]).readlines() print "[+] Writing Lines:",len(nikout) path = os.path.join(OUTPUT_PATH, site+".txt") output = open(path, "a") for line in nikout: output.writelines(line+"\n") output.close() #................................................ print "\nd3hydr8[at]gmail[dot]com NikListScan v1.0" print "------------------------------------------" if len(sys.argv) != 2: print "\nUsage: ./niklistscan.py <site_list>\n" sys.exit(1) print "\n[+] Creating output folder",OUTPUT_PATH try: os.mkdir(OUTPUT_PATH) except(OSError): print "[-] Failure creating dir, might already exist." pass sites = open(sys.argv[1], "r").readlines() print "[+] Sites Loaded:",len(sites),"\n" for site in sites: site = site.replace("\n","") print "-"*35 print "\n[+] Scanning:",site niktoscan(site.replace("http://","")) print "\n[+] Done\n" |