PCP script to find open TCP ports and PIDs related in Solaris

May 12, 2009 · Filed Under Networking, Solaris 10, Solaris 8, Solaris 9, security 

PCP is a very useful security and adminitration script that can help you quickly find Processes (PIDs) having particular TCP Port(s) open, TCP ports open by specific PIDs or even list all the TCP Ports open by all PIDs running on your system.


The PCP script works on Solaris 10/9/8 and can be downloaded from here. Simply save the pcp.txt file to your Solaris Server as a Shell scripts (say pcp.sh) and change permissions to execute.

# chmod 755 pcp.sh

PIDs for TCP Port

Run PCP with “-p” option to show the PIDs of processes having a TCP port (say Port 22)

pcp1

For instance, to find PIDs opening TCP port 22.

TCP Ports open by PIDs

Run PCP with “-P” option to show the TCP ports open by specific PID

For instance, here I try to find the TCP ports open by PID 18805

pcp3

All PIDs for all open TCP Ports

Use the “-a” option to list all TCP ports open with all the PIDs

pcp2

Comments

3 Responses to “PCP script to find open TCP ports and PIDs related in Solaris”

  1. Manu on May 14th, 2009 7:06 am

    Nice tool,
    thanks for the hint!

  2. abdulrahman on May 20th, 2009 9:19 am

    how do i learn ur aplication on line. thanx

  3. Jhaastrup on July 15th, 2009 4:02 am

    Good tool to use.
    What is the difference between PCP scripts and PS commands?

Leave a Reply