Simulating a HexStrike AI Attack on a VPN Gateway: Can Typed Decisions Stop Session Hijacking?
A gateway flaw is disclosed in the morning. By lunchtime, an AI agent is exploiting it. HexStrike AI is an open-source framework that connects a large language model to more than 150 offensive security tools through MCP.
A gateway flaw is disclosed in the morning. By lunchtime, an AI agent is exploiting it. HexStrike AI is an open-source framework that connects a large language model to more than 150 offensive security tools through MCP. Security researchers reported attackers discussing how to use it to scan for and exploit newly disclosed Citrix NetScaler flaws within hours of disclosure, compressing work that used to take days into minutes.
This article simulates that kind of attack against a fictional company's remote-access gateway, and shows a defence loop that responds in seconds: a small decision model choosing from a closed list of actions, behind a validator that checks every choice against the evidence.
Results (Edge gateway tab, default settings)
- β Gateway takeover prevented. Without a defender, the agent creates its own admin account at T+0:13
- β Attack contained at T+0:07, and every later attempt failed
- β A human-only team with a 30- or 60-minute response time loses the gateway at T+0:13
- β 0 false containments and 0 legitimate events blocked in 288 replays across every setting
- β The company's own security vendor, running the same exploit check under a ticket, was never blocked
Educational project on synthetic data. The gateway flaw "GW-2026-0412" is fictional, and every company, user, address and ticket is made up. This models the publicly described behaviour of HexStrike AI; it is not affiliated with the HexStrike AI project, Citrix or ConvAI Innovations, and contains no attack tooling. The decision model, Laya, is built by ConvAI Innovations.
Live demo: https://vishalmysore.github.io/layaVsArtex/?domain=hexstrike Β· Code: https://github.com/vishalmysore/layaVsArtex
Why edge gateways are the first target
VPN and remote-access gateways sit on the internet by design, and they hold live sessions for everyone working remotely. When a flaw is disclosed, the race is between the patch and the scanner. An AI agent that can read the advisory, pick the right tool and run it removes most of the time defenders used to have.
The worst gateway flaws leak memory. The attacker does not need a password: the leaked memory contains session tokens that are already signed in, already past MFA. Replaying one looks like the real user continuing their work, except from a different address.
The simulated attack
| Minute | What the agent does | Without a defender |
|---|---|---|
| 0 | Scans the gateway: 6,800 requests to 1,450 paths | Recon done |
| 4 | Fires the published exploit pattern; the replies leak memory | Live session tokens stolen |
| 7 | Replays a finance analyst's session from a hosting provider | Inside as that user |
| 10 | Replays the network administrator's session | Admin access |
| 13 | Creates its own local admin account on the gateway | Gateway taken |
How the defence sees it
Every log event is written into an incident graph. A planner decides what changed, plain-code evidence workers collect the facts for each address or account, and the decision model, Laya (421M parameters, running in the browser), picks one action from a closed list for that entity:
address: NO_ACTION Β· MONITOR Β· BLOCK_IP
account: NO_ACTION Β· MONITOR Β· REQUIRE_MFA Β· REVOKE_SESSIONS Β· DISABLE_ACCOUNT
Before anything runs, a validator checks the choice: it must be on the list, cite evidence the workers actually found, and have at least one strong signal behind any action that takes access away.
The evidence workers grade what they see:
| Signal | Strength | Why |
|---|---|---|
| Thousands of requests to many paths | weak | The internet scans every gateway all day |
| Requests matching the published exploit pattern | strong | Someone is trying the flaw |
| A user's session used from a new address with no sign-in and no MFA prompt | strong | That is a stolen session token |
| An admin change with no change ticket | strong | Not how admins work |
| Exploit checks from a known vendor under an approved ticket | benign | Approved testing |
What happened
Minute 0: the scan is not enough. Laya chose to monitor the scanning address. Scanning alone is weak evidence, and blocking every scanner on the internet is not a strategy.
Minute 4: the exploit is. The same address sent 240 requests matching the published exploit pattern. Laya blocked it two seconds later, citing the exploit requests by event id.
That block came too late to stop the leak itself: the first exploit burst had already returned session tokens. This is the honest part of gateway defence. Containment limits what the attacker can do with what leaked; only patching stops the leak.
Minute 7: a stolen session. The finance analyst's session appeared from a new hosting-provider address, with no sign-in and no MFA prompt, while the real user was working from the head office. Laya blocked that address within 20 seconds.
Minute 10: the admin's session fails, and the defence learns from it. The agent tried the network administrator's stolen session from the same address, which was already blocked. That failed attempt became strong evidence on its own: someone was holding the admin's session. Laya revoked the administrator's sessions, so the stolen token went dead.
Minute 12: the agent rotates. It tried the admin's session again from a fresh address. The session was already revoked, so it failed, and Laya blocked the new address too. The admin account was never created.
Where the defence was weak
The finance analyst's stolen session was never revoked. Laya first chose to monitor the account, and the small LLM that reviews uncertain cases (System 2) then chose no action, even though the evidence said "used from a hosting provider with no new sign-in". The attack was still stopped, because the address was blocked and the agent did not try that token from anywhere else. A real deployment should revoke every session on a gateway after a confirmed memory leak, without waiting for each one to be used.
Restraint: patch night
The second scenario has no attacker, but it looks like one:
- The company's attack-surface vendor checks the gateway for the same flaw, including the exploit pattern, under ticket SEC-882.
- An internet scanner sweeps the gateway.
- The administrator installs the fixed firmware under change ticket CHG-1203.
- A user reconnects from home after the restart.
Laya proposed blocking both the vendor and the internet scanner. Neither block ran. The validator rejected both: the vendor's traffic was benign (approved, under a ticket) and the scanner's was weak (scanning only). Blocking the vendor also had a high blast radius, because it is a known network. Both were held, and the analyst chose to monitor.
The firmware change was recognised as approved work:
The scorecard
| Scenario | No defender | Human analysts only | Typed-decision loop |
|---|---|---|---|
| Day-one gateway exploit | gateway taken at 0:13 | stopped by a 10-minute analyst; taken at 0:13 with a 30- or 60-minute analyst | contained at 0:07 |
| Patch night | β | β | 0 legitimate users or vendors blocked |
Settings: gate Ο = 0.30, analyst answers in 30 minutes, small LLM on for held cases. With the gate at Ο β€ 0.4, the gateway takeover is stopped at every analyst speed, including with no analyst on shift. Across all 288 replays of this tab (18 gate settings Γ 4 analyst speeds Γ small LLM on or off, for both scenarios), there were no false containments and no legitimate events blocked.
What this means for defenders
- Patch first. Nothing here replaces patching. Containment buys time and limits damage; it does not close the hole.
- Treat a session used from a new address with no sign-in as a stolen token. That one signal catches session hijacking without needing to know which flaw leaked it.
- Let failed attempts count as evidence. The administrator's account was protected because a blocked attempt was still recorded and judged.
- Write approved testing down. The vendor's exploit check looked exactly like the attack. A ticket and a known network are what kept it from being blocked.
- Keep the model narrow. A 421M model choosing from three to five options, with every choice checked by code, is fast enough to keep up with an agent and narrow enough to audit.
Try it
Open https://vishalmysore.github.io/layaVsArtex/?domain=hexstrike, pick a scenario and press Play. Click any decision card to see exactly what Laya read, its options, its answers, and the validator's verdict. Then slide the gate to "never", untick System 2 and set the analyst to 30 minutes, and watch a human-only team lose the gateway at minute 13.
More screenshots
Blocking the address that used the stolen session:

The finance analyst's session: judged too softly:

An internet scanner: the block was rejected by the validator:

The log stream, with blocked attempts struck through:

Sources on HexStrike AI: Check Point, "HexStrike AI: When LLMs Meet Zero-Day Exploitation"; The Register, 3 September 2025. Check Point noted it had not confirmed actual attacks using the tool at the time. Laya typed-decisions model by ConvAI Innovations (Apache-2.0); System 2 via WebLLM. Educational project, synthetic data only.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.








