Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Network Auditor v0.1
- #Sheldon Alman
- #sheldonalman at gmail.com
- #This script runs an nmap scan on the specified IP addresses and outputs
- #the results to a XML file that will be compared with a previous scan's results
- #using yandiff.
- import os, time, string
- from datetime import date
- def main():
- network = "192.168.1.1-254"
- today = date.today().isoformat()
- nmap = "nmap -A -PN " + network + " -oX " + "xml/nmap-" + network + "-" + today + ".xml"
- os.system(nmap)
- current = "/networkaudits/xml/" + os.listdir("/networkaudits/xml")[-1]
- previous = "/networkaudits/xml/" + os.listdir("/networkaudits/xml")[-2]
- os.system("yandiff --baseline " + previous + " --observed " + current + " --format xml --output-file diff_files/yandiff-" + network + "-" + today + ".xml -s yandiff.xsl")
- os.system("xsltproc " + current + " -o html/" + "nmap-" + today + ".html")
- os.system("xsltproc diff_files/yandiff-" + network + "-" + today + ".xml" + " -o html/" + "yandiff-" + network + "-" + today + ".html")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement