Created
May 1, 2016 19:38
-
-
Save JoeyBurzynski/f3d927b51dffd5e73e6aeb4241892155 to your computer and use it in GitHub Desktop.
Command Line: Determine If Port Is Open & Listening
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
netstat -an |grep 445 |grep LISTEN | |
# From a bash script how can I quickly find out whether a port 445 is open/listening on a server. | |
# | |
# I have tried a couple of options, but I want something quick: | |
# 1. lsof -i :445 (Takes seconds) | |
# 2. netstat -an |grep 445 |grep LISTEN (Takes seconds) | |
# 3. telnet (it doesn't return) | |
# 4. nmap, netcat are not available on the server | |
# | |
# It will be nice to know of a way that doesn't enumerate first and greps after that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment