Last active
November 14, 2023 03:17
-
-
Save kizzx2/25caaa5c6582bf63627271df804cbb8e to your computer and use it in GitHub Desktop.
Bash one line port scanner using nc
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
# Creates 993 nc processes. Returns in about 1 minute max | |
ip=127.0.0.1 | |
b(){ for i in {0..992};do nc $ip -w1 -vz $((i*66+1))-$((i*66+66>65535?65535:i*66+66)) 2>&1|egrep 'open|succeed'&done;wait;} 2>/dev/null;b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Caveats:
nc
processes created, you can tweak992
and66
above to wait longer with less processes