Attackers who already control a device can turn Claude Code agents into live command-and-control (C2) implants.
They used the Claude platform’s own memory stores feature. Darktrace stresses that the work was done in a controlled lab and does not rely on a vulnerability in the Claude platform.
Darktrace argues that enterprise AI agents are the next such opportunity. An agent given access to an organization’s systems can be steered with plain-language instructions and acts with the privileges of a trusted insider.
Credential stealers such as QUIETVAULT, s1ngularity, SANDWORM_MODE and DUSTMAKER already hand credential collection to on-device AI agents.
Those cases lack a feedback loop, because the attacker cannot see results and adjust instructions in real time.
Memory stores are collections of text files scoped to a Claude Console workspace. They are managed through the console or the API at api.anthropic.com.
With stolen API credentials, an attacker can create a store and three files: heartbeat, input and output.
The C2 flow between the C2 operator’s infrastructure and the co-opted Claude Code agent (Source : Darktrace).
Darktrace Researchers said that, Living-off-the-land attacks abuse tools already present in an environment, which lets attackers avoid deploying new malware that might raise alarms.
Claude Code Memory Hijacked
Each Claude Code harness process checks in through the heartbeat file, then retrieves and runs a queued job from the input file. It posts its results to the output file. The operator reads those results and queues the next job.
This traffic goes to the same endpoint used for inference, so it looks like normal agent activity. The operator also needs less skill, because they set objectives in natural language and leave the agent to decide how to meet them.
The test environment modeled an Active Directory network with a Linux host running Claude Code, an SMB server and a domain controller.
A lightweight shell payload fetched through curl found the harness and stole the user’s API and OAuth credentials. It then used systemd-run to create a transient service that repeatedly launched Claude Code harness processes.
Those processes invoked Claude Sonnet 4.5 in non-interactive mode. After that the initial script was no longer needed.
Darktrace Advanced Search data showing a Claude Code process setting off a chain of process creation activity to perform initial network reconnaissance (Source : Darktrace).
The operator then dispatched nine jobs through the memory store. The agent ran network discovery with ip, ss, nc and nmap, and found a server at 192.168.1.2 with FTP, SMB and SSH open.
It pulled files from anonymous FTP that held employee details and a password. The agent generated 190 candidate usernames and sprayed the password over SMB, which identified the account greg.simon.
It then listed shares with smbclient and found a 1 GB file. The agent downloaded that file, split it into three parts and uploaded them through the Claude Files API at api.anthropic.com/v1/files.
Darktrace says defenders should correlate process creation with network activity for agent harness processes and compare both against behavioral baselines. Tool calls and API contact are normal for these agents.
Unusual command-line arguments or odd data-transfer ratios to the AI platform’s API are not, and those are the signals to watch.
Stops Cyber threats before impact with 21 min faster MTTR. Integrate ANYRUN’s Sandbox in your SOC.