Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # output hostnames, ips, and mac addresses
  2. # to a file using nmap (negating truncation)
  3.  
  4. import os
  5. import sys
  6.  
  7. class nmaput():
  8. def __init__(self):
  9. self.NmapOp(str(sys.argv[1]))
  10.  
  11. def NmapOp(self, cmdArgs):
  12. file = open('nmap-output.txt', 'w')
  13.  
  14. print('Starting Nmap. This make take some time if you have many clients! '
  15. '\n All output will be located at nmap-output.txt.')
  16.  
  17. NmapCommand = os.popen('nmap -sn ' + cmdArgs).read()
  18. sys.stdout = file
  19. print(NmapCommand)
  20.  
  21. file.close()
  22.  
  23. app = nmaput()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement