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 "10.1.122.0/24", 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 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.