Banner grabbing is the simplest way to find out what software is actually answering on an open port, and it’s usually the first technique newcomers to security learn after their first port scan. If you have just inherited a server, started a junior SOC role or begun studying for a certification, this guide covers what banner grabbing is, how to do it by hand, how to read the results and where those results can mislead you.
A port number alone tells you very little. Port 443 could be nginx, a Fortinet VPN portal or a forgotten Tomcat instance. Banner grabbing closes that gap in seconds.
What Banner Grabbing Actually Means
Many network services announce themselves when a client connects. That announcement is the banner. An SSH server sends something like SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6 before you type anything. A Postfix mail server answers with 220 mail.example.com ESMTP Postfix (Ubuntu). An old FTP daemon might reply 220 (vsFTPd 3.0.3).
Banner grabbing means connecting, capturing that text and recording it. No exploit is involved. You are simply reading what the service volunteers to everyone who connects, including the botnets that sweep the entire IPv4 space every few hours.
Services fall into two groups. With server-speaks-first protocols like SSH, SMTP, FTP and POP3, the banner arrives the moment the TCP handshake completes. With client-speaks-first protocols like HTTP, Redis and most databases, you have to send a request before you get any answer. Beginners often connect to port 80, see nothing and decide the service is dead. In most cases it is waiting for a request.
How to Grab a Banner Step by Step
Only scan systems you own or have written permission to test. The examples below use the documentation address 203.0.113.10.
Step 1 – Find what’s open. Run a quick scan such as nmap -p- –open 203.0.113.10. If the output confuses you, the guide on reading Nmap output as a beginner explains each column.
Step 2 – Connect to server-speaks-first ports. Run nc -v 203.0.113.10 22 and wait 2-3 seconds. The SSH version string appears on its own. The same works for ports 21, 25 and 110.
Step 3 – Send a request to HTTP services. Run curl -sI http://203.0.113.10/ and look for the Server and X-Powered-By headers. A response like Server: Apache/2.4.49 should get your attention immediately, because that exact release shipped with the path traversal flaw CVE-2021-41773.
Step 4 – Get past TLS. Netcat against port 443 or 993 returns nothing readable, because the banner is wrapped in encryption. Use openssl s_client -connect 203.0.113.10:443 -servername example.com, then type a HEAD request. For mail, openssl s_client -starttls smtp -connect 203.0.113.10:25 handles the upgrade.
Step 5 – Compare with automated detection. Run nmap -sV -p 21,22,25,80,443 203.0.113.10. Nmap sends dozens of probes from its nmap-service-probes file and matches the responses against thousands of signatures. When your manual result and Nmap’s guess disagree, look closer.
Reading Banners Without Fooling Yourself
An experienced penetration tester treats a banner as a claim, not a fact. Here’s a scenario many sysadmins will recognize. An external scan of a mid-sized company’s VPS fleet flags 14 servers running “OpenSSH 8.9p1”, and an automated report marks every one as vulnerable to several CVEs. The on-call engineer spends a Friday afternoon preparing emergency upgrades. Then someone checks the Ubuntu security tracker and finds all 14 servers were already patched.
That happened because of backporting. Debian, Ubuntu and Red Hat apply security fixes to the version they shipped without changing the upstream version number. A patched OpenSSH on Ubuntu 22.04 still says 8.9p1. Only the distribution suffix changes. To know whether a fix is present, you compare that suffix against the vendor’s security tracker, not against NVD alone.
This is where banner grabbing turns into proper service fingerprinting. Fingerprinting looks at how a service behaves, not just at what it says about itself. And once you trust the identification, version detection is what links an exposed service to real vulnerabilities.
The Myth: Hiding the Banner Makes You Safe
New admins often assume that suppressing version strings protects them. Setting server_tokens off; in nginx or ServerTokens Prod with ServerSignature Off in Apache is good hygiene, and it does cut noise from lazy scanners that only match version strings.
It doesn’t hide the software, though. Nginx still answers “Server: nginx”. Error page layouts, header order, TLS cipher preferences and default responses give the product away, and often the version range too. Mass exploitation tools usually don’t check banners at all. They send the exploit payload to every host on the port and see what breaks.
Think of banner suppression as removing a signpost, not locking the door. The real fix is patching the service or closing the port.
Common Mistakes Newcomers Make
The first mistake is grabbing banners only from inside the network. A load balancer, CDN or reverse proxy changes what outsiders see. Behind Cloudflare, an internal test shows Apache while the internet sees “Server: cloudflare”, yet a direct-to-origin IP that was never firewalled may still expose the raw Apache banner. Always check from an external vantage point as well.
The second is treating silence as safety. A port that returns no banner may still run something. It could be a client-speaks-first protocol, a TLS-wrapped service or a deliberately quiet backdoor. Silence means you need to probe further.
The third is grabbing once and never again. Banners change with every package update, container rebuild or configuration change. A banner captured in March says nothing about what the same port reports in November. Keeping dated snapshots lets you see when a version changed and whether anyone approved it.
Edge Cases Worth Knowing
Some environments break the usual advice. In industrial and OT networks, aggressive probing with nmap -sV –version-intensity 9 has been known to crash older PLCs, so practitioners stick to passive collection or vendor-approved tools. Strictly regulated environments may require a signed scope document before any active grabbing, even against your own assets.
Passive banner data is another option. Shodan has indexed internet-facing banners since 2009, and Censys does similar work. Searching your own IP ranges there shows what attackers already see, without sending a single packet. The catch is that this data can be days or weeks old.
FAQ
Is banner grabbing legal?
Connecting to a public service and reading its greeting is generally considered low-risk, but laws differ by country and many hosting providers’ terms ban unauthorized scanning. Limit it to systems you own or have written authorization to test.
Can I remove a service banner completely?
Sometimes, but rarely in full. SSH protocol rules require a version string, though Debian’s DebianBanner no option removes the distribution suffix. HTTP servers can shorten the Server header, but fingerprinting can still identify the software.
What is the difference between banner grabbing and nmap -sV?
Banner grabbing reads what a service volunteers. Nmap’s version detection sends multiple crafted probes and matches responses against a signature database, so it can often identify services that give no banner.
Summary – Start With Your Own Servers
Banner grabbing is quick, cheap and very informative. Use netcat for services that speak first, curl for HTTP, openssl s_client for anything behind TLS and nmap -sV to cross-check. Read every version string with backporting in mind, and confirm against the distribution’s security tracker before you raise an alarm.
A practical first exercise: grab the banners from every public port on one server you manage, write them down with today’s date and repeat in 30 days. Any difference you can’t explain is your first real finding.
