Practical nmap auditing on CentOS networks
Nmap is a practical tool for mapping hosts, exposed ports, and service versions on CentOS networks. Used carefully, it helps administrators verify what is reachable instead of relying on assumptions about firewalls and server configuration.
Scanning is also an intrusive action. The same command that identifies an open SSH service can trigger alerts, load a fragile appliance, or breach authorisation boundaries, so scope and evidence matter as much as the scan itself.
Install nmap on CentOS Stream
On CentOS Stream, install Nmap from the enabled AppStream repository with sudo dnf install -y nmap, then confirm the binary using nmap --version. CentOS 7 systems can use sudo yum install -y nmap, although CentOS 7 has been unsupported since June 2024 and should be migrated rather than hardened indefinitely.
Choose the scan that matches the question:
| Objective | Command | Useful result |
|---|---|---|
| Find live IPv4 hosts | sudo nmap -sn 192.168.1.0/24 |
Host discovery without port scanning |
| Check selected TCP ports | sudo nmap -sS -p 22,80,443 192.168.1.10 |
Exposure of common remote services |
| Identify service versions | sudo nmap -sV -p 22,80,443 192.168.1.10 |
Product and version fingerprints |
| Sample UDP services | sudo nmap -sU --top-ports 20 192.168.1.10 |
Responses from selected UDP ports |
| Find live IPv6 hosts | sudo nmap -sn -6 fd00::/64 |
IPv6 host discovery |
Confirm routes and interfaces with ip -br addr, ip route, and ip -6 route before selecting a target. For related syntax and examples, the broader Linux command reference covers common Linux command workflows.
Define an authorised discovery scope
Only scan infrastructure you own or have explicit permission to test. Record the owner’s approval, exact IPv4 or IPv6 ranges, permitted scan types, source addresses, maintenance window, and escalation contact. The Privacy Act 1988 may apply where personal information is involved; the Telecommunications Act 1997 and state or territory criminal laws may also restrict unauthorised access or interception.
Australian teams often connect Sydney, Melbourne, and Brisbane offices through cloud links and home NBN connections. Routers supplied by Telstra, Optus, and iiNet remain a separate boundary, so include only devices owned by the organisation or supplied for testing, never an ISP’s upstream equipment.
Run practical discovery and audit scans
Begin with scoped host discovery, then narrow the target list:
sudo nmap -sn 192.168.1.0/24identifies live IPv4 hosts.sudo nmap -PR 192.168.1.0/24forces ARP discovery on the local Ethernet segment.sudo nmap -sn -6 fd00::/64checks an approved IPv6 range.sudo nmap --open -p 22,80,443 192.168.1.0/24checks selected ports across a bounded subnet.
Run focused checks against confirmed systems:
sudo nmap -sS -sV -p 22,80,443 192.168.1.10combines SYN scanning with version detection.sudo nmap -sT -sV -p- 192.168.1.10checks all TCP ports without raw-packet privileges.sudo nmap -sU --top-ports 20 192.168.1.10limits the slow UDP audit to its most common ports.sudo nmap --script safe -sV 192.168.1.10runs non-invasive Nmap Scripting Engine checks.
-sS is fast but requires raw-packet privileges; -sT works without them but is slower. UDP scans can take minutes, so limit their ports. Test scripting categories on staging first, and run vuln scripts only in an approved window because they may generate significant traffic or misleading results.
Read scan states without guesswork
open means a port accepted a connection attempt, not that its service is secure. closed indicates a responsive host without a listener, while filtered means Nmap received no useful reply, commonly because a firewall dropped the probe. Confirm filtered results with a slower scan from another authorised source.
Version detection can confuse containers, proxies, and load balancers, so compare fingerprints with asset records. When hostnames contain international characters, the Unicode decoding notes explain why byte sequences and displayed characters can differ; retain XML output with -oX for reliable parsing.
Check services against firewall controls
Compare scan results with expected services and local listeners. sudo ss -lntup shows listening sockets and processes, helping explain why ports such as 22, 80, 443, 21, or 139 appear reachable. Flag legacy protocols and management interfaces for owner review rather than assuming they are harmless.
On CentOS, inspect sudo firewall-cmd --list-all, sudo nft list ruleset, and legacy sudo iptables -S where applicable. An apparently open port may be permitted by another firewalld zone, a container, a load balancer, or an Australian cloud provider’s security group rather than the server rules.
Repeat relevant checks with -6, because Australian NBN and cloud environments often expose IPv6 alongside IPv4. On shared café Wi-Fi in Melbourne or Brisbane, test only an approved device; guest phones, point-of-sale systems, and staff laptops may share the same segment.
Turn findings into verified safeguards
Add -oA audit-$(date +%Y%m%d-%H%M%S) to an approved command to save normal, XML, and grepable output together. Record the Nmap version, source address, scope, timestamps, and authorising owner, then compare later .nmap files with a baseline using diff -u.
Treat each result as evidence, not proof of compromise. Connect unexpected exposure and patch gaps to the Australian Signals Directorate’s Essential Eight where relevant, without claiming that Nmap establishes compliance. The practical takeaway is to keep every nmap run narrow, repeatable, and attributable, then verify each reported exposure against an approved service before closing the finding.