Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 38 ยท Scanning and Enumeration

Service and Version Enumeration

Learn how testers identify what runs behind an open port: banner grabbing, version detection, scripting engines, TLS inspection and how to turn versions into research leads.

An open port tells you something is listening. Enumeration tells you what it is, which version, how it is configured and what it will reveal to a stranger. The jump from "port 8080 is open" to "port 8080 runs Apache Tomcat 9.0.31 with the manager page exposed" is where scanning turns into findings. This lesson covers banner grabbing, version detection, scripted checks and the careful reading of results.

All of this is active testing. Keep it inside the agreed scope and rate limits.

Many services greet new connections with a text banner, or reveal themselves in the first reply. You can see it with a plain TCP client. Read-only examples (invented data):

Terminal
nc -nv 192.0.2.10 22
TEXT
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
Terminal
nc -nv 192.0.2.25 25
TEXT
220 mail.example.test ESMTP Postfix

HTTP servers answer a request with headers as in Web Fingerprinting. FTP, SMTP, POP3 and IMAP send a greeting line. Some services say nothing until you speak the right protocol.

Version detection

Scanners improve on banners by sending probes and matching the replies against a database of signatures. Even when a banner is removed, the way a service responds to odd input is often distinctive.

Terminal
nmap -sV -p 22,80,443,3306 192.0.2.10
TEXT
PORT     STATE    SERVICE VERSION
22/tcp   open     ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
80/tcp   open     http    Apache httpd 2.4.41 ((Ubuntu))
443/tcp  open     ssl/http Apache httpd 2.4.41 ((Ubuntu))
3306/tcp filtered mysql
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

This is example output in the real format. Notice the CPE string: a standardized name for the product that databases of vulnerabilities use. Version detection also guesses the operating system from patterns in the TCP/IP stack (-O), which is useful but imperfect.

From port to knowledge

Port open Something listens.
Banner What it says about itself.
Probes How it reacts to input.
Version Product, release, OS.

Each layer adds confidence.

1 / 2

Scripts for safe checks

Scanners include scripting engines (the Nmap Scripting Engine is the best known) with categories such as safe, default, discovery, version, auth, vuln and intrusive. Reading the category matters: intrusive scripts may crash services, and brute-force scripts can lock accounts. Use default and safe freely when allowed, and review anything else against the RoE.

Typical useful checks:

  • Show the supported TLS versions and ciphers of a service.
  • Read an HTTP page title and the methods a server allows.
  • List SMB shares anonymously, or check whether anonymous FTP is enabled.
  • Query an SNMP service for its description if a default community string is accepted.

See Enumerating Common Services for how these appear per protocol.

TLS inspection

For encrypted services, look at the certificate and settings:

  • Which certificate, issuer and names does it present? Names can reveal other hosts.
  • Is it expired, self-signed or issued for a different name?
  • Which protocol versions are enabled? SSLv3, TLS 1.0 and TLS 1.1 are obsolete.
  • Are weak cipher suites accepted?

Read-only example output (invented):

TEXT
| ssl-enum-ciphers:
|   TLSv1.0:
|     ciphers:
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA - weak
|   TLSv1.2:
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - strong
|_  least strength: weak

Turning versions into leads

A version string is a lead, not a finding. The workflow:

  1. Normalize the product and version (Apache httpd 2.4.41).
  2. Search public vulnerability databases by CPE or product name; note CVE identifiers and their severity scores.
  3. Check whether the version is supported: end-of-life software gets no patches, which is a finding in itself.
  4. Consider backporting: Linux distributions often fix security bugs in older version numbers. Look at the distribution's package changelog before claiming exposure.
  5. Validate safely, with a non-destructive check, when the RoE allows it.

Stand-in: grab and parse banners

The first example parses a set of captured banners (invented) into product and version, which is the first step in turning them into leads.

Python Parse banners into product and version

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second example checks identified versions against a small, invented table of end-of-life and known-issue data. A real engagement uses vulnerability databases, but the matching step looks like this.

Python Match versions against a lead table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Recording and organizing

Create one record per service: host, port, protocol, product, version, evidence (banner or command output), confidence and next step. Save the raw output. A spreadsheet or Markdown table keeps the whole picture visible. It also makes the report's affected-systems tables trivial to produce.

Defender takeaways

  • Remove unnecessary services and restrict the rest to who needs them.
  • Disable old TLS versions and weak ciphers.
  • Track end-of-life software and plan replacement.
  • Banner hiding is low value on its own; patching and configuration are what protect.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a CPE string?

    CPE names products so vulnerability data can be matched to what you found.
  2. 2. Why is a version number only a lead and not a finding?

    You must verify whether the specific weakness applies to the system.
  3. 3. Which Nmap script category should you review carefully before running?

    Intrusive scripts may crash services or cause side effects, so check the RoE first.
  4. 4. Which TLS finding is a clear problem?

    Obsolete protocol versions and weak cipher suites should be disabled.

Summary

  • Enumeration identifies the product, version and configuration behind an open port.
  • Banner grabbing and version-detection probes give leads; the OS can be guessed from stack behavior.
  • Scripting engines run safe checks; avoid intrusive scripts unless allowed.
  • Inspect TLS for old protocols, weak ciphers and certificate problems.
  • Treat versions as leads: research, consider backports and verify safely before reporting.

Next: Enumerating Common Services