Advertisement
sheldonalman

Network Auditor v0.1

Jul 6th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. #Network Auditor v0.1
  2. #Sheldon Alman
  3. #sheldonalman at gmail.com
  4. #This script runs an nmap scan on the specified IP addresses and outputs
  5. #the results to a XML file that will be compared with a previous scan's results
  6. #using yandiff.
  7.  
  8. import os, time, string
  9. from datetime import date
  10.  
  11. def main():
  12.     network = "192.168.1.1-254"
  13.     today = date.today().isoformat()
  14.     nmap = "nmap -A -PN " + network + " -oX " + "xml/nmap-" + network + "-" + today + ".xml"
  15.     os.system(nmap)
  16.     current =  "/networkaudits/xml/" + os.listdir("/networkaudits/xml")[-1]
  17.     previous =  "/networkaudits/xml/" + os.listdir("/networkaudits/xml")[-2]
  18.     os.system("yandiff --baseline " + previous + " --observed " + current +  " --format xml --output-file diff_files/yandiff-" + network + "-" + today + ".xml -s yandiff.xsl")
  19.     os.system("xsltproc " + current + " -o html/" + "nmap-" + today + ".html")
  20.     os.system("xsltproc diff_files/yandiff-" + network + "-" + today + ".xml" + " -o html/" + "yandiff-" + network + "-" + today + ".html")
  21.  
  22. if __name__ == "__main__":
  23.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement