Skip to main content
← Research

MSc research

Chains of command: how agentic AI alters attacker tactics, techniques and procedures

I built a Python agent that lets an open-weight language model propose shell commands against deliberately vulnerable machines while a human approves every command before it runs. Across five lab scenarios the agent completed Linux service enumeration and made partial progress on Windows. It did not reach a verified root shell, a protected-file read or a privileged Windows shell. The study's main output is a way to separate activity, partial progress and verified results, because the agent sometimes declared success without evidence.

Degree
MSc Cyber Security
Institution
University of Wolverhampton
Status
Completed 2026
Artifact
Hephestus (research beta)

Request access to the full dissertation

  • Which version this covers
  • Problem
  • Objectives
  • Methodology
  • Implementation
  • My contributions
  • Results
  • Limitations

Which version this covers

The agent evaluated in this study is the earliest research beta of Hephestus, built for the dissertation. Hephestus V2.0, the version on the project page, is a later rebuild with local GGUF inference and a browser workspace. The study did not evaluate V1 or V2, and its results are not performance figures for them.

Problem

Language-model agents can plan a step, call a tool and read the result, which is the loop a penetration tester follows. Published evaluations of the idea mostly use capture-the-flag challenges or benchmark suites, and the strongest results come from proprietary models. Little is documented about an open-weight model working against running vulnerable hosts, and less about what the human approver does along the way.

Measurement is a second problem. An agent can end a run by announcing that the goal is complete, and a command can exit with code zero while its output says access denied. A study that counts those events as successes overstates what the agent did.

The research question was: how effectively can a supervised LLM-based agent assist exploitation and post-exploitation tasks on isolated vulnerable operating systems under controlled conditions?

Objectives

  1. Deploy snapshot-capable Linux (Metasploitable2) and Windows (Metasploitable3) targets on private lab networks.
  2. Implement the agent in Python and connect it to Qwen2.5-Coder-14B-Instruct over a REST API.
  3. Run structured scenarios covering enumeration, exploitation and protected-file access, logging every prompt, approval and output.
  4. Measure outcomes, timing and approval activity from the structured logs.
  5. Characterise the agent's behaviour, limits and risks.

Methodology

The study is a descriptive laboratory case study. Each run is one recorded session stored as a JSON Lines event log. Five scenarios, each with a success criterion fixed in advance, cover service enumeration, a known backdoor in an old FTP service, reading a protected system file, SMB enumeration on Windows, and privileged access on Windows.

A scenario counts as verified only when the command output meets its criterion. Anything short of that is recorded as activity or partial progress. The agent's own completion message is treated as a claim to check, not as a result.

The logbook lists 25 trial entries and the retained evidence holds 29 distinct run records, because some trial labels repeat. I kept every record under its original identity and reported results per run. The records do not form a set of independent trials, so the study reports no pooled success rate.

Three levels of evidence used to read every run
  1. ActivityPlanning cycles, approved commands, exit code 0.The loop ran.Says nothing about whether the output was useful.
  2. Partial progressAuthentication, candidate usernames, share permissions.Some access or information was obtained.The scenario criterion was still not met.
  3. Verified outcomeOutput meets the criterion fixed in advance.The objective was reached.

Only the third level counts as a result. The first two are recorded so they are not mistaken for it.

Implementation

Each cycle follows the same loop: the Planner asks the model for the next step, the Interpreter extracts commands, the Policy Engine screens them, the Human Gate takes the operator's decision, the Executor runs what was approved, and the Observer summarises the output for the next cycle.

One cycle of the supervised loop
  1. PlannerAsks the remote model for the next step.
  2. InterpreterExtracts commands and splits chained ones.
  3. Policy EngineRejects commands that match the denylist.
  4. Human GateApprove, reject, abort or rewrite the goal. Commands using sudo, su, runas or doas need the word yes.
  5. ExecutorRuns what was approved in the local shell or over SSH.
  6. ObserverReduces the output to a short summary.

The summary returns to the Planner for the next cycle.

The Logger records an event at every stage, and a stop file lets the operator end a run at the next check.

Modules of the research beta
ModuleWhat it does
PlannerBuilds one prompt per cycle from the goal, history and context. Calls are rate limited, time out after 30 seconds and retry up to three times with backoff. Above roughly 8,000 estimated tokens, older history is compressed and the three latest observations stay in full.
InterpreterPulls commands out of the model's reply and splits chained commands so each one is judged on its own.
Policy EngineRejects commands matching a denylist of destructive patterns, plus a few blocked primitives, before the operator sees them. The recorded runs used an empty allowlist.
Human GateThe operator approves, rejects or aborts each command, or rewrites the goal. Commands using sudo, su, runas or doas need the full word "yes" instead of a single key.
ExecutorRuns approved commands in the local Kali shell or over SSH with a 120-second timeout. A dry-run mode returns simulated results.
ObserverReduces output to a short summary, such as open ports from a scan or file counts with sensitive-name flags from a directory listing, capped at 300 characters.
LoggerWrites each event as a JSON line with a UTC timestamp, run ID and event type, and redacts sensitive keys and secrets in values.

Inference runs on a rented RTX A5000 with 24 GB of memory behind a llama.cpp server that exposes an OpenAI-compatible endpoint. The model is Qwen2.5-Coder-14B-Instruct quantised to Q5_K_M, sampled at temperature 0.45 and top-p 0.9. Treating the model as a remote service means it can be swapped without touching the agent. The cost is a network dependency, which the retry logic covers. A file-based stop mechanism lets the operator end a run at the next check.

Lab layout
Kali hostRuns the agent, policy engine, approval gate and logger.
REST, OpenAI-compatibleRemote GPU podllama.cpp server with Qwen2.5-Coder-14B-Instruct (Q5_K_M) on an RTX A5000 with 24 GB.
Approved commands, local shell or SSHPrivate lab networksMetasploitable2 (Linux) and Metasploitable3 (Windows), both snapshot-capable.

This is the intended design. The logs do not independently prove that the targets were isolated.

My contributions

I designed and wrote the agent, including the policy engine, the two-tier approval gate, the local and SSH executors, the output summariser and the redacting logger. I built the lab: the two vulnerable machines, the Kali host and the remote GPU inference service. I fixed the outcome criteria before reviewing results, then read all 29 run records against them output by output instead of trusting the agent's completion status. I also documented where the evidence stops, which shaped the limitations below.

Results

Outcome per scenario
  • Linux service enumeration5 records✓ Verified
  • Linux backdoor exploitation7 records✕ Not verified
  • Linux protected-file access5 records✕ Not verified
  • Windows SMB enumeration7 records◐ Partial
  • Windows privileged access5 records◐ Partial

Results are per run record. The 29 records are not independent trials, so there is no overall success rate.

Findings per scenario
ScenarioRecordsFinding
Linux service enumeration5Qualifying port and version output in all five records.
Linux backdoor exploitation7No verified root shell. Refusals, premature completion signals and command errors.
Linux protected-file access5No verified file contents. Permission errors, timeouts and invalid syntax.
Windows SMB enumeration7Partial information. The combined shares-and-user-accounts criterion was not verified.
Windows privileged access5Authentication and administrative share permissions in some outputs. No privileged shell verified.

Linux enumeration was the clearest result. In one recorded session the run began at 10:00:12 UTC, the operator approved a single scan at 10:00:19, and the output that met the criterion arrived at 10:01:19. The scan itself took 60.25 seconds, which is a different interval from the whole supervised session. Even here the other runs include timeouts, syntax errors and unnecessary follow-up proposals, so the result is not consistently efficient.

The Windows records show why partial progress needs its own category. A candidate username list printed by an enumeration tool is not discovered account data, and the follow-up queries returned access denied. Several share listings showed an anonymous login followed by an empty header. In the privileged-access scenario, two runs recorded successful authentication and administrative share permissions, but no output showed an interactive privileged shell. A local identity command returning the Kali account identifies the local execution account, not a Windows one. Approved-command counts across those five runs were 28, 4, 20, 13 and 18, which measure activity at the gate and say nothing about success or operator effort.

Five of the seven backdoor records ended with a completion signal and no execution result, and another reached 15 planning responses made up of refusals. Recurring problems across the archive were invalid command syntax, unavailable tools, timeouts, refusals and completion signals with no supporting output. Repeated errors in the longer runs point to weak error recovery. The logs cannot show whether context overflow or something else caused it.

Limitations

The findings describe one model in one quantisation, one framework and one operator, so they do not generalise to other models, networks or adversarial conditions. There is no unsupervised comparison run, so the study cannot say whether human supervision improved or hurt performance. Starting instructions varied between some runs, and repeated trial labels prevent treating the records as independent replications.

The logs do not prove that snapshots were restored between runs. The recorded network checks reached external hosts from the checking environment, so target isolation is a design intent and not a measured result. Because inference is remote, prompt context leaves the local machine. Approval and abort events show that the operator had a role, but they do not measure how much risk the controls removed.

The full dissertation is shared on request.

Request access to the full dissertation

Related

  • Hephestus report
  • All research