Created
November 30, 2016 09:13
-
-
Save n1mh/43843ad5e57c556657c3b6315441d53a to your computer and use it in GitHub Desktop.
checking open ports using bash
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/bash | |
# adapted from: | |
# https://stackoverflow.com/questions/9609130/quick-way-to-find-if-a-port-is-open-on-linux#9609247 | |
# exec 6<>/dev/tcp/ip.addr.of.server/445 | |
# echo -e "GET / HTTP/1.0\n" >&6 | |
# cat <&6 | |
( exec 6<>/dev/tcp/127.0.0.1/22 && echo 'ssh open!' )|| echo 'ssh closed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment