Linux 101 : Discovering the services, the open ports and the running machines on a network

To check the services that are running on our Linux system, we could use the "systemctl" command, it also displays the different statuses of these services:

Below is a short explanation of the options used:
  • -t service : to view only the "systemd" units that have the "service" type.
  • --state=active : only shows the running services.
We could also check the open "listening" connections using the below command:

We could also use the below command to list all listening "TCP listening " sockets: 

If we want to list only the "listening IPv4 connections" for example, we use the below command:

Mapping the machine:

To check the hosts on the  network "", we could use the below command: 

To do half scans "SYN scan"so we could communicate with the ports of the machine without establishing a full connection, we use the below command:

The "-sS" parameter stands for a "SYN scan".

The different states of the ports in an nmap scan:
  • filtered : the port is blocked by a firewall
  • open : the port is open and not blocked by a firewall.
  • closed : no service is running on that port.
Another useful option is the "-sn", it does not perform any port scans, it only discovers the devices present on the "" network:


Leave as a comment: