These tools will help you identify which programs are opening what ports on the system.
1. lsof | grep ‘IPv.’
lsof shows the list of open files, piping it through grep and searching for IPv will give you a list of ports used by a program
lsof -i TCP:<PORT>
where PORT is the one you need to know about the program behind it.
2. netstat -anp
Should display open ports, machines connected to the ports as well as which application has that port open.
If you know of any other ways let me know.
– Suramya