← Lab /AI/ML

LLM-driven framework exploits 84.3% of targets on Metasploitable 2

APT-Agent achieves an 84.29% end-to-end exploitation success rate on Metasploitable 2

AI/ML arXiv 24 May 2026 Method Prototype evidence

Published as “APT-Agent: Automated Penetration Testing using Large Language Models”

Why it matters

The demonstrated reliability suggests LLM-driven agents can autonomously conduct realistic penetration tests, reducing the need for expert manual effort in routine red-team engagements.

Summary

APT-Agent achieves an 84.29% end-to-end exploitation success rate on Metasploitable-2, far surpassing prior LLM-based pentesting systems (48.57% for Script Kiddie, 18.57% for PentestGPT). The paper reports 59 successful runs out of 70 across seven vulnerable services, but notes that 30.2% of generated Metasploit commands were still hallucinated and only 62.5% of those were corrected, with isolated failures on OpenSSH exfiltration and Telnet session handling.

What they found 3

  1. Overall end-to-end success rate of 84.29% across seven services.

    “The framework achieves an 84.29% endto-end exploitation success rate, substantially exceeding the performance range reported in prior LLM-based penetration testing systems [13], [14], [22].”

  2. Service-wise success counts: 10/10 vsftpd, 9/10 OpenSSH, PostgreSQL, Samba; 8/10 Telnet; 7/10 Apache and UnrealIRCd.

    “APT-Agent succeeded in all 10 runs on vsftpd 2.3.4, in 9 of 10 runs on OpenSSH 4.7, PostgreSQL, and Samba, in 8 of 10 on Telnet, and in 7 of 10 on both Apache 2.2.8 and UnrealIRCd, yielding an aggregate end-to-end success rate of 84.29% (59/70).”

  3. Hallucinated module generation occurs in 30.2% of invocations; the rectifier corrects 62.5% of those.

    “APT-Agent issued 53 Metasploit module invocations, 16 of which (30.2%) were hallucinated; the Rectification Module recovered 10 of these, yielding a 62.5% in-run correction rate.”

Caveats 5

  • The single failure on OpenSSH 4.7 was attributable to continuous duplicate command generation during exfiltration.
  • The two Telnet failures stemmed from session-retrieval errors, in which a remote access session was successfully spawned but APT-Agent failed to attach to and interact with it.
  • Despite the rectifier, 30.2% of generated Metasploit commands were still hallucinated, and only 62.5% of those were fixed.
  • Although the evaluation focused on RECON, EXPLOIT, and EXFILTRATE stages, the Tactic Selection Module and supporting components are readily extensible. Additional tactics defined in ATT&CK, such as lateral movement and privilege escalation, can be incorporated by extending decision rules and augmenting command/action templates, thereby enabling broader coverage of the attack lifecycle.
  • Future work will deploy APT-Agent in larger and more heterogeneous environments, such as multihost networks with interacting services and cross-machine attack paths.

What’s new here 4

  • A rectification module that validates and corrects hallucinated Metasploit commands using a hybrid fuzzy-suffix matching approach.
  • A stage-aware Context Management Module (CMM) that logs compact JSON entries of commands and binary outcomes to preserve long-term state across RECON, EXPLOIT, and EXFILTRATE.
  • Fully autonomous execution of the three core pentesting stages with minimal human intervention, leveraging GPT-4o as the reasoning engine.
  • Demonstrated >40% relative improvement in overall success rate compared to prior LLM frameworks.