🖥️ss

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the ss command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███████╗███████╗
#                ██╔════╝██╔════╝
#                ███████╗███████╗
#                ╚════██║╚════██║
#                ███████║███████║
#                ╚══════╝╚══════╝
                                

# The 'ss' stands for socket statistics. The command investigates the socket and shows information similar to netstat command. It can display more TCP and state informations than other tools.
                                
# Utility to investigate sockets

Args
-4/-6 list ipv4/ipv6 sockets
-n numeric addresses instead of hostnames
-l list listing sockets
-u/-t/-x list udp/tcp/unix sockets
-p Show process(es) that using socket

# show all listing tcp sockets including the corresponding process
ss -tlp

# show all sockets connecting to 192.168.2.1 on port 80
ss -t dst 192.168.2.1:80

# show all ssh related connection
ss -t state established '( dport = :ssh or sport = :ssh )'

# Display timer information
ss -tn -o

# Filtering connections by tcp state
ss -t4 state established

#Find all clients connected to HTTP or HTTPS ports
#It finds, specifically, the connections to the HTTP and HTTPS ports as source ports. You can check for destination ports as well. 
ss -o state established '( dport = :http or sport = :https )'
#This is sample output - yours may be different.
$ ss -o state established '( sport = :http or sport = :https )'
        # Recv-Q Send-Q                             Local Address:Port                                                                           Peer Address:Port   
        # 0      0                                  123.123.123.123:https                                                                         31.14.72.45:9776    
        # 0      0                                  123.123.123.123:http                                                                          67.204.23.12:55646   

# Find all clients connected to HTTP or HTTPS ports - It finds, specifically, the connections to the HTTP and HTTPS ports as source ports. You can check for destination ports as well.
ss -o state established '( dport = :http or sport = :https )'
    # Sample output
	    # $ ss -o state established '( sport = :http or sport = :https )'
	     # Recv-Q Send-Q     Local Address:Port               Peer Address:Port   
	     # 0      0          123.123.123.123:https         	  31.14.72.45:9776    
	     # 0      0          123.123.123.123:http             67.204.23.12:55646   

# Show all current listening programs by port and pid with SS instead of netstat
ss -plunt

#==============================##==============================#
# CMD SS
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░