Skip to content

Instantly share code, notes, and snippets.

@Chan9390
Created March 4, 2020 08:22
Show Gist options
  • Save Chan9390/bb492b06e03528af32ecf0fe1a0e4e91 to your computer and use it in GitHub Desktop.
Save Chan9390/bb492b06e03528af32ecf0fe1a0e4e91 to your computer and use it in GitHub Desktop.
Faster nmap scanning with the help of GNU parallel - Part 1 - https://badshah.io/experiment/faster-nmap-scanning-with-the-help-of-gnu-parallel/
mkdir logs
cat gcp-project-ips.csv | cut -f1 -d, | sort -u | while read project; do mkdir logs/${project}; done
cat gcp-project-ips.csv | while IFS="," read -r project ip; do echo nmap -sT -T5 -Pn -p- -oG logs/${project}/${ip}.gnmap $ip; done > scan-all-ips.out
parallel --jobs 32 < scan-all-ips.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment