Skip to content

Instantly share code, notes, and snippets.

@loonaticx
Last active October 6, 2019 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loonaticx/509d6bdd01ac349a66c0332ec3687a67 to your computer and use it in GitHub Desktop.
Save loonaticx/509d6bdd01ac349a66c0332ec3687a67 to your computer and use it in GitHub Desktop.
nmaput
# 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