1

I am trying to debug a problem with a apache server, wherein I need to find the application that uses a particular port number. I tried using netstat, but didn't help.

The scenario is that I am using mitmproxy and SSL is also involved, and I find in wireshark a packet where the source and destination IPs are same and are trying to do SSL, but have different port numbers (I can't understand why this packet exists) . I need to find who controlled those port numbers at that instance, so I could possibly find which application is causing this problem.

Can anyone suggest a way ?

Jake
  • 111

1 Answers1

0

Try lsof -i which should list the ports being used and their associated processes. You can also check for a specific port with lsof -i [TCP/UDP]:[Port number]. As an example, if I wanted to check what was running on port 22, you could run lsof -i TCP:22 to see.

EDIT: What did netstat return? Because if I run netstat -anp --tcp --udp | grep LISTEN it returns the processes listening on various ports.

dan
  • 101