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.
On this page 13 sections
- ·Prerequisites
- ·Lab Setup
- 1Scan the services with nmap -sV
- 2Grab banners by hand: FTP and SSH
- Locked: Read the SMTP service
- Locked: Enumerate SMB
- Locked: Query the DNS server
- Locked: Read SNMP with a community string
- Locked: Read the web server
- Locked: Build the findings table
- Locked: Defence and Detection
- Locked: Check Your Work
- 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 -sVand read the service, product and version columns - Grab banners by hand from FTP, SMTP and HTTP with
ncandcurl - 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).
- Your own Kali machine with
nmap,nc,curl,smbclient,digandsnmpwalk. Installsnmpanddnsutilsif a tool is missing:sudo apt install snmp dnsutils. lab01at10.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.lab02at10.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.20Scan 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
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 $TExample 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_kernelRead 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 $TYou 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
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 21Example 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/nullExample output:
(UNKNOWN) [10.0.0.20] 22 (ssh) open
SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1Now check if FTP lets a user in without a password. Nmap has a script for this.
nmap -p 21 --script ftp-anon $TExample 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.