zeliha-infosec-journey

Port Enumeration & Exploitation Playbook

A port-by-port “what to do next” reference — for scan mechanics themselves (scan types, timing, NSE scripts, evasion), see nmap-cheatsheet-professional.md. This document picks up once a port is confirmed open and walks through enumeration → common misconfigurations/vulnerabilities → the exploitation path, service by service.

All techniques below are for use in authorized environments only — this playbook assumes an authorized lab, exam, or engagement.


Port 21 — FTP

Quick enumeration:

nmap -sV -sC -p21 <ip>
ftp <ip>                      # try anonymous:anonymous or anonymous:<blank>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try anonymous login first, always — it’s free and common on CTF-style boxes.
  2. If writable, check whether the FTP directory overlaps a web-accessible path — upload a web shell (see web-shells-cheatsheet-professional.md).
  3. Search the banner/version against known CVEs via searchsploit (see exploitation-techniques-cheatsheet-professional.md).

Port 22 — SSH

Quick enumeration:

nmap -sV -sC -p22 <ip>
ssh -v <ip>                   # banner grab, algorithm negotiation details

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. If credentials or a private key were found elsewhere (web app config, FTP, SMB share), try them here first — SSH is rarely the initial foothold, usually the second step.
  2. Only brute-force if explicitly in scope and rate-limiting/lockout risk is acceptable — see hydra-cheatsheet-professional.md.
  3. Check version-specific CVEs if the banner reveals an old release.

Port 23 — Telnet

Quick enumeration:

nmap -sV -sC -p23 <ip>
telnet <ip>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try default vendor credentials if the banner identifies embedded/network hardware.
  2. If credentials are known/guessed, cleartext login gives immediate interactive access — no further exploitation typically needed.

Port 25 / 587 — SMTP

Quick enumeration:

nmap -sV -sC -p25 <ip>
nc -nv <ip> 25
VRFY root                     # username enumeration if VRFY is enabled

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Enumerate valid usernames via VRFY — feeds directly into brute-force targets for SSH/RDP/other services found on the same host.
  2. Check for open relay if social-engineering is in scope (cross-reference social-engineering-set-cheatsheet-professional.md).

Port 53 — DNS

Quick enumeration:

dig axfr @<ip> <domain>       # attempt zone transfer
nslookup
dnsrecon -d <domain> -t axfr

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Always attempt a zone transfer first — free, fast, and occasionally hands you the whole internal naming scheme.
  2. Feed discovered hostnames back into OSINT/recon (see osint-cheatsheet.md) and vhost enumeration (see gobuster-cheatsheet-professional.md).

Port 80 / 443 / 8080 / 8443 — HTTP / HTTPS

Quick enumeration:

nmap -sV -sC -p80,443,8080,8443 <ip>
whatweb <ip>
gobuster dir -u http://<ip> -w <wordlist>

Common vulnerabilities / misconfigurations:

Exploitation path: This service gets its own full set of cheat sheets rather than a summary here — start with web-http-protocol-fundamentals-cheatsheet-professional.md, then web-enumeration-common-vulns-cheatsheet-professional.md, burp-suite-cheatsheet-professional.md, sqlmap-cheatsheet-professional.md, and web-shells-cheatsheet-professional.md once an upload/write path is found.


Port 88 — Kerberos

Quick enumeration:

nmap -sV -sC -p88 <ip>

Common vulnerabilities / misconfigurations:

Exploitation path: Go directly to active-directory-enumeration-cheatsheet-professional.md and the full active-directory-attack-chain-playbook.md — Kerberoasting and AS-REP Roasting both hinge on this port being open.


Port 110 / 143 — POP3 / IMAP

Quick enumeration:

nmap -sV -sC -p110,143 <ip>
nc -nv <ip> 110

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try credentials harvested from other services first.
  2. A successful login often yields email content — a good source of further credentials, internal hostnames, and social-engineering context.

Port 135 — MSRPC

Quick enumeration:

nmap -sV -sC -p135 <ip>
rpcclient -U "" <ip>          # null session attempt

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Attempt a null session — if it works, enumerate users/groups directly.
  2. This port is usually enumerated alongside 139/445 rather than in isolation — see the SMB section below and smb-windows-enumeration-cheatsheet-professional.md.

Port 139 / 445 — SMB / NetBIOS

Quick enumeration:

nmap -sV -sC -p139,445 --script smb-enum-shares,smb-os-discovery <ip>
smbclient -L //<ip>/ -N
crackmapexec smb <ip>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Enumerate shares anonymously first, always.
  2. If a writable share is found, check where it lands on the filesystem — sometimes a direct path to code execution.
  3. Validate any harvested credentials across the whole subnet with CrackMapExec — see crackmapexec-cheatsheet-professional.md and smb-windows-enumeration-cheatsheet-professional.md for full detail.

