Created
September 10, 2020 15:07
-
-
Save Sudistark/fb558603a9e1d0cd3b02e4914b109ced to your computer and use it in GitHub Desktop.
Parse the naabu output to nmap for service enumeration
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
import os | |
import subprocess as sp | |
#First getting all the domains | |
os.system('echo "Running naabu[+]......."') | |
os.system("sudo ~/go/bin/naabu -hL all -ports full -o naabu.out") | |
domains = sp.getoutput("cat naabu.out|cut -d ':' -f1|sort -u") | |
domainL = domains.rsplit('\n') | |
print(domainL) | |
os.system("mkdir ip-port") | |
#Finding ips of particular domain | |
for i in domainL: | |
print(i) | |
os.system("cat naabu.out|grep {}|cut -d ':' -f2|tee ./ip-port/{}-ip.out".format(i,i)) | |
for i in domainL: | |
try: | |
os.system("nmap -sC -sV -p `cat ./ip-port/{}-ip.out|tr '\n' ','`69 {} -oN {}-nmap.out -Pn".format(i,i,i)) | |
except: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment