networking

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

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.

bash
# 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.1

Index #


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 #

ProtocolOSI layerOffensive vectorGuide
TCPTransportSYN stealth scan, TCP reset, port scanningTCP
UDPTransportUDP scan, amplification, protocol abuseUDP
SCTPTransportPort scan evasion, protocol fingerprintingSCTP
HERE CTransportTLS inspection bypass, DNS leakHERE C
IPMeshIP spoofing, fragmentation, TTL manipulationIP
IPv4 / IPv6MeshDual-stack bypass, IPv6 SLAAC attackIPv4 / IPv6
ICMPMeshPing sweep, ICMP tunneling, redirect attackICMP
ARPData linkARP spoofing, ARP poisoning, MITM on LANARP
RARPData linkReverse ARP, legacy network reconRARP
GREMeshC2 tunneling, firewall bypassGRE
IPSecMeshIKE fingerprinting, PSK cracking, VPN bypassIPSec
TLS / SSLIntroductionBEAST, POODLE, Heartbleed, downgrade attackTLS / SSL
HTTP / HTTPSApplicationInjection, auth bypass, header manipulationHTTP / HTTPS
NTPApplicationNTP amplification DDoS, time manipulationNTP

LAN, switching and routing #

ProtocolOSI layerOffensive vectorGuide
Ethernet/802.3Data linkMAC flooding, CAM table overflowEthernet
VLANData linkVLAN hopping, double tagging, DTP attackVLAN
STPData linkRoot bridge takeover, BPDU spoofingSTP
LLDPData linkPassive topology mapping, neighbor disclosureLLDP
OSPF/EIGRP/BGP/RIPMeshRoute injection, neighbor spoofingOSPF/EIGRP/BGP/RIP
VRRP/HSRP/CARPMeshVirtual router takeover, MITM gatewayVRRP/HSRP/CARP
PPPsData linkMS-CHAPv2 crack, credential interceptionPPPs
802.11 WiFiPhysics/Data linkWPA2 PMKID crack, evil twin, deauth802.11 WiFi

Network attack techniques #

TechnologyDescriptionGuide
SniffingCapture clear traffic, passive credential harvestingSniffing
Man-in-the-MiddleLAN/WAN traffic interception and manipulationMan-in-the-Middle
VPNBypass, split tunnel abuse, credential theftVPN

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.

PortProtocolOffensive vectorGuide
88KerberosAS-REP Roasting, Kerberoasting, Silver/Golden TicketKerberos
135RPCNull session, WMI exec, lateral movement via DCOMPort 135 RPC
137NetBIOS-NSResponder, NBT-NS poisoning, NTLM hash captureNetBIOS Port 137
138NetBIOS-DGMBroadcast monitoring, passive host discoveryPort 138 NetBIOS Datagram
139NetBIOS-SSNNull session, SMB legacy, EternalBluePort 139 NetBIOS Session
389LDAPAD enumeration, dump users/groups/GPOs without authLDAP Port 389
445SMBPass-the-Hash, NTLM relay, share enumeration, PsExecSMB
593RPC over HTTPRPC tunneling over HTTP, perimeter firewall bypassPort 593 RPC-HTTP
636LDAPSLDAP over TLS, ADCS ESC relay attacksLDAPS Port 636
880Kerberos AdminTicket management, Kerberos administrationPort 880 Kerberos Admin
1025MS-RPCRPC endpoint mapper, dynamic RPC servicesPort 1025 MS-RPC
1026RPCSecondary Dynamic RPCPort 1026 RPC
1434MSSQL MonitorUDP — instance discovery, version detectionPort 1434 MSSQL Monitor
3389RDPBlueKeep, credential brute force, relay attackPort 3389 RDP
5985WinRM HTTPEvil-WinRM, PowerShell Remoting, lateral movementPort 5985 WinRM
5986WinRM HTTPSWinRM over TLS, bypass network filteringPort 5986 WinRM HTTPS
33389RDP AlternateRDP on non-standard port, stealth accessPort 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.

PortProtocolOffensive vectorGuide
20FTP DataActive mode exploitation, unencrypted data channelPort 20 FTP Data
21FTPAnonymous login, weak credentials, webshell uploadFTP Port 21
22SSHBrute force, key leak, port forwarding, SFTP abuseSSH
23telnetClear credentials, banner grab, legacy deviceTelnet Port 23
111RPCbindNFS enumeration, NIS credential dump, UID bypassPort 111 RPCbind
512RexecRemote execution without encryptionRexec Port 512
513loginRemote login legacy, .rhosts bypass without passwordPort 513 Rlogin
514RSH/SyslogRemote shell without auth, log poisoning, RCEPort 514 Syslog/RSH
989FTPS DataFTP over TLS — data channelPort 989 FTPS Data
990FTPSEncrypted FTP, same vectors as 21 over TLSPort 990 FTPS
2049NFSAnonymous mount, UID bypass, SSH key dump and hashNFS Port 2049
3260iSCSIStorage network access, unauthorized disk mountingiSCSI Port 3260
3632DistccRCE via distributed compiler — classical vector HTBDoor 3632 Distcc
3690SVNAnonymous repository dump, credentials in commit historyPort 3690 SVN
5900VNCBrute-force passwords, desktop session without authenticationPort 5900 VNC
6000X11X display hijacking, keystroke capture, screenshotsPort 6000 X11
9418GoPublic repository dump, credential leak in historyGit 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.

