Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Penetration testing, first steps

Lab · Medium · 1.5 hoursFree account

Service Footprinting

Banner grabbing and service enumeration across FTP, SSH, SMTP, SMB, and HTTP.

  • service-enumeration
  • smb
  • snmp
  • smtp
  • banner-grabbing
On this page 13 sections
  1. ·Prerequisites
  2. ·Lab Setup
  3. 1Scan the services with nmap -sV
  4. 2Grab banners by hand: FTP and SSH
  5. Locked: Read the SMTP service
  6. Locked: Enumerate SMB
  7. Locked: Query the DNS server
  8. Locked: Read SNMP with a community string
  9. Locked: Read the web server
  10. Locked: Build the findings table
  11. Locked: Defence and Detection
  12. Locked: Check Your Work
  13. Locked: Clean-up

Service footprinting reads what each open port announces: product, version and often the host name. Security engineers map this surface to decide what to patch, close or hide, because old services like vsFTPd 2.3.4 and SMBv1 still drive real breaches. The walkthrough below scans FTP, SSH, SMTP, SMB, DNS, SNMP and HTTP on a target, grabs each banner by hand and turns every leak into a defender's fix list.

For the wider process that this fits into, see the Vulnerability Assessment workbook.

What You'll Learn

  • Run nmap -sV and read the service, product and version columns
  • Grab banners by hand from FTP, SMTP and HTTP with nc and curl
  • List SMB shares and read the host details of a Samba server
  • Query a DNS server for its version and test it for zone transfers
  • Read a SNMP community string with snmpwalk
  • Turn the findings into a table of risks with a fix for each

Behind every open port is a service. The service tells you its name, its version and often the host name before you send one real request. This is the footprint of the target. An attacker uses it to choose a path. A defender reads the same footprint to decide what to patch, close or hide.

In this lab you scan your own lab machines, read what each service says, and write down what a defender must fix. You never exploit anything. Every command only reads data.

Prerequisites

Finish Nmap Scanning first. You must know a SYN scan and the -p option. For manual connections, Netcat Fundamentals helps. For SMB in more depth, continue with SMB Enumeration.

Lab Setup

You need two machines on your own network (the example addresses below use 10.0.0.0/8; use your own).

  1. Your own Kali machine with nmap, nc, curl, smbclient, dig and snmpwalk. Install snmp and dnsutils if a tool is missing: sudo apt install snmp dnsutils.
  2. lab01 at 10.0.0.20. A Metasploitable 2 VM, by Rapid7: an intentionally vulnerable Ubuntu virtual machine. It runs FTP, SSH, SMTP, DNS, HTTP, SMB and MySQL.
  3. lab02 at 10.0.0.21. Your own Ubuntu VM with the SNMP agent installed (see Step 6).

Set a variable on Kali for the first target. The commands below use it.

export T=10.0.0.20

Scan only lab01 and lab02. Both are machines you control. Metasploitable 2 has known faults on purpose. Never connect it to a network that others use, and never run these commands against a system without written permission.

Step 1: Scan the services with nmap -sV

1

Detect the version of every open service

A SYN scan only says that a port is open. The option -sV connects to each open port, reads the banner and sends probes. It then prints the product and the version.

Scan the ports of this lab and save the output.

nmap -sV -p 21,22,25,53,80,139,445,3306 -oN footprint.txt $T

Example output:

Starting Nmap 7.95 ( https://nmap.org ) at 2026-11-19 10:02 UTC
Nmap scan report for 10.0.0.20
Host is up (0.00045s latency).

PORT     STATE SERVICE     VERSION
21/tcp   open  ftp         vsftpd 2.3.4
22/tcp   open  ssh         OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
25/tcp   open  smtp        Postfix smtpd
53/tcp   open  domain      ISC BIND 9.4.2
80/tcp   open  http        Apache httpd 2.2.8 ((Ubuntu) DAV/2)
139/tcp  open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp  open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
3306/tcp open  mysql       MySQL 5.0.51a-3ubuntu5
Service Info: Host:  metasploitable.localdomain; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Read the VERSION column. Three versions are very old: vsftpd 2.3.4, OpenSSH 4.7p1 and Apache httpd 2.2.8. Software of this age has public security advisories. The Service Info line gives the host name metasploitable.localdomain.

Nmap uses light probes by default. Use --version-all to try every probe when a service shows as unknown.

nmap -sV --version-all -p 3306 $T

You need a table of what you found. Keep footprint.txt. You use it in Step 8.

Step 2: Grab banners by hand: FTP and SSH

2

Read the banner with netcat

A banner is the first text a service sends after you connect. Nmap reads it for you. Reading it by hand shows you where the version comes from.

Connect to the FTP port. The option -n skips DNS lookups and -v shows the connection. The option -w 3 stops after 3 seconds.

printf 'QUIT\r\n' | nc -nv -w 3 $T 21

Example output:

(UNKNOWN) [10.0.0.20] 21 (ftp) open
220 (vsFTPd 2.3.4)
221 Goodbye.

The first line of the service is the banner: 220 (vsFTPd 2.3.4). Do the same for SSH. The server sends its banner first, so you do not need to type anything.

nc -nv -w 3 $T 22 < /dev/null

Example output:

(UNKNOWN) [10.0.0.20] 22 (ssh) open
SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1

Now check if FTP lets a user in without a password. Nmap has a script for this.

nmap -p 21 --script ftp-anon $T

Example output:

PORT   STATE SERVICE
21/tcp open  ftp
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)

Anonymous login is a finding. Anyone on the network can list the files. FTP also sends all data and passwords in clear text. Add both facts to your notes.

Sign in to continue

9 more sections are for signed-in members. It is free: sign in with Google.

Related