Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # output hostnames, ips, and mac addresses
- # to a file using nmap (negating truncation)
- import os
- import sys
- class nmaput():
- def __init__(self):
- self.NmapOp(str(sys.argv[1]))
- def NmapOp(self, cmdArgs):
- file = open('nmap-output.txt', 'w')
- print('Starting Nmap. This make take some time if you have many clients! '
- '\n All output will be located at nmap-output.txt.')
- NmapCommand = os.popen('nmap -sn ' + cmdArgs).read()
- sys.stdout = file
- print(NmapCommand)
- file.close()
- app = nmaput()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement