Last active
July 24, 2019 12:18
-
-
Save andcam/f9a2777176cb287f42d63da56cfdcd7f to your computer and use it in GitHub Desktop.
various methods to find and list open ports
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
# tcp ports and services | |
egrep -w '(80|22|443)/tcp' /etc/services | |
# netstat list of open ports | |
sudo netstat -tulp | grep LISTEN | |
# -t – List all TCP ports on Linux | |
# -u – List all UDP ports on Linux | |
# -l – Show only listening sockets/ports | |
# -p – Show process names (PID) using sockets/ports in Linux | |
# -n – Do not try to resolve service names (speed up option) using /etc/resolv.conf file | |
sudo ss -tulpn | |
sudo lsof -i | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment