Netstat : Master it with these 6 steps
Netstat is a command line utility that can be used to list out all the network connections on a system. It lists out all the tcp, udp socket connections and the unix socket connections. Netstat also displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc. In this guide, we will see how to use this tool to gather information about network connections and open ports on a system. Step 01 : List all connections with netstat To view all the network connections, simply run the following command #netstat -a Step 02 : View network interfaces with netstat You can view the network interfaces in your system by using the following command #netstat -i To get a more simple and readable output from the above command, use the -e option along with -i #netstat -ie Step 03 : View only active connections You can get the list of already active connections by using the grep along with netstat command. These connections are tagging ”ESTABLISHED” state #netstat -atnp | grep ESTA Step 04 : List only TCP or UDP connections Use the -t option along with netstat command to list only tcp connections. #netstat -at Use the -u option to list only udp connections. #netstat -au Step 05 : Check open ports that are listening to a service In Linux, Services are using...
Read More