Lesson 4 of 10 · 20 min · Advanced

Service enumeration deep dive

The per-service playbook: SMB, LDAP, SNMP, SSH, FTP, SMTP, NFS, RDP, databases and web. The commands that pull users, shares, versions and config, and the quick wins hiding in each.

In this lesson you will

  • Enumerate every common network service methodically
  • Pull users, shares, versions and config from each protocol
  • Recognise the quick wins each service hides
  • Build a credential and attack-surface picture from enumeration alone

Enumeration is 80% of network pentesting. Exploits are rare and dramatic; enumeration is constant and quietly wins engagements. Scanners tell you a port is open; this chapter tells you what to do with each one. Keep notes per service: versions, users, shares, creds.

SMB (445/139) — the internal goldmine

SMB leaks users, shares, policies and often lets you read files anonymously.

bash
# One tool to rule internal enum: NetExec (nxc)
nxc smb 10.10.10.0/24                         # host list + signing + OS
nxc smb 10.10.10.10 -u '' -p '' --shares      # null-session shares
nxc smb 10.10.10.10 -u guest -p '' --users --rid-brute
# Classic alternatives
smbclient -L //10.10.10.10 -N                 # list shares, no creds
smbmap -H 10.10.10.10 -u guest                # share + permission map
enum4linux-ng -A 10.10.10.10                  # everything, parsed

Quick wins: readable shares with configs/scripts/backups; SMB signing not required (relay target, Ch. 8); MS17-010 (EternalBlue); passwords in \\host\SYSVOL scripts.

LDAP (389/636) — the directory

On a domain controller, LDAP hands you the entire user and group list, sometimes anonymously.

bash
# Anonymous bind — dump naming contexts, then users
ldapsearch -x -H ldap://10.10.10.10 -s base namingcontexts
ldapsearch -x -H ldap://10.10.10.10 -b "DC=corp,DC=local" "(objectClass=user)" sAMAccountName description
nxc ldap 10.10.10.10 -u user -p pass --users

Quick win: passwords in the description field (depressingly common), and service accounts you can target later.

SNMP (UDP 161) — the talking device

A default community string (public/private) turns a router, printer or server into an open book: interfaces, routes, processes, sometimes credentials.

bash
onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt 10.10.10.10
snmpwalk -v2c -c public 10.10.10.10            # whole MIB
snmpwalk -v2c -c public 10.10.10.10 1.3.6.1.4.1.77.1.2.25   # Windows users
snmp-check 10.10.10.10 -c public

SSH (22)

bash
nmap -p22 --script ssh2-enum-algos,ssh-auth-methods 10.10.10.10
nxc ssh 10.10.10.10 -u users.txt -p passwords.txt --continue-on-success

Quick wins: weak/default creds, key-based auth with a leaked key, username enumeration on old OpenSSH, and SSH used as a pivot (Ch. 8).

FTP (21)

bash
nmap -p21 --script ftp-anon,ftp-syst 10.10.10.10
ftp 10.10.10.10   # try anonymous:anonymous

Anonymous FTP with write access can mean a web-root upload or a staging spot for tools.

SMTP (25/587)

bash
# User enumeration via VRFY/EXPN/RCPT
smtp-user-enum -M RCPT -U users.txt -t 10.10.10.10
nmap -p25 --script smtp-commands,smtp-open-relay 10.10.10.10

An open relay is a finding; VRFY/RCPT confirms valid usernames for spraying.

NFS (2049)

bash
showmount -e 10.10.10.10            # exported shares
mkdir /mnt/nfs && mount -t nfs 10.10.10.10:/export /mnt/nfs -o nolock

Quick win: world-readable exports, and no_root_squash (write a SUID binary as root → local privesc if you have a foothold).

RDP (3389)

bash
nmap -p3389 --script rdp-ntlm-info,rdp-enum-encryption 10.10.10.10
nxc rdp 10.10.10.10 -u users.txt -p 'Winter2026!'   # spray carefully — lockouts!

rdp-ntlm-info leaks the hostname and domain for free.

Databases (MySQL 3306, MSSQL 1433, PostgreSQL 5432, Mongo 27017, Redis 6379)

bash
nmap -p3306 --script mysql-empty-password,mysql-info 10.10.10.10
nxc mssql 10.10.10.10 -u sa -p '' --local-auth
redis-cli -h 10.10.10.10      # often no auth at all → config/keys
mongo --host 10.10.10.10      # often no auth

Quick wins: blank sa/root, Redis/Mongo with no auth, and MSSQL xp_cmdshell for command execution if you get in.

Web (80/443/8080/8443)

Full web testing is its own discipline (see our Web VAPT guide), but on a network test, triage every web port fast:

bash
whatweb http://10.10.10.10
nuclei -u http://10.10.10.10 -severity medium,high,critical
ffuf -u http://10.10.10.10/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,301,302,401,403

Quick wins: default creds on admin panels (Tomcat, Jenkins, iDRAC, printers), exposed /.git, known-CVE appliances.

The enumeration mindset

text
 For every open port ask:
  1. What exactly is it? (version)
  2. Can I touch it without creds? (anon/null/default)
  3. What does it leak? (users, shares, config)
  4. Does this version have a known exploit?
  5. Does it give creds I can reuse elsewhere?

Credential reuse is the thread that ties a network together: a password from a share script often unlocks SSH, RDP and the domain.

🧪 Lab

  1. On Metasploitable or a lab AD box, enumerate SMB with nxc, smbmap and enum4linux-ng. Find a readable share and something useful in it.
  2. Find an SNMP service, guess the community string, and snmpwalk it.
  3. Enumerate SMTP users with smtp-user-enum.
  4. Check every database port for blank/default credentials.
  5. Build a single "creds found" note and list which other services each credential might unlock.

Checkpoint

  1. Why is enumeration more important than exploitation in most engagements?
  2. What can a null SMB session give you?
  3. Where do passwords hide in LDAP, and how do you find them?
  4. What makes a default SNMP community string dangerous?
  5. What is credential reuse, and why does it decide most internal tests?