Listeners vs exposure
A service can listen on 0.0.0.0 or :: yet still be unreachable from the internet if a cloud security group, host firewall, or carrier-grade NAT blocks it. Treat local enumeration and external port scan as two different answers to “is this port open?”
Linux and macOS
| Goal | Command pattern | Notes |
|---|---|---|
| All TCP/UDP listeners | ss -tulpn | Users see processes; root shows all PIDs |
| Who owns port 443 | sudo lsof -iTCP:443 -sTCP:LISTEN | Helpful when ss output is crowded |
| Quick connect test | nc -vz host 443 | TCP handshake path, not ICMP |
Windows
Get-NetTCPConnection -State Listen lists listeners; pair with Get-Process -Id. Test-NetConnection host -Port 443 exercises routing and firewall from that host’s perspective.
External truth
From a bastion or home connection run nmap -Pn -p 22,80,443 public.ip (only on networks you own or have written permission to test).
Related: netstat and ss on Linux, netstat vs ss, Nmap basics, Linux firewall commands.