PortProtocolOffensive vectorGuide
80HTTPSQLi, XSS, LFI, RFI, SSRF, brute force directoriesHTTP Port 80
443HTTPSTLS misconfiguration, ADCS HTTP endpointPort 443 HTTPS
7001WebLogicDeserialization RCE, default credentials, T3 protocolWebLogic Port 7001
7002WebLogic SSLWebLogic on TLS, same vectors as 7001Port 7002 WebLogic SSL
7070RealServerStreaming server misconfigurationPort 7070 RealServer
7777Oracle AppsOracle E-Business Suite, admin consolePort 7777 Oracle Apps
8000HTTP AltDev server exposed — Flask, Django, FastAPI debug modePort 8000 Web Dev
8008HTTP AltProxies, IoT webcams, embedded interfacesPort 8008 HTTP Alt
8080TomcatTomcat manager RCE, unauthorized WAR deploymentPort 8080 Tomcat
8081HTTP AltJenkins, proxy alt port, admin panel exposedPort 8081 HTTP Alt
8443HTTPS AltTomcat SSL, admin panel on HTTPSPort 8443 HTTPS Alt
8888JupyterJupyter Notebook RCE — no auth by defaultPort 8888 Jupyter
9000PHP-FPM/SonarQubePHP-FPM RCE via FastCGI, SonarQube unauthenticatedPort 9000 PHP-FPM
9090Web ConsoleCockpit, Prometheus, Portainer — admin interfacePort 9090 Web Console
9999Dev AltDev server non-standard port9999 port
10000WebminWebmin RCE, credential brute force, HTTPS panelPort 10000 Webmin
50000SAPSAP ICM, ABAP code execution, admin accessBring 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.

PortProtocolOffensive vectorGuide
1433MSSQLxp_cmdshell RCE, linked servers, Impacket mssqlclientPort 1433 MSSQL
1521Oracle infrastructures TNS poisoning, SID enumeration, credential bruteOracle Port 1521
2483Oracle TLSOracle DB over standard TLSOracle DB Port 2483
2484Oracle SSLOracle over SSLOracle SSL Port 2484
3306MySQLCredential brute, UDF exploit, file read via LOAD DATAMySQL Port 3306
5432PostgreSQLCOPY TO/FROM exploit, RCE via extensionPort 5432 PostgreSQL
6379RedisNo-auth RCE, SSH key write, cron job injectionPort 6379 Redis
7474Neo4jCypher injection, browser console without authenticationPort 7474 Neo4j
9200ElasticsearchNo-auth data dump, RCE via Groovy/Painless scriptPort 9200 Elasticsearch
9300Elasticsearch ClusterTransport layer, node communicationPort 9300 Elasticsearch Cluster
11211MemcachedNo-auth cache dump, SSRF amplification DDoSPort 11211 Memcached
27017MongoDBNo-auth data dump, JavaScript injectionPort 27017 MongoDB
27018MongoDB ClusterShard/replica set, cluster communicationPort 27018 MongoDB Cluster
28017MongoDB HTTPLegacy HTTP interface, data exposurePort 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.

PortProtocolOffensive vectorGuide
25SMTPVRFY/EXPN user enumeration, open relay, phishing chainSMTP Port 25
110POP3Cleartext credentials, brute force, mailbox dumpPort 110 POP3
143IMAPCredential sniffing, brute force, email exfiltrationIMAP Port 143
465SMTPSSMTP over SSL, relay abuse via authenticationPort 465 SMTPS
587SMTP SubmissionAuth SMTP, credential brute forcePort 587 SMTP Submission
995POP3SPOP3 over TLS, same carriers as 110Port 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.

PortProtocolOffensive vectorGuide
500ISAKMP/IKEVPN fingerprinting, offline PSK cracking, aggressive modePort 500 ISAKMP
1080SOCKS ProxyOpen proxy, pivoting towards internal networkPort 1080 SOCKS Proxy
1194openvpnConfig leak, credential brute forceOpenVPN Port 1194
1723PPTPMS-CHAPv2 offline crack, PSK attackPort 1723 PPTP
3128Squid ProxyOpen proxy abuse, SSRF amplificationPort 3128 Squid Proxy
4500IPSec NAT-TIPSec NAT traversal, VPN bypassPort 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.

PortProtocolOffensive vectorGuide
53DNSZone transfer, DNS rebinding, cache poisoningDNS
67DHCPRogue DHCP server, DNS poisoning via option 15DHCP Port 67
161SNMPCommunity string dump, MIB walk, full device configSNMP
162SNMP trapUnauthenticated notifications, passive intelligencePort 162 SNMP Trap
179BGPRoute injection, BGP hijacking, topology disclosurePort 179 BGP
515LPDPrint server abuse, file read, info disclosurePort 515 LPD
520RIPRoute injection, network topology disclosurePort 520 RIP
554RTSPCamera stream access, no-auth live feedPort 554 RTSP
623IPMIBMC credential dump, RAKP hash offline crackIPMI Port 623
631IPP/CUPSPrint server exploitation, SSRF via IPPPort 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.

PortProtocolOffensive vectorGuide
2181ZookeeperNo-auth config dump, data exfiltrationDoor 2181 Zookeeper
2376Docker SSLDocker daemon RCE, container escapePort 2376 Docker SSL
4040Spark UIJob info leak, data exposure, RCE via scriptSpark UI Port 4040
5000Docker/FlaskDocker registry unauthenticated, Flask debug RCEDocker/Flask · UPnP/Flask/Registry
5601kibanaDashboard access, Timelion RCE pre-7.6Door 5601 Kibana
5672Rabbit MQDefault credentials guest/guest, message queue dumpPort 5672 RabbitMQ
6443Kubernetes APINo-auth API server, RBAC bypass, privileged pod escapeKubernetes API Port 6443
9092KafkaNo-auth topic dump, producer message injectionDoor 9092 Kafka
15672RabbitMQ WebAdmin panel with default guest/guestPort 15672 RabbitMQ Web
16010HBaseHBase Master UI, no-auth data accessPort 16010 HBase
50070Hadoop NameNodeHDFS file system access, data exfiltrationPort 50070 Hadoop NameNode
61616ActiveMQDeserialization 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.

PortProtocolOffensive vectorGuide
37TimeTimestamp manipulation, recon on legacy systemsDoor 37 Time
42WINSLegacy NetBIOS name resolution, hostname disclosurePort 42 WINS
43WHOISDomain OSINT, registrar and admin contact disclosurePort 43 WHOIS
49TACACSAuth server interception, credential leakDoor 49 TACACS
90PointCastLegacy push media serverPort 90 PointCast
95SUPDUPLegacy terminal protocolDoor 95 SUPDUP
113IDUsername disclosure, legacy OS fingerprintingDoor 113 Ident
119NNTPNewsgroup server, credential leak plaintextPort 119 NNTP
194IRCCommand & Control legacy, covert channel botnetPort 194 IRC
199SMUXSNMP multiplexer, subagent enumerationPort 199 SMUX
902VMwareESXi API, VM enumeration, auth serviceVMware Port 902
912VMware AuthVMware Auth Service Secondary912 port
1352Lotus NotesDomino server, credential theft, formula injectionPort 1352 Lotus Notes
1604Citrix ICACitrix session hijacking, credential interceptionPort 1604 Citrix ICA
1812RADIUS AuthShared secret cracking, credential interceptionPort 1812 RADIUS Auth
1813RADIUS AccountingRADIUS accounting info leakPort 1813 RADIUS Accounting
1883MQTTIoT broker no-auth, message dump, device controlPort 1883 MQTT
1900SSDP/UPnPUPnP exploitation, automatic port forwarding abusePort 1900 SSDP UPnP
1947HASPLicense server exploitation, DoSDoor 1947 HASP
1984BigBrotherMonitoring server info disclosureDoor 1984 BigBrother
1990UPnP AltUPnP alternative portPort 1990 UPnP
1991cPanel AltcPanel alternative portPort 1991 cPanel
1993SNMP InformSNMP inform messagePort 1993 SNMP Inform
2082cPanel HTTPcPanel hosting panelPort 2082 cPanel
2083cPanel HTTPScPanel over SSLPort 2083 cPanel SSL
2701TVersityLegacy media server, info disclosureDoor 2701 TVersity
3478STUNNAT traversal, WebRTC IP leakDoor 3478 STUN
6667IRCC2 channel, botnet, covert exfiltrationPort 6667 IRC

Essential tools #

toolMain useGuide
NmapPort scan, version detection, NSE scriptsNmap
NetcatBanner grab, connection test, reverse shellNetcat
HydraMulti-protocol brute forceHydra
ReplyNTLM hash capture on 137/138/139/445Reply
PacketSMB, Kerberos, MSSQL, RPC, WMI via PythonPacket
NetExecEnumeration and lateral movement WindowsNetExec
CrackMapExecAD enumeration, spray, exec on Windows networkCrackMapExec
blood houndAttack path mapping on Active Directoryblood hound
WiresharkTraffic analysis, credential captureWireshark
PatatorModular multi-protocol brute forcePatator
tcpdumpPacket capture CLI, passive recontcpdump

Related Hubs #

HubWhat it covers
Tool Penetration TestingAll offensive tools per phase — recon, exploitation, AD, pivoting, with real attack chains
Web Vulnerabilities & Attack TechniquesSQL injection, XSS, SSRF, SSTI, LFI and all web hacking

For professional penetration testing on real infrastructures, discover HackIta's services.

#Penetration-Testing #Port-Scanning #Network-Hacking

leave a message

I'm not a robot