Skip to content

Instantly share code, notes, and snippets.

@ikuamike
Last active June 4, 2020 07:55
Show Gist options
  • Save ikuamike/72d504f12c34f5d1ab7c531a6931ddda to your computer and use it in GitHub Desktop.
Save ikuamike/72d504f12c34f5d1ab7c531a6931ddda to your computer and use it in GitHub Desktop.
nmap.sh
#!/bin/bash
# automate quick port scan to feed thorough port scan with list of ports
mkdir -p nmap
sudo nmap -n -Pn -sS -v -p- --min-rate=1000 --open -oN nmap/$2_quick_tcp $1 | grep -v "delay"
ports=`grep -v nmap nmap/$2_quick_tcp | grep open | cut -d " " -f 1 | cut -d "/" -f 1 | tr '\n' ','| head -c -1`
nmap -n -Pn -sC -sV -p $ports -oA nmap/$2_full_tcp $1
#sudo nmap -sS -p- --min-rate=1000 $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment