Created
November 14, 2023 23:59
-
-
Save andreagalle/aa4edfb829ead61e1f97e8904c08aa06 to your computer and use it in GitHub Desktop.
scan open ports given IP address
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
#!/bin/bash | |
IP=$1 | |
first_port=$2 | |
last_port=$3 | |
function scanner | |
{ | |
for ((port=$first_port; port<=$last_port; port++)) | |
do | |
(echo >/dev/tcp/$IP/$port)> /dev/null 2>&1 && echo "$port open" #|| echo "$port closed" | |
done | |
} | |
scanner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment