Nmap for Authorized Infrastructure Validation (Not Hacking)
Every deploy makes a promise about the network: "this box only exposes SSH and HTTPS," "the database is never reachable from outside the app tier." Nmap is how you turn that promise into a test that either passes or fails. Nobody has to take the security group's word for it. One rule before anything else: only scan systems you own or are explicitly authorized to assess. Point Nmap at a lab, a VM you control, or your own infrastructure. This is authorized infrastructure validation — a defensive check on exposure you're responsible for, not "hacking." Start with what's actually listening The most basic useful run is a host scan: nmap 192.168.56.10 This does host discovery and a default TCP scan of the common ports. The output lists each port as open , closed , or filtered . open means something accepted the connection. filtered usually means a firewall or security group silently dropped the packet — which is exactly the signal you want when validating that a rule is doing its job. If you expected a wall of filtered and instead see open , that's your finding. When you already know what should be exposed, scan for exactly that and nothing else: nmap -p 22,80,443 host Narrowing to the declared ports keeps the scan fast and the output readable. The question you're answering isn't "what's out there" — it's "does observed reality match what I declared?" Confirm what's really on the port An open port tells you a socket is listening. It does not tell you what . For that, add version detection: nmap -sV -p 22,80,443 host -sV probes each open port and reports the service and, when it can, the version banner. This matters because ports lie. A service you assumed was nginx on 443 might be something a teammate stood up last week. Read the SERVICE and VERSION columns and ask: is this the thing I expected, at the version I expected? A mismatch here is often the first sign of drift or a forgotten container. A methodology, not just commands Running Nmap ad hoc gives you trivia. Runnin