Last active
September 14, 2020 00:59
-
-
Save oliverdaff/8968131cb723a462114716280b678f07 to your computer and use it in GitHub Desktop.
Use nmap to find open ports fast and then run a detailed scans on the returned ports
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
#!/bin/bash | |
# Use nmap to find open ports fast and then run a detailed scans on the returned ports | |
if [ -z "$1" ] | |
then | |
echo "__nmap_fast__" | |
echo "Usage: ./nmap_fast TARGET_HOSTNAME" | |
fi | |
TARGET_HOSTNAME=$1 | |
nmap -vv -max-retries 0 --min-parallelism 4500 ${TARGET_HOSTNAME} -p- \ | |
| awk -F'[ /]' '/Discovered open port/{print $4}' \ | |
| paste -s -d, - \ | |
| xargs -I '{}' nmap -T4 -p {} -A ${TARGET_HOSTNAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment