Common TCP/UDP Ports Cheat Sheet
About 50 common ports with protocol, service name, purpose, security note and common misconfiguration.
| Port | Protocol | Service | Purpose | Security note |
|---|---|---|---|---|
| 20 / 21 | TCP | FTP | File transfer (20 data, 21 control) | Cleartext — use SFTP instead |
| 22 | TCP | SSH / SFTP | Remote shell, secure file transfer | Restrict source IPs and prefer keys over passwords |
| 23 | TCP | Telnet | Legacy remote login | Cleartext — always replace with 22/SSH |
| 25 | TCP | SMTP | Mail transfer between servers | Many ISPs block outbound 25; use 587 |
| 53 | TCP / UDP | DNS | Name resolution | Open resolvers are abused for amplification |
| 67 / 68 | UDP | DHCP | Automatic IP assignment | Unauthenticated; enable DHCP snooping |
| 69 | UDP | TFTP | Device config and firmware transfer | No auth or encryption — isolated segments only |
| 80 | TCP | HTTP | Web (cleartext) | Should redirect to 443 |
| 110 | TCP | POP3 | Mail retrieval (cleartext) | Use 995 (POP3S) |
| 123 | UDP | NTP | Time synchronization | Allow only internal NTP peers |
| 143 | TCP | IMAP | Mail retrieval (cleartext) | Use 993 (IMAPS) |
| 161 / 162 | UDP | SNMP | Device monitoring and traps | v2c community is cleartext; use v3 |
| 389 | TCP | LDAP | Directory service | Use 636 (LDAPS) |
| 443 | TCP | HTTPS | Web (encrypted) | Check certificate validity and TLS version |
| 445 | TCP | SMB | Windows file sharing | Never expose to the internet (ransomware entry point) |
| 465 / 587 | TCP | SMTPS / Submission | Encrypted mail submission | Require STARTTLS on 587 |
| 514 | UDP | Syslog | Log collection | Unencrypted; tunnel it across the internet |
| 636 | TCP | LDAPS | Encrypted directory service | Validate the certificate chain |
| 873 | TCP | rsync | File synchronization | Disable anonymous mode — it leaks directory listings |
| 993 / 995 | TCP | IMAPS / POP3S | Encrypted mail retrieval | Preferred |
| 1433 | TCP | SQL Server | Microsoft SQL Server | Do not expose directly |
| 1521 | TCP | Oracle DB | Oracle database | Restrict to app server subnets |
| 2049 | TCP / UDP | NFS | Network file system | IP-allowlist only; never across untrusted networks |
| 3306 | TCP | MySQL | MySQL database | Disallow remote root login |
| 3389 | TCP | RDP | Windows Remote Desktop | Do not expose publicly — use VPN or an allowlist |
| 5432 | TCP | PostgreSQL | PostgreSQL database | Review trust entries in pg_hba.conf |
| 5900 | TCP | VNC | Remote desktop | Weak default auth; internal only |
| 6379 | TCP | Redis | In-memory database | No auth by default — public exposure means data loss |
| 8080 / 8443 | TCP | HTTP 备用端口 | App servers, admin consoles | Restrict admin consoles by source IP |
| 9200 | TCP | Elasticsearch | Search and log storage | Early versions had no auth — enable it |
No matching rows