Claude Code’s Trusted API Could Help Attackers Hide Malicious Commands and Data Theft

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


Researchers have shown that attackers can use the trusted Claude API to send hidden commands to AI coding agents and steal data.

The traffic looks like normal AI activity, so many security tools would not flag it. This matters because AI agents now run inside many company networks with wide access.

The method does not rely on a bug in Claude. An attacker must first break into a device and steal a user’s Claude Console credentials. After that, the attacker can use features that Claude already offers to control the agent in real time.

Analysts at Darktrace Signal Labs identified and demonstrated the technique in a lab on November 12, 2026. They say it has not been seen in real attacks yet.

Still, the idea builds on recent credential stealers that use AI tools found on infected machines, so defenders should take it seriously.

Claude Code’s Trusted API

Attackers often “live off the land,” which means they abuse tools already present on a system so they do not trigger alarms. Researchers now see the same pattern with AI.

An AI agent has trusted access, can run commands, and follows plain-language instructions, so it acts like an insider with a lot of power.

The Darktrace team used the memory stores feature of the Claude platform. Memory stores are groups of text files that agents can read and update across sessions.

Anyone with stolen API credentials can create a store in the user’s workspace through api.anthropic.com. The attacker then sets up three files. A heartbeat file records check-ins, an input file holds instructions, and an output file holds results.

Diagram depicting the C2 flow between the C2 operator’s infrastructure and the co-opted Claude Code agent (Source - Darktrace)
Diagram depicting the C2 flow between the C2 operator’s infrastructure and the co-opted Claude Code agent (Source – Darktrace)

Each time a Claude Code process starts on the infected device, it posts a check-in message. It then reads the queued job from the input file, runs it, and writes the results to the output file.

The attacker reads the results and queues the next job. Because this traffic goes to the same endpoint Claude uses for normal work, it blends in with everyday use.

Older stealers such as QUIETVAULT used local AI models to hunt for secrets. They could not react to what the AI found. This new method adds a live back-and-forth loop. It also lowers the skill needed, because the attacker can state a goal in plain words and let the agent work out the commands.

Inside the Lab Test: From Stolen Keys to Data Theft

The team built a test network modeled on a company Active Directory setup. It had a Linux device running Claude Code, an SMB file server, and a domain controller.

A small payload came from a staging server and ran shell commands through the dash interpreter. It found the Claude Code setup, collected API and OAuth credentials, and sent them back to the staging server.

The attacker then created the memory store and sent its details back to the device. A script used systemd-run to create a temporary service that kept launching Claude Code processes.

Each process used a Claude Sonnet 4.5 model in non-interactive mode. After that, the first script was no longer needed, and the attacker sent all further jobs through the memory store.

The operator sent nine jobs in total. The agent first scanned the local network and found a server at 192.168.1.2 with open FTP, SMB, and SSH ports.

An nmap scan followed, and the agent then pulled files from the anonymous FTP share, which held employee details and one password.

The agent also wrote a list of 190 likely usernames, then sprayed the password “pa55word” against the domain controller. That revealed the account greg.simon.

With that account, the agent listed SMB shares and found a 1 GB file. It downloaded the file, split it into three smaller parts, and uploaded them to the Claude Files API at https://api.anthropic.com/v1/files.

This hid the data theft inside normal-looking AI traffic. This kind of trusted-channel abuse is similar to poisoned software updates that steal developer and cloud credentials.

Blocking the Claude API is not realistic for teams that use it daily. Darktrace says defenders should watch how agent processes behave instead.

It is normal for agent processes to run tools and contact their AI provider. It is not normal for them to run odd command-line arguments or send much more data than usual to the API.

Teams should link process creation to network activity and compare it with a normal baseline. They should also protect Claude Console credentials, limit API key permissions, and rotate keys after any suspected breach.

Reviewing workspaces for unknown memory stores is a sensible check. Past cases such as the Nx build tool compromise showed that AI tools on developer machines are already a target.

Indicators of compromise (IoCs):-

Type Indicator Description
IP address 192.168.1.2 Lab server with open FTP, SMB, and SSH ports, also used as the domain controller
URL https://api.anthropic.com/v1/files Claude Files API endpoint used to exfiltrate the 1 GB file
Domain api.anthropic.com Claude API endpoint used for memory store C2
Domain platform.claude.com Claude Console used to manage memory stores
File path /tmp/usernames.txt AI-generated list of 190 usernames
Username greg.simon Account found through password spraying
Password pa55word Fictitious password sprayed against the domain controller
Process dash Interpreter that ran the initial shell commands
Process systemd-run Created the temporary service for persistence
Tools curl, nc, nmap, smbclient Used for payload download, discovery, and file transfer

Note: IP addresses and domains are intentionally Qdefanged (e.g., [.]) to prevent accidental resolution or hyperlinking. Re-fang only within controlled threat intelligence platforms such as MISP, VirusTotal, or your SIEM.

Give your SOC the alert context on the latest threats to stop incidents quickly -> Integrate Threat Intel from 16K SOCs

The post Claude Code’s Trusted API Could Help Attackers Hide Malicious Commands and Data Theft appeared first on Cyber Security News.