Linux Labs

Server security / Stage 1 of 10

Auditing listening services

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 7 · summary · 2 min

Summary

  • The server inventory is sudo ss -tlnp: a socket on 0.0.0.0 or [::] is visible from the network unless the filter closes it; for each one you decide who needs it.
  • Check from outside, from another machine: nmap or nc -zv show what an attacker will see.
  • A service whose clients are on the same machine is bound to 127.0.0.1; for PostgreSQL that is listen_addresses, and it changes only with a restart.
  • The rest is closed by a deny-by-default filter in /etc/nftables.conf with the nftables service enabled (in the Wiki).
  • At the start of the lesson the scanner found 5432 and 8080: the database and the admin panel listened on 0.0.0.0, and the server had no rules at all.
Ubuntu 24.04
Loading…