Last active
October 6, 2019 01:06
-
-
Save loonaticx/509d6bdd01ac349a66c0332ec3687a67 to your computer and use it in GitHub Desktop.
nmaput
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment