☼
⌃
☰

Network Port

Table of Contents

A 16-bit number (0–65535) identifying a specific application or service on a host. An IP address identifies the device; a port identifies which process on that device the traffic is for. Together, IP + port + protocol form a socket — the unique identifier for a network connection.

Related: IP Address ICMP Nmap Firewall

Port Ranges

Range Name Use
0–1023 Well-known System services, assigned by IANA — require root/admin to bind
1024–49151 Registered Application-specific, IANA-registered but not reserved
49152–65535 Ephemeral / dynamic Client-side temporary ports for outbound connections

Common Ports Reference

Port Protocol Service
20, 21 TCP FTP (data, control)
22 TCP SSH
23 TCP Telnet (cleartext — avoid)
25 TCP SMTP
53 TCP/UDP DNS
67, 68 UDP DHCP (server, client)
80 TCP HTTP
88 TCP/UDP Kerberos
110 TCP POP3
111 TCP/UDP RPC portmapper
135 TCP MSRPC
137–139 TCP/UDP NetBIOS
143 TCP IMAP
161, 162 UDP SNMP (get, trap)
389 TCP/UDP LDAP
443 TCP HTTPS
445 TCP SMB
465, 587 TCP SMTP (SSL, STARTTLS)
636 TCP LDAPS
993 TCP IMAPS
995 TCP POP3S
1433 TCP MSSQL
1521 TCP Oracle DB
3306 TCP MySQL
3389 TCP RDP
4444 TCP Metasploit default listener
5432 TCP PostgreSQL
5985, 5986 TCP WinRM (HTTP, HTTPS)
6379 TCP Redis
8080, 8443 TCP Common HTTP/S alternates
27017 TCP MongoDB

Scanning Ports

SHELL
# Fast scan — top 1000 ports
nmap -sV $IP

# Full port scan
nmap -sV -p- $IP

# Specific ports
nmap -p 22,80,443,3389 $IP

# Check if a port is open without Nmap
nc -zv $IP 22
curl -I http://$IP:8080

Security Relevance

Exposed services are attack surface

Every open port is a potential entry point. Exposed management services on public IPs are commonly exploited:

TEXT
High-risk exposed ports:
22  (SSH)   — brute force, key theft
23  (Telnet) — cleartext credentials
3389 (RDP)  — brute force, BlueKeep and similar CVEs
445 (SMB)   — EternalBlue, relay attacks
1433/3306/5432 — databases with no VPN/firewall protection
6379 (Redis) — often no auth, writable config for persistence

Port selection in red team work

TEXT
Reverse shell port choices:
— 443 (HTTPS) — almost always permitted outbound, less inspected
— 80  (HTTP)  — permitted outbound, but more likely to be proxied
— 53  (DNS)   — DNS tunnelling when HTTP is blocked
— 8080, 8443  — common HTTP alternate, often permitted

Avoid: 4444 (Metasploit default) — blocked/alerted on many networks

Tips

  • Memorise the common ports table — port numbers appear constantly in Nmap output, logs, and CTF challenges
  • Ports above 1024 do not require elevated privileges to bind — web apps and tools commonly run on 8080/8443 for this reason
  • A service on a non-standard port is not security through obscurity — Nmap finds it in seconds with a full scan
  • Redis (6379) and MongoDB (27017) with no authentication and no firewall on a public IP are critical findings — check for these explicitly on external assessments