How Banner Grabbing Works in Practice
When a client connects to TCP port 22 or 80, the server often announces its exact version string (for example, SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6 or Server: nginx/1.24.0). Active banner grabbing connects directly with netcat, curl, or Nmap (-sV), while passive banner grabbing queries search engines like Shodan or Censys.
Defensive Mitigation & Hardening Checklist
Disable verbose version tokens in production web servers and proxies (such as server_tokens off; in Nginx), restrict administrative ports (SSH, RDP, databases) behind a VPN or Zero Trust gateway, and keep exposed services patched.