Port 161 — SNMP

Quick enumeration:

nmap -sU -sV -sC -p161 <ip>
snmpwalk -c public -v1 <ip>
onesixtyone <ip> community_strings.txt

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try default community strings first — extremely common finding.
  2. snmpwalk a successful string fully; look specifically for the Windows/Cisco config-dump OIDs that sometimes leak credentials.

Port 389 / 636 — LDAP / LDAPS

Quick enumeration:

nmap -sV -sC -p389,636 <ip>
ldapsearch -x -H ldap://<ip> -b "dc=domain,dc=com"

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Attempt an anonymous bind first.
  2. Feed the results directly into BloodHound-style AD mapping — see active-directory-enumeration-cheatsheet-professional.md.

Port 1433 — MSSQL

Quick enumeration:

nmap -sV -sC -p1433 <ip>
crackmapexec mssql <ip> -u <user> -p <pass>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try sa/blank or common default credentials.
  2. Once authenticated, check if xp_cmdshell is enabled; if not and you have sysadmin, re-enable it — this is a direct route to a shell on the underlying host.
  3. Follow up with metasploit-cheatsheet-professional.md MSSQL modules for a scripted path to the same result.

Port 2049 — NFS

Quick enumeration:

showmount -e <ip>
mount -t nfs <ip>:/<share> /mnt/nfs

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. List exports, mount any accessible share.
  2. If no_root_squash is set, plant a SUID binary from a local root context to escalate on the target — see the NFS section of privilege-escalation-linux-windows-cheatsheet.md.

Port 3306 — MySQL

Quick enumeration:

nmap -sV -sC -p3306 <ip>
mysql -h <ip> -u root -p

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try root/blank first.
  2. If FILE privilege is available and the web root is known/guessable, write a web shell directly via SELECT ... INTO OUTFILE (see web-shells-cheatsheet-professional.md).

Port 3389 — RDP

Quick enumeration:

nmap -sV -sC -p3389 <ip>
xfreerdp /v:<ip> /u:<user> /p:<pass>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try any credentials harvested elsewhere in the engagement first.
  2. Only brute-force if explicitly in scope — RDP lockout policies are common and noisy.
  3. Once in, this is typically an endpoint you already compromised another way (RDP is rarely the true initial foothold on a well-configured target).

Port 5432 — PostgreSQL

Quick enumeration:

nmap -sV -sC -p5432 <ip>
psql -h <ip> -U postgres

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try default credentials.
  2. If superuser, use COPY ... FROM PROGRAM to execute OS commands directly — often faster than chasing a separate RCE.

Port 5900 — VNC

Quick enumeration:

nmap -sV -sC -p5900 <ip>
vncviewer <ip>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Try connecting with no password first.
  2. If a password is set, check for reused credentials or brute-force if in scope.
  3. A successful connection is immediate full desktop access — no further exploitation typically needed.

Port 5985 / 5986 — WinRM

Quick enumeration:

nmap -sV -sC -p5985,5986 <ip>
crackmapexec winrm <ip> -u <user> -p <pass>
evil-winrm -i <ip> -u <user> -p <pass>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Validate any harvested domain/local credentials with CrackMapExec across the subnet first.
  2. Use evil-winrm for an interactive PowerShell session once valid credentials are confirmed — a clean, stable alternative to a raw reverse shell.

Port 6379 — Redis

Quick enumeration:

nmap -sV -sC -p6379 <ip>
redis-cli -h <ip>

Common vulnerabilities / misconfigurations:

Exploitation path:

  1. Connect with no credentials — very commonly unauthenticated.
  2. If writable paths are reachable, write an SSH key or cron entry via CONFIG SET dir / SAVE abuse for code execution — verify this is a known, working technique for the specific Redis version before relying on it.

Quick Decision Flow

  1. Run the full port scan first (all 65535, not just top-1000) — see nmap-cheatsheet-professional.md.
  2. For each open port, jump to its section above for the enumeration commands.
  3. Prioritize: AD-indicator ports (88, 389, 445) → web (80/443) → database ports with default-credential potential → everything else.
  4. Track every credential found across any port — most of this list assumes reuse from an earlier finding, not a fresh brute-force each time.

Scan mechanics: nmap-cheatsheet-professional.md. Credential validation at scale: crackmapexec-cheatsheet-professional.md · hydra-cheatsheet-professional.md. Category identification: attack-types-identification-cheatsheet-professional.md.