A tool to help you in scans of infrastructure. It scans a bundle of sites and puts the results in a directory for each site analyzed.
By order:
- Create a log file for all the assets
- Check interfaces available in the system
- Create a directory for each active to scan
- Makes a nslookup search
- Makes a traceroute
- Makes a nmap --top-ports scan
- Makes a nmap -sV scan only with the discovered open ports
- Makes a nmap scan for all ports
- Makes a nmap -sC scan only with the discovered open ports
- Makes a nmap --script vuln scane with the discovered open ports
- Make reports:
- All open ports
- All open ports with versions
- CVEs reported by nmap (beta)
./do_recon.sh input_file.txt
1.site1.com
2.site2.org.mx
3.anothersite.com
4.example.com
5.example2.com
6.other.es
LOGFILE=$(date '+%d-%m-%Y')".log"
NEW_LINE="======================================="
- CHECK_INTERFACE=true
- CREATE_DIRECTORY=true
- DO_NSLOOKUP=true
- DO_TRACE=true
- DO_NMAP_TOP_PORTS=true
- DO_NMAP_SV=true
- DO_NMAP_ALL_PORTS=true
- DO_NMAP_SC=true
- DO_NMAP_SCRIPT_VULNES=true
- REPORT_ALL_OPEN_PORTS=true
- NMAP_DELAY=5
- Delay in seconds before to run another nmap scan
- NMAP_TIMEOUT=0
- Timeout 0 = No timeout. Any else, timeout in seconds
- TOP_PORTS=1000
- MAX_RETRIES=1
- MIN_RATE=500
- T=-T3
- -T0, -T1, -T2, -T3, -T4, -T5
- Default -T3
- nmap
- traceroute
- nslookup
To install
sudo apt update && sudo apt install nmap traceroute dnsutils
# $DO_NMAP_TOP_PORTS
timeout $NMAP_TIMEOUT nmap --vv $T -Pn --open --top-ports $TOP_PORTS --max-retries $MAX_RETRIES -oA $FILE"_"$TOP_PORTS $SITE
# $DO_NMAP_SV
timeout $NMAP_TIMEOUT nmap --vv $T -Pn --open -sV --max-retries $MAX_RETRIES -p $PORTS -oA $FILE"_sv" $SITE
# $DO_NMAP_ALL_PORTS
timeout $NMAP_TIMEOUT nmap --vv $T -Pn --open -p- --max-retries $MAX_RETRIES --min-rate $MIN_RATE -oA $FILE"_all_ports" $SITE
# $DO_NMAP_SC
timeout $NMAP_TIMEOUT nmap --vv $T -Pn --open -sV -sC --max-retries $MAX_RETRIES -p $PORTS -oA $FILE"_sc" $SITE
# $DO_NMAP_SCRIPT_VULNES
timeout $NMAP_TIMEOUT nmap --vv $T -Pn --open -sV --script vuln --max-retries $MAX_RETRIES -p $PORTS -oA $FILE"_script_vulnes" $SITE