Show Open Ports

Written By Glasco  |  General  |  0 Comments

Being able to find open ports are really important. The command to find out used to be:

netstat

But now it has changed to simply ss. In this case, I have add tunpl, This is

t - tcp

u - udp

n - network

l - long output

p - process ip

glasco@klingon:~/Downloads$ ss -tunpl
Netid     State      Recv-Q     Send-Q                              Local Address:Port           Peer Address:Port     Process                                  
udp       UNCONN     0          0                                         0.0.0.0:35784               0.0.0.0:*                                                 
udp       UNCONN     0          0                                   192.168.1.154:3702                0.0.0.0:*         users:(("wsdd",pid=5934,fd=12))         
udp       UNCONN     0          0                                 239.255.255.250:3702                0.0.0.0:*         users:(("wsdd",pid=5934,fd=10))         
udp       UNCONN     0          0                                     224.0.0.251:5353                0.0.0.0:*         users:(("chrome",pid=9741,fd=351))      
udp       UNCONN     0          0                                         0.0.0.0:5353                0.0.0.0:*                                                 
udp       UNCONN     0          0                                         0.0.0.0:5355                0.0.0.0:*                                                 
udp       UNCONN     0          0                                         0.0.0.0:55697               0.0.0.0:*         users:(("firefox",pid=3083,fd=144))     
udp       UNCONN     0          0                                         0.0.0.0:60851               0.0.0.0:*         users:(("firefox",pid=3083,fd=149))     
udp       UNCONN     0          0                                      127.0.0.54:53                  0.0.0.0:*                                                 
udp       UNCONN     0          0                                   127.0.0.53%lo:53                  0.0.0.0:*                                                 
udp       UNCONN     0          0                                       127.0.0.1:323                 0.0.0.0:*                                                 
udp       UNCONN     0          0                                         0.0.0.0:33942               0.0.0.0:*         users:(("wsdd",pid=5934,fd=11))         
udp       UNCONN     0          0              [fe80::cc98:92bc:fd5c:648c]%wlp2s0:3702                   [::]:*         users:(("wsdd",pid=5934,fd=9))          
udp       UNCONN     0          0                                [ff02::c]%wlp2s0:3702                   [::]:*         users:(("wsdd",pid=5934,fd=7))          
udp       UNCONN     0          0                                            [::]:5353                   [::]:*                                                 
udp       UNCONN     0          0                                            [::]:5355                   [::]:*                                                 
udp       UNCONN     0          0                                            [::]:47670                  [::]:*                                                 
udp       UNCONN     0          0                                               *:59161                     *:*         users:(("wsdd",pid=5934,fd=8))          
udp       UNCONN     0          0                                           [::1]:323                    [::]:*                                                 
tcp       LISTEN     0          4096                                    127.0.0.1:631                 0.0.0.0:*                                                 
tcp       LISTEN     0          10                                        0.0.0.0:27500               0.0.0.0:*                                                 
tcp       LISTEN     0          4096                                127.0.0.53%lo:53                  0.0.0.0:*                                                 
tcp       LISTEN     0          4096                                   127.0.0.54:53                  0.0.0.0:*                                                 
tcp       LISTEN     0          4096                                      0.0.0.0:5355                0.0.0.0:*                                                 
tcp       LISTEN     0          128                                       0.0.0.0:22                  0.0.0.0:*                                                 
tcp       LISTEN     0          4096                                        [::1]:631                    [::]:*                                                 
tcp       LISTEN     0          4096                                         [::]:5355                   [::]:*                                                 
tcp       LISTEN     0          128                                          [::]:22                     [::]:*                                                 
glasco@klingon:~/Downloads$

The ports with the state LISTEN are tcp ports like secure shell on tcp port 22.

ss =tunpl

To show open ports on older systems it used to be 'netstat' rather than 'ss' followed by the exact same parameters. (I mention this as there are older government systems still up and running.

>