6/11/2023 0 Comments Pid 0 tcpview# cat /proc/net/tcp | head -1 cat /proc/net/tcp | grep :0050 We will need to filter for source port 0x0050 (hexadecimal for port 80 and zero padded to 4 digits) and the state must be 0x0A – LISTEN state. For TCP connections, we will need to analyse the /proc/net/tcp file. Next, we will need to retrieve information from the proc filesystem. So, port 80 becomes 0x50 (in hexadecimal). First, we convert the port number from decimal to hexadecimal. Now, let’s say that we want to find out the process that is listening on port 80. Proto Recv-Q Send-Q Local Address Foreign Address State Get the TCP network connections list by running the netstat command.Īctive Internet connections (servers and established) ![]() How do you find the process that is listening on a port just by using the Linux Proc FS or /proc filesystem?īefore getting your hands dirty, make sure that you have root access to the Linux system. ![]() Let’s say you have a socket that is listening on a particular port.
0 Comments
Leave a Reply. |