Port number and service aren't connected!
If a process has a port open, the kernel knows about it. Reading the lsof source might give you a hint. However, knowing that PID ### has TCP Port ## open, plus all the information you can get from /proc/### will NOT let you know what service the process is providing. One can write a simple program, call it "telnetd", run it on port 8080 (or port 80, if you're root).
|