Skip to content

Instantly share code, notes, and snippets.

@Sudistark
Created September 10, 2020 15:07
Show Gist options
  • Save Sudistark/fb558603a9e1d0cd3b02e4914b109ced to your computer and use it in GitHub Desktop.
Save Sudistark/fb558603a9e1d0cd3b02e4914b109ced to your computer and use it in GitHub Desktop.
Parse the naabu output to nmap for service enumeration
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