Skip to content

Instantly share code, notes, and snippets.

@nil0x42
Last active January 12, 2022 04:35
Show Gist options
  • Save nil0x42/1fe80faa4e04f30efec1b12718b00aba to your computer and use it in GitHub Desktop.
Save nil0x42/1fe80faa4e04f30efec1b12718b00aba to your computer and use it in GitHub Desktop.
"Quickly" scan all ports for a big list of IPs with nmap, while avoiding being banned,
#!/bin/bash
# by @nil0x42
shuf IP-LIST.TXT > /tmp/ips.txt # randomize ip-list
# for each port (in random order):
for i in {1..65535}; do echo $i; done | shuf | while read port; do
# scan single port on every IP from randomized ip-list
nmap -sS -PN -n --max-retries=0 --max-rtt-timeout=1000ms \
--min-rate=10000 --min-hostgroup=4096 -iL /tmp/ips.txt -p $port
done
# details here: https://twitter.com/nil0x42/status/1432605540220297219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment