You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/network-services-pentesting/ipsec-ike-vpn-pentesting.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,6 +328,43 @@ Practical tips
328
328
- Increase receive buffer and timeouts for UDP-based scanners to avoid packet loss.
329
329
- If the service exposes custom Vendor IDs (see section above), use them to quickly fingerprint vulnerable versions before attempting any exploit traffic.
RFC 7383 fragmentation (`SKF`, payload type `0x35`) is a good place to look for **pre-auth memory corruption** in IKEv2 implementations. Reassembly code often builds a temporary packet context, copies state from the long-lived SA object, and reinjects the reassembled message into later parsing stages. If some fields are **deep-copied** while embedded pointers are only **shallow-copied**, packet-context cleanup can free memory still owned by the SA, and the same allocation can be freed again later during SA teardown.
334
+
335
+
Real-world pattern seen in Windows IKEEXT:
336
+
- During `IKE_SA_INIT`, a Vendor ID handler allocates a blob tied to the SA.
337
+
- A fragmented `IKE_AUTH` is reassembled and queued for async processing.
338
+
- The queueing path deep-copies the reassembly buffer but leaves the SA-owned blob pointer aliased inside the queued packet context.
339
+
- Destroying the queued context frees the aliased pointer first.
340
+
- Negotiation cleanup later tears down the original SA and frees the same pointer again, yielding a **double free** reachable from the network.
341
+
342
+
Practical auditing notes:
343
+
- Treat **fragment reassembly + reinjection + async work queues** as one attack surface, not separate features.
344
+
- Compare which fields are deep-copied versus shallow-copied when packet contexts are queued to worker threads.
345
+
- Check whether invalid reassembled messages still traverse cleanup paths. A malformed `IKE_AUTH` may still be enough if reassembly and queue teardown happen before semantic validation fails.
346
+
- For Windows targets, the reachable service is typically **IKEEXT** listening on **UDP/500** and **UDP/4500** (NAT-T), so successful exploitation targets a privileged network-facing service.
347
+
348
+
### Detection notes for fragmentation-driven IKEv2 exploitation
349
+
350
+
This pattern is **stateful**. A single packet is not enough; correlate packets within the same IKE session:
351
+
352
+
1. Look for an `IKE_SA_INIT` request that contains a vendor-specific setup payload. In the Windows case study, the write-up keys on:
-[ZDI - CVE-2026-33824: Remote Code Execution in Windows IKEv2](https://www.thezdi.com/blog/2026/4/22/cve-2026-33824-remote-code-execution-in-windows-ikev2)
386
+
-[RFC 7383 - Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation](https://datatracker.ietf.org/doc/rfc7383/)
0 commit comments