Created
April 1, 2017 07:33
-
-
Save hplc/fb74cb442ed4f2c159a68a279049be64 to your computer and use it in GitHub Desktop.
Bash pipe TCP port scanner.
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
#!/bin/sh | |
# Worked in CentOS 7. | |
for ip in 10.1.41.106 10.1.41.158 10.1.41.149 10.1.41.104 10.1.41.145 10.1.41.122 10.1.41.113 10.1.41.223 10.1.41.200; do | |
timeout 1 bash -c "echo >/dev/tcp/${ip}/22" && | |
echo "$ip SSH is OPEN" || | |
echo "$ip SSH is $(tput setaf 1)CLOSED$(tput sgr0)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment