Andres Diaz

andres@diaz:~$ whoami

Andres Diaz

Defect Reproduction Engineer at Filevine

andresdiaztech@gmail.com

LinkedIn GitHub Blog



andres@diaz:~/notes$ cat ports.md

cd ..

Ports

Oct 18, 2026 · Reference

Goal

Know these without looking them up. Format: port (protocol, what it does).

Related: Acronyms · TCP and UDP

Covered so far

PortProtocolTCP/UDPWhat it doesWhy pentesters care
21FTP (File Transfer Protocol)TCPFile transfersOften allows anonymous login, sends passwords in plain text
22SSH (Secure Shell)TCPEncrypted remote terminalLogin target, brute force, stolen keys
23TelnetTCPUnencrypted remote terminalEverything, passwords included, in plain text
25SMTP (Simple Mail Transfer Protocol)TCPSending emailUser enumeration, open relays
53DNS (Domain Name System)UDP (and TCP)Names > IPsRecon, zone transfers leak every hostname
67/68DHCP (Dynamic Host Configuration Protocol)UDPHands out IPs (67 server, 68 client)Rogue DHCP, starvation
69TFTP (Trivial File Transfer Protocol)UDPFile transfer with no loginGrab config files with no password
80HTTP (Hypertext Transfer Protocol)TCPUnencrypted webWeb app attacks, traffic is readable
110POP3 (Post Office Protocol v3)TCPDownloading emailPlain text logins
135RPC (Remote Procedure Call)TCPWindows services talking to each otherWindows enumeration
139NetBIOS (Network Basic Input/Output System)TCPOld Windows file sharingEnumeration, works with SMB
143IMAP (Internet Message Access Protocol)TCPReading email on the serverPlain text logins
161SNMP (Simple Network Management Protocol)UDPDevice monitoringDefault "public" community string leaks device info
443HTTPS (HTTP Secure)TCP (and UDP for QUIC)Encrypted webWeb app attacks, SNI (Server Name Indication) shows site names
445SMB (Server Message Block)TCPWindows file sharingTop target: shares, relay attacks, EternalBlue
3389RDP (Remote Desktop Protocol)TCPWindows remote desktopLogin target, brute force

Coming up in PEH (Practical Ethical Hacking)

PortProtocolTCP/UDPWhat it doesWhy pentesters care
88KerberosTCP/UDPAD (Active Directory) login ticketsKerberoasting, AS-REP roasting
123NTP (Network Time Protocol)UDPClock syncKerberos breaks if clocks are off
389LDAP (Lightweight Directory Access Protocol)TCPQuerying AD (Active Directory)Dump users, groups, computers
636LDAPS (LDAP Secure)TCPEncrypted LDAPSame as 389, encrypted
1433MSSQL (Microsoft SQL Server)TCPMicrosoft databaseDefault creds, command execution
3306MySQLTCPMySQL databaseDefault creds, data theft
5985/5986WinRM (Windows Remote Management)TCPRemote PowerShell (5985 HTTP, 5986 HTTPS)Remote shell with valid creds (evil-winrm)
8080HTTP alternateTCPWeb servers, admin panels, proxiesOften forgotten dev or admin sites

Quick memory groups

  • Remote access: 22 (SSH (Secure Shell)), 23 (Telnet), 3389 (RDP (Remote Desktop Protocol)), 5985 (WinRM (Windows Remote Management))
  • Web: 80 (HTTP (Hypertext Transfer Protocol)), 443 (HTTPS (HTTP Secure)), 8080 (HTTP alternate)
  • File transfer: 21 (FTP (File Transfer Protocol)), 69 (TFTP (Trivial File Transfer Protocol)), 445 (SMB (Server Message Block))
  • Email: 25 (SMTP (Simple Mail Transfer Protocol), send), 110 (POP3 (Post Office Protocol v3), download), 143 (IMAP (Internet Message Access Protocol), read on server)
  • Windows / AD (Active Directory): 88 (Kerberos), 135 (RPC (Remote Procedure Call)), 139 (NetBIOS), 389 (LDAP (Lightweight Directory Access Protocol)), 445 (SMB)
  • Network plumbing (mostly UDP (User Datagram Protocol)): 53 (DNS (Domain Name System)), 67/68 (DHCP (Dynamic Host Configuration Protocol)), 123 (NTP (Network Time Protocol)), 161 (SNMP (Simple Network Management Protocol))

Port ranges

  • 0 to 1023: well-known ports (the ones above)
  • 1024 to 49151: registered ports (apps like 3306 MySQL, 3389 RDP)
  • 49152 to 65535: ephemeral ports, picked randomly as the source port for outgoing connections (like 50074 in my Wikipedia capture)