TCP/UDP Ports in Penetration Testing: A Complete Guide from Recon to Exploit

All TCP and UDP ports in penetration testing, organized by attack scenario: Active Directory, web, database, mail, DevOps. Attack vectors and complete technical guides for OSCP and red teams.
- Posted on 2026-06-10
- Reading time: 9 min
When you run the first scan on a target, every open port is a potential attack vector. Open port 445 on a Windows domain? SMB relay and Pass-the-Hash. Redis on 6379 without authentication? RCE in two commands. Jupyter on 8888? Direct code execution without credentials. Knowing the attack vector of each exposed service is the difference between a methodical pentest and a blind pentest.
This guide collects all the TCP and UDP ports used in penetration testing, organized by attack scenario—not by port number. You'll find the AD ports together because in a Windows engagement, you attack them sequentially. The databases are separate because they have different toolsets. Network protocols come first because understanding how ARP or ICMP works changes the way you construct attacks.
The definitive reference for those preparing OSCPs, working on HTB ProLab, or performing assessments on real infrastructures. For tools to use on each port, consult the Complete Guide to Penetration Testing Tools.
# Scan completo — tutte le porte TCP
nmap -sV -sC -p- --open -oA fullscan 10.10.10.1
# Top 1000 — discovery veloce
nmap -sV --top-ports 1000 -oA top1000 10.10.10.1
# UDP — non ignorarlo mai
nmap -sU --top-ports 100 -oA udpscan 10.10.10.1
# Approfondimento su porta specifica
nmap -sV -sC -A -p 445 10.10.10.1Index #
- Transport and Network Protocols
- Active Directory & Windows
- File Transfer & Remote Access
- Web Services
- Database
- Mail Services
- VPN & Proxy
- Network & Infrastructure
- DevOps & Cloud
- Legacy & Less Common
- Essential tools
- Related Hubs
Transport and Network Protocols #
Before ports, protocols. Understanding how TCP works at the handshake level, how ARP resolves addresses, or how ICMP behaves changes the way you construct attacks—from ARP poisoning for MITM, to stealthy SYN scan, to ICMP tunneling for exfiltration.
Transport and network #
| Protocol | OSI layer | Offensive vector | Guide |
|---|---|---|---|
| TCP | Transport | SYN stealth scan, TCP reset, port scanning | TCP |
| UDP | Transport | UDP scan, amplification, protocol abuse | UDP |
| SCTP | Transport | Port scan evasion, protocol fingerprinting | SCTP |
| HERE C | Transport | TLS inspection bypass, DNS leak | HERE C |
| IP | Mesh | IP spoofing, fragmentation, TTL manipulation | IP |
| IPv4 / IPv6 | Mesh | Dual-stack bypass, IPv6 SLAAC attack | IPv4 / IPv6 |
| ICMP | Mesh | Ping sweep, ICMP tunneling, redirect attack | ICMP |
| ARP | Data link | ARP spoofing, ARP poisoning, MITM on LAN | ARP |
| RARP | Data link | Reverse ARP, legacy network recon | RARP |
| GRE | Mesh | C2 tunneling, firewall bypass | GRE |
| IPSec | Mesh | IKE fingerprinting, PSK cracking, VPN bypass | IPSec |
| TLS / SSL | Introduction | BEAST, POODLE, Heartbleed, downgrade attack | TLS / SSL |
| HTTP / HTTPS | Application | Injection, auth bypass, header manipulation | HTTP / HTTPS |
| NTP | Application | NTP amplification DDoS, time manipulation | NTP |
LAN, switching and routing #
| Protocol | OSI layer | Offensive vector | Guide |
|---|---|---|---|
| Ethernet/802.3 | Data link | MAC flooding, CAM table overflow | Ethernet |
| VLAN | Data link | VLAN hopping, double tagging, DTP attack | VLAN |
| STP | Data link | Root bridge takeover, BPDU spoofing | STP |
| LLDP | Data link | Passive topology mapping, neighbor disclosure | LLDP |
| OSPF/EIGRP/BGP/RIP | Mesh | Route injection, neighbor spoofing | OSPF/EIGRP/BGP/RIP |
| VRRP/HSRP/CARP | Mesh | Virtual router takeover, MITM gateway | VRRP/HSRP/CARP |
| PPPs | Data link | MS-CHAPv2 crack, credential interception | PPPs |
| 802.11 WiFi | Physics/Data link | WPA2 PMKID crack, evil twin, deauth | 802.11 WiFi |
Network attack techniques #
| Technology | Description | Guide |
|---|---|---|
| Sniffing | Capture clear traffic, passive credential harvesting | Sniffing |
| Man-in-the-Middle | LAN/WAN traffic interception and manipulation | Man-in-the-Middle |
| VPN | Bypass, split tunnel abuse, credential theft | VPN |
Active Directory & Windows #
The most critical ports for AD pentesting. In a Windows domain, these ports define the entire attack surface. The typical sequence: enumerate on 389/LDAP, capture hashes on 137-139 with Responder, relay on 445/SMB, execute commands on 5985/WinRM or 135/RPC. Kerberos on 88 is the hub of everything.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 88 | Kerberos | AS-REP Roasting, Kerberoasting, Silver/Golden Ticket | Kerberos |
| 135 | RPC | Null session, WMI exec, lateral movement via DCOM | Port 135 RPC |
| 137 | NetBIOS-NS | Responder, NBT-NS poisoning, NTLM hash capture | NetBIOS Port 137 |
| 138 | NetBIOS-DGM | Broadcast monitoring, passive host discovery | Port 138 NetBIOS Datagram |
| 139 | NetBIOS-SSN | Null session, SMB legacy, EternalBlue | Port 139 NetBIOS Session |
| 389 | LDAP | AD enumeration, dump users/groups/GPOs without auth | LDAP Port 389 |
| 445 | SMB | Pass-the-Hash, NTLM relay, share enumeration, PsExec | SMB |
| 593 | RPC over HTTP | RPC tunneling over HTTP, perimeter firewall bypass | Port 593 RPC-HTTP |
| 636 | LDAPS | LDAP over TLS, ADCS ESC relay attacks | LDAPS Port 636 |
| 880 | Kerberos Admin | Ticket management, Kerberos administration | Port 880 Kerberos Admin |
| 1025 | MS-RPC | RPC endpoint mapper, dynamic RPC services | Port 1025 MS-RPC |
| 1026 | RPC | Secondary Dynamic RPC | Port 1026 RPC |
| 1434 | MSSQL Monitor | UDP — instance discovery, version detection | Port 1434 MSSQL Monitor |
| 3389 | RDP | BlueKeep, credential brute force, relay attack | Port 3389 RDP |
| 5985 | WinRM HTTP | Evil-WinRM, PowerShell Remoting, lateral movement | Port 5985 WinRM |
| 5986 | WinRM HTTPS | WinRM over TLS, bypass network filtering | Port 5986 WinRM HTTPS |
| 33389 | RDP Alternate | RDP on non-standard port, stealth access | Port 33389 RDP Alternate |
File Transfer & Remote Access #
Anonymous FTP, clear Telnet, and unauthenticated NFS are still present in real-world environments and are a constant presence in OSCP and HTB labs. The most common vector for these services is trivial: default credentials or completely anonymous access. Always check them, even when they seem irrelevant.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 20 | FTP Data | Active mode exploitation, unencrypted data channel | Port 20 FTP Data |
| 21 | FTP | Anonymous login, weak credentials, webshell upload | FTP Port 21 |
| 22 | SSH | Brute force, key leak, port forwarding, SFTP abuse | SSH |
| 23 | telnet | Clear credentials, banner grab, legacy device | Telnet Port 23 |
| 111 | RPCbind | NFS enumeration, NIS credential dump, UID bypass | Port 111 RPCbind |
| 512 | Rexec | Remote execution without encryption | Rexec Port 512 |
| 513 | login | Remote login legacy, .rhosts bypass without password | Port 513 Rlogin |
| 514 | RSH/Syslog | Remote shell without auth, log poisoning, RCE | Port 514 Syslog/RSH |
| 989 | FTPS Data | FTP over TLS — data channel | Port 989 FTPS Data |
| 990 | FTPS | Encrypted FTP, same vectors as 21 over TLS | Port 990 FTPS |
| 2049 | NFS | Anonymous mount, UID bypass, SSH key dump and hash | NFS Port 2049 |
| 3260 | iSCSI | Storage network access, unauthorized disk mounting | iSCSI Port 3260 |
| 3632 | Distcc | RCE via distributed compiler — classical vector HTB | Door 3632 Distcc |
| 3690 | SVN | Anonymous repository dump, credentials in commit history | Port 3690 SVN |
| 5900 | VNC | Brute-force passwords, desktop session without authentication | Port 5900 VNC |
| 6000 | X11 | X display hijacking, keystroke capture, screenshots | Port 6000 X11 |
| 9418 | Go | Public repository dump, credential leak in history | Git port 9418 |
Web Services #
Don't stop at 80 and 443 — Tomcat on the 8080, Jupyter on the 8888, and Webmin on the 10000 are often the fastest initial access vectors. Each exposed application server version has associated CVEs; always check the version before proceeding.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 80 | HTTP | SQLi, XSS, LFI, RFI, SSRF, brute force directories | HTTP Port 80 |
| 443 | HTTPS | TLS misconfiguration, ADCS HTTP endpoint | Port 443 HTTPS |
| 7001 | WebLogic | Deserialization RCE, default credentials, T3 protocol | WebLogic Port 7001 |
| 7002 | WebLogic SSL | WebLogic on TLS, same vectors as 7001 | Port 7002 WebLogic SSL |
| 7070 | RealServer | Streaming server misconfiguration | Port 7070 RealServer |
| 7777 | Oracle Apps | Oracle E-Business Suite, admin console | Port 7777 Oracle Apps |
| 8000 | HTTP Alt | Dev server exposed — Flask, Django, FastAPI debug mode | Port 8000 Web Dev |
| 8008 | HTTP Alt | Proxies, IoT webcams, embedded interfaces | Port 8008 HTTP Alt |
| 8080 | Tomcat | Tomcat manager RCE, unauthorized WAR deployment | Port 8080 Tomcat |
| 8081 | HTTP Alt | Jenkins, proxy alt port, admin panel exposed | Port 8081 HTTP Alt |
| 8443 | HTTPS Alt | Tomcat SSL, admin panel on HTTPS | Port 8443 HTTPS Alt |
| 8888 | Jupyter | Jupyter Notebook RCE — no auth by default | Port 8888 Jupyter |
| 9000 | PHP-FPM/SonarQube | PHP-FPM RCE via FastCGI, SonarQube unauthenticated | Port 9000 PHP-FPM |
| 9090 | Web Console | Cockpit, Prometheus, Portainer — admin interface | Port 9090 Web Console |
| 9999 | Dev Alt | Dev server non-standard port | 9999 port |
| 10000 | Webmin | Webmin RCE, credential brute force, HTTPS panel | Port 10000 Webmin |
| 50000 | SAP | SAP ICM, ABAP code execution, admin access | Bring 50000 SAP |
Database #
Often directly accessible on the internal network—misconfiguration, default credentials, no firewall between VLANs. Each DBMS has its own approach: know the specific commands before attacking.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 1433 | MSSQL | xp_cmdshell RCE, linked servers, Impacket mssqlclient | Port 1433 MSSQL |
| 1521 | Oracle infrastructures | TNS poisoning, SID enumeration, credential brute | Oracle Port 1521 |
| 2483 | Oracle TLS | Oracle DB over standard TLS | Oracle DB Port 2483 |
| 2484 | Oracle SSL | Oracle over SSL | Oracle SSL Port 2484 |
| 3306 | MySQL | Credential brute, UDF exploit, file read via LOAD DATA | MySQL Port 3306 |
| 5432 | PostgreSQL | COPY TO/FROM exploit, RCE via extension | Port 5432 PostgreSQL |
| 6379 | Redis | No-auth RCE, SSH key write, cron job injection | Port 6379 Redis |
| 7474 | Neo4j | Cypher injection, browser console without authentication | Port 7474 Neo4j |
| 9200 | Elasticsearch | No-auth data dump, RCE via Groovy/Painless script | Port 9200 Elasticsearch |
| 9300 | Elasticsearch Cluster | Transport layer, node communication | Port 9300 Elasticsearch Cluster |
| 11211 | Memcached | No-auth cache dump, SSRF amplification DDoS | Port 11211 Memcached |
| 27017 | MongoDB | No-auth data dump, JavaScript injection | Port 27017 MongoDB |
| 27018 | MongoDB Cluster | Shard/replica set, cluster communication | Port 27018 MongoDB Cluster |
| 28017 | MongoDB HTTP | Legacy HTTP interface, data exposure | Port 28017 MongoDB HTTP |
Mail Services #
Mail servers expose cleartext credentials on ports 110 and 143, allow user enumeration via SMTP, and in AD environments are vectors for internal phishing and credential stuffing. Underestimated, often unpatched.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 25 | SMTP | VRFY/EXPN user enumeration, open relay, phishing chain | SMTP Port 25 |
| 110 | POP3 | Cleartext credentials, brute force, mailbox dump | Port 110 POP3 |
| 143 | IMAP | Credential sniffing, brute force, email exfiltration | IMAP Port 143 |
| 465 | SMTPS | SMTP over SSL, relay abuse via authentication | Port 465 SMTPS |
| 587 | SMTP Submission | Auth SMTP, credential brute force | Port 587 SMTP Submission |
| 995 | POP3S | POP3 over TLS, same carriers as 110 | Port 995 POP3S |
VPN & Proxy #
Ports found when an organization exposes remote access. Often misconfigured, often with weak PSKs or credentials. An open proxy is an immediate pivot vector to the internal network. In enterprise environments, misconfigured PPTP and OpenVPN are still common.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 500 | ISAKMP/IKE | VPN fingerprinting, offline PSK cracking, aggressive mode | Port 500 ISAKMP |
| 1080 | SOCKS Proxy | Open proxy, pivoting towards internal network | Port 1080 SOCKS Proxy |
| 1194 | openvpn | Config leak, credential brute force | OpenVPN Port 1194 |
| 1723 | PPTP | MS-CHAPv2 offline crack, PSK attack | Port 1723 PPTP |
| 3128 | Squid Proxy | Open proxy abuse, SSRF amplification | Port 3128 Squid Proxy |
| 4500 | IPSec NAT-T | IPSec NAT traversal, VPN bypass | Port 4500 IPSec NAT-T |
Network & Infrastructure #
SNMP on 161 with the community string "public" is still the most common finding in enterprise assessments. IPMI on 623 often leads to direct root on the BMC. Misconfigured DNS results in complete zone transfers. These ports are rarely monitored—use them for passive intelligence before any noisy actions.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 53 | DNS | Zone transfer, DNS rebinding, cache poisoning | DNS |
| 67 | DHCP | Rogue DHCP server, DNS poisoning via option 15 | DHCP Port 67 |
| 161 | SNMP | Community string dump, MIB walk, full device config | SNMP |
| 162 | SNMP trap | Unauthenticated notifications, passive intelligence | Port 162 SNMP Trap |
| 179 | BGP | Route injection, BGP hijacking, topology disclosure | Port 179 BGP |
| 515 | LPD | Print server abuse, file read, info disclosure | Port 515 LPD |
| 520 | RIP | Route injection, network topology disclosure | Port 520 RIP |
| 554 | RTSP | Camera stream access, no-auth live feed | Port 554 RTSP |
| 623 | IPMI | BMC credential dump, RAKP hash offline crack | IPMI Port 623 |
| 631 | IPP/CUPS | Print server exploitation, SSRF via IPP | Port 631 IPP/CUPS |
DevOps & Cloud #
Containers, orchestrators, message brokers—the modern attack surface. Often accessible without authentication in misconfigured cloud environments or exposed dev servers in production.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 2181 | Zookeeper | No-auth config dump, data exfiltration | Door 2181 Zookeeper |
| 2376 | Docker SSL | Docker daemon RCE, container escape | Port 2376 Docker SSL |
| 4040 | Spark UI | Job info leak, data exposure, RCE via script | Spark UI Port 4040 |
| 5000 | Docker/Flask | Docker registry unauthenticated, Flask debug RCE | Docker/Flask · UPnP/Flask/Registry |
| 5601 | kibana | Dashboard access, Timelion RCE pre-7.6 | Door 5601 Kibana |
| 5672 | Rabbit MQ | Default credentials guest/guest, message queue dump | Port 5672 RabbitMQ |
| 6443 | Kubernetes API | No-auth API server, RBAC bypass, privileged pod escape | Kubernetes API Port 6443 |
| 9092 | Kafka | No-auth topic dump, producer message injection | Door 9092 Kafka |
| 15672 | RabbitMQ Web | Admin panel with default guest/guest | Port 15672 RabbitMQ Web |
| 16010 | HBase | HBase Master UI, no-auth data access | Port 16010 HBase |
| 50070 | Hadoop NameNode | HDFS file system access, data exfiltration | Port 50070 Hadoop NameNode |
| 61616 | ActiveMQ | Deserialization RCE (CVE-2023-46604) | Port 61616 ActiveMQ |
Legacy & Less Common #
Ports you encounter on older systems, network devices, and legacy enterprise environments. Don't ignore them—they're often the most vulnerable because they're unmonitored and unpatched.
| Port | Protocol | Offensive vector | Guide |
|---|---|---|---|
| 37 | Time | Timestamp manipulation, recon on legacy systems | Door 37 Time |
| 42 | WINS | Legacy NetBIOS name resolution, hostname disclosure | Port 42 WINS |
| 43 | WHOIS | Domain OSINT, registrar and admin contact disclosure | Port 43 WHOIS |
| 49 | TACACS | Auth server interception, credential leak | Door 49 TACACS |
| 90 | PointCast | Legacy push media server | Port 90 PointCast |
| 95 | SUPDUP | Legacy terminal protocol | Door 95 SUPDUP |
| 113 | ID | Username disclosure, legacy OS fingerprinting | Door 113 Ident |
| 119 | NNTP | Newsgroup server, credential leak plaintext | Port 119 NNTP |
| 194 | IRC | Command & Control legacy, covert channel botnet | Port 194 IRC |
| 199 | SMUX | SNMP multiplexer, subagent enumeration | Port 199 SMUX |
| 902 | VMware | ESXi API, VM enumeration, auth service | VMware Port 902 |
| 912 | VMware Auth | VMware Auth Service Secondary | 912 port |
| 1352 | Lotus Notes | Domino server, credential theft, formula injection | Port 1352 Lotus Notes |
| 1604 | Citrix ICA | Citrix session hijacking, credential interception | Port 1604 Citrix ICA |
| 1812 | RADIUS Auth | Shared secret cracking, credential interception | Port 1812 RADIUS Auth |
| 1813 | RADIUS Accounting | RADIUS accounting info leak | Port 1813 RADIUS Accounting |
| 1883 | MQTT | IoT broker no-auth, message dump, device control | Port 1883 MQTT |
| 1900 | SSDP/UPnP | UPnP exploitation, automatic port forwarding abuse | Port 1900 SSDP UPnP |
| 1947 | HASP | License server exploitation, DoS | Door 1947 HASP |
| 1984 | BigBrother | Monitoring server info disclosure | Door 1984 BigBrother |
| 1990 | UPnP Alt | UPnP alternative port | Port 1990 UPnP |
| 1991 | cPanel Alt | cPanel alternative port | Port 1991 cPanel |
| 1993 | SNMP Inform | SNMP inform message | Port 1993 SNMP Inform |
| 2082 | cPanel HTTP | cPanel hosting panel | Port 2082 cPanel |
| 2083 | cPanel HTTPS | cPanel over SSL | Port 2083 cPanel SSL |
| 2701 | TVersity | Legacy media server, info disclosure | Door 2701 TVersity |
| 3478 | STUN | NAT traversal, WebRTC IP leak | Door 3478 STUN |
| 6667 | IRC | C2 channel, botnet, covert exfiltration | Port 6667 IRC |
Essential tools #
| tool | Main use | Guide |
|---|---|---|
| Nmap | Port scan, version detection, NSE scripts | Nmap |
| Netcat | Banner grab, connection test, reverse shell | Netcat |
| Hydra | Multi-protocol brute force | Hydra |
| Reply | NTLM hash capture on 137/138/139/445 | Reply |
| Packet | SMB, Kerberos, MSSQL, RPC, WMI via Python | Packet |
| NetExec | Enumeration and lateral movement Windows | NetExec |
| CrackMapExec | AD enumeration, spray, exec on Windows network | CrackMapExec |
| blood hound | Attack path mapping on Active Directory | blood hound |
| Wireshark | Traffic analysis, credential capture | Wireshark |
| Patator | Modular multi-protocol brute force | Patator |
| tcpdump | Packet capture CLI, passive recon | tcpdump |
Related Hubs #
| Hub | What it covers |
|---|---|
| Tool Penetration Testing | All offensive tools per phase — recon, exploitation, AD, pivoting, with real attack chains |
| Web Vulnerabilities & Attack Techniques | SQL injection, XSS, SSRF, SSTI, LFI and all web hacking |
For professional penetration testing on real infrastructures, discover HackIta's services.








