Last active
October 18, 2021 07:01
-
-
Save darth-hp/2013f2b8d0dac619d14a84c94a2b59d3 to your computer and use it in GitHub Desktop.
poor mans port scanner in bash
This file contains hidden or 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
| PORTS=(80 443);NETWORK="192.168.13"; for i in {1..254}; do IP="$NETWORK.$i"; OPEN=(); for p in ${PORTS[*]};do OPEN+=$(nc -zv4w1 $IP $p >/dev/null 2>&1 && echo " $p"); done; echo "$IP:${OPEN[*]}"; done|grep -E ' [0-9]+' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet scans for http and https ports. Adapt the ports, network (sorry - only C!) and the range to your needs. Only netcat is required