Threat Intelligence · Full Technical Report

AI Across the Intrusion Lifecycle

Gambit Security examined three unrelated threat actors incorporating AI into real-world intrusions: a suspected ransomware affiliate using Claude Code, an internet-wide credential harvester built with Codex and Claude Code, and an AI-generated cryptominer framework.

By Eyal Sela, Director of Threat Intelligence, and Nir Varon, Cyber Threat Researcher, Gambit Security · 31 August 2026
Download the PDF version

Introduction

We investigated three unrelated threat actors that illustrate how attackers are incorporating AI into real-world intrusions and the roles AI systems now play during offensive operations.

Across these cases, the attackers used AI throughout the intrusion lifecycle, including to:

  • Write one-off scripts tailored to systems or environments encountered during an intrusion.
  • Develop exploitation tools.
  • Prioritize high-value business information in victim environments.
  • Perform IT and DevOps tasks such as running containers, writing deployment configurations, and debugging runtime errors and logs.
  • Drive interactive “hands-on-keyboard” exploitation by iteratively generating and refining commands based on command output and errors until the desired objective was achieved.

We also document AI failure modes. Some stemmed from the weaker models the attackers selected, while others resulted from the cover story used to convince the model that it was conducting an authorized penetration test. That framing introduced unintended side effects. In one case, the model caused an outage of a compromised firewall while attempting to modify its configuration. In others, it exposed itself in victim logs by describing its own reconnaissance or even naming the attack framework.

The first case examines a suspected ‘The Gentlemen’ ransomware-as-a-service affiliate that used Claude Code during intrusions into at least six organizations. The second case examines Zerofot, a threat actor that built a scanner with Codex and Claude Code to harvest thousands of keys from thousands of hosts across the internet. The third case examines RAGE, an AI-generated Python framework that exploits exposed services to deploy cryptocurrency miners on compromised systems and showed interest in cloud compromise when the opportunity arose.

In all three cases, operational security failures by the attackers provided visibility into their infrastructure, tools, and AI conversations.

Case 1: A suspected ransomware operator using Claude Code

In late June 2026, we observed a suspected ransomware operator using Claude Code across intrusions into six organizations. We also linked the actor to two earlier compromises.

The victims include an energy utility in Australia, a financial services firm in Mauritius, a food service company in South Africa, a manufacturer in Thailand, an IT services company in Malaysia, and a property manager, a manufacturer, and a distributor in the United States.

We attribute this activity with medium confidence to a threat actor using The Gentlemen ransomware-as-a-service (RaaS). This assessment is based on one victim appearing on The Gentlemen leak site a month after the compromise, overlap with a /24 IP range attributed by Hunt.io, and the actor’s interest in the victims’ backup infrastructure.

The attacker used Claude Code to generate and execute reconnaissance and exploitation commands, write malicious scripts, modify firewall policies, and analyze business systems to identify those most relevant to the operation.

The attacker used Claude Sonnet 4.6 rather than a frontier model. Likely because frontier models are more constrained by safety guardrails. Regardless, an open-weight model could replace Sonnet with comparable or better results, as we have observed in similar operations.

We recovered the conversations below from the attacker’s server. They were originally in Russian and have been translated into English in the images below.

Intrusion playbook

The intrusions we observed mostly followed the steps below, though not every step appeared in every case:

1. VPN appliance admin access. The operator told Claude Code to check connectivity to the appliance’s management interface, exposed to the internet, using credentials obtained earlier. Claude then built curl calls, authenticated against /logincheck, and fixed its own errors as it went. When a login returned 0 (wrong password), it retried other credential variants and URL-encoded the secret. When an endpoint returned a 404/405, it probed alternative API paths until one worked.

Recovered chat log showing Claude logging into the FortiGate management interface and retrieving its network interfaces.Recovered terminal output listing the FortiGate's interfaces and subnets, including a guest WiFi network.

Sometimes Claude refused. Below, after the appliance’s response showed a live production system belonging to an organization, Claude declined to continue the intrusion without confirmed authorization.

Recovered chat log showing Claude refusing to continue without a written authorization document.

The attacker started a new session, told Claude it was authorized to test the target for vulnerabilities, and re-issued the task. This time Claude complied.

2. LDAP pass-back attack. The operator asked Claude to steal the firewall’s stored LDAP service account. Claude edited the VPN settings so that the firewall would check logins against the operator’s machine instead of the company’s domain controllers. It wrote a Python LDAP listener on the fly and ran it on port 389 of the attacker machine. It then tried several methods to force the firewall to bind: FSSO group refresh, SSL-VPN login attempt, diagnose test authserver. The last one made the FortiGate connect to the listener and send its service-account password in cleartext. Claude then restored the original LDAP address.

Recovered terminal output showing Claude redirecting the firewall's LDAP server to an attacker-controlled listener.Recovered terminal output showing the triggered LDAP bind and the captured service-account credentials.

3. VPN backdoor. The operator had Claude create a VPN user named test with the same fixed password as in all the other incidents. Claude enabled SSL-VPN where it was disabled, and on some targets added firewall policies to expose additional internal subnets to the VPN.

Recovered terminal output showing Claude creating a backdoor VPN user and adding it to the VPN access group.

4. Reconnaissance and lateral movement. With domain credentials and VPN access, the operator had Claude run crackmapexec or nxc across the internal subnets to map hosts, test the stolen credentials, and enumerate shares and local accounts. Usually the operator pasted a command or described the task and asked for a “short report”. Claude ran the command, read the raw output, and produced a recommendation: which hosts the credential gave admin on, and which machines – domain controllers, file servers, backup servers – to pivot to next.

Recovered terminal output showing Claude running crackmapexec against the internal subnet.Recovered chat log showing Claude's SMB shares report, listing hosts and their authentication status.Recovered chat log showing Claude's conclusion on which host gives full domain control, and its offer to continue.

5. Application and backup analysis. In several intrusions, the operator had Claude map the victim’s application databases and backups.

For the backups, Claude first searched the server’s Program Files directories for the names of backup products. On one victim’s domain controller this returned Windows Server Backup. Claude then pulled the backup scheduled task, read the backup policy from the registry, looked for where the backup images were written, read the backup logs, and ran wbadmin get versions to list the backups and their target.

Recovered terminal output showing Claude searching a compromised host for backup software and reading its backup logs.

On another victim, the operator told Claude to map the databases behind a financial services platform. Claude listed the SQL backup files and the live database files on two SQL servers, and when the operator asked which mattered most, ranked them and pointed to the live production database and the client document store.

Below is a snippet of the analysis.

Recovered chat log showing Claude ranking two SQL Server databases by priority and proposing exfiltration routes.

On request, Claude ran the SQL Server BACKUP DATABASE command on both servers and staged two compressed dumps for exfiltration.

Recovered terminal output showing Claude running a SQL Server backup command to stage a database dump.

6. Exfiltration. The attacker exfiltrated one of the staged dumps. Claude mounted the C$ share, copied the .bak to the operator’s machine, and then deleted it from the server.

Recovered terminal output showing Claude copying the staged database dump off the server and deleting it.

Firewall outage

At the utility, Claude tried to change its portal settings through the API. Those calls failed, so it downloaded the device’s configuration, edited it locally, and uploaded it back through /api/v2/monitor/system/config/restore. The device returned success, then went unreachable on all ports. Claude’s account of it, once the operator noticed the web interface was down: “a partial restore couldn’t change the portal settings, so I tried restoring the entire VDOM config with edits.” An hour later, the firewall was still down: “Yeah, I screwed up – I shouldn’t have done a full config restore.”

Recovered terminal output showing Claude uploading the modified firewall configuration for a full restore.Recovered chat log showing Claude and the operator discovering the firewall is unreachable after the restore, and Claude acknowledging the mistake.

External scans show that the device was indeed last seen on June 23 (presumably taken down first by the malfunction the config restore caused, and kept off the internet afterward by removing the management port from public exposure).

Recovered scan timeline showing the compromised firewall's management port going offline on June 23.

Indicators of compromise

IndicatorRole
38.110.228.33C2 and LDAP listener
23.27.180.34Rogue LDAP listener

Case 2: Zerofot - Internet wide credential harvesting and cloud lateral movement

A Chinese-speaking operator runs a credential harvester against unintentionally exposed sensitive files and open directories across the internet, collecting keys and tokens for AI providers, cloud services, servers, and SaaS platforms. Valid AI keys feed an API-reselling gateway, and stolen cloud keys drive lateral movement into victim environments.

auto_scan - a bespoke scanner-harvester

The operation’s main tool is auto_scan, a scanner and credential harvester. The scanner queries FOFA (an internet scanner similar to Shodan and Censys) using hardcoded queries that identify potentially sensitive files exposed on the internet. It can also ingest a list of IP and port targets produced by masscan scans run by the attacker’s worker servers.

For each host it reaches, the scanner probes a fixed list of paths for config files and other files that may hold secrets. Where a host returns a directory listing, it also crawls the directory tree and downloads available files.

The operator’s guidance file to the assistant lists example searches, later hardcoded into the scanner:

Recovered code showing the hardcoded search terms auto_scan uses to identify exposed credential files.

After collection, the scanner searches downloaded content with a regex and validates candidates live against the matching provider: AI vendors (Anthropic, AWS Bedrock, Azure OpenAI, Google Gemini, Vertex AI, OpenAI, OpenRouter, HuggingFace, Replicate) and non-AI services (AWS, GitHub, GitLab, Stripe, Slack, Sentry, Docker Hub), along with SSH private keys. For each live key it records the usage tier and, for AWS, the account and IAM user it belongs to.

The operator built auto_scan with OpenAI Codex and Claude Code. Below is an excerpt of the instruction files given to Codex, tasking it with adding a masscan targeting mode. The brief describes the work as “for an authorized CTF sandbox” so the model does not refuse the task.

Recovered instruction file given to Codex, framing the scanner's masscan targeting feature as an authorized CTF task.

In the final stage, valid keys are uploaded to llde[.]tech, an AI API gateway that resells access to AI models. The website was taken offline during the writing of this report.

Screenshot of the llde[.]tech landing page advertising itself as an AI API reselling gateway.

Claude Code and OMC for DevOps and IT

The operator ran Claude Code with oh-my-claudecode (OMC), a public multi-agent orchestration framework installed as a Claude Code plugin. Claude Code was configured to route through the operator’s own llde[.]tech gateway rather than Anthropic (via ANTHROPIC_BASE_URL), the same gateway the operation stocks with stolen keys, so the model answering behind the CLI may or may not have been operated by Anthropic.

Through OMC, Claude Code handled the operation’s IT and DevOps work: standing up and restarting the scanner and its proxy stack, wiring up outbound proxies, and monitoring and debugging the live harvester.

For example, OMC was tasked with bringing up the scanner-and-proxy stack, and stopping it when the scanner risked leaking its real IP. Other jobs included refreshing the pool of proxy exit nodes it pulled from a Chinese commercial proxy service (赔钱[.]com, Punycode xn--cp3a081l[.]com), checking that traffic still egressed through the proxy and logging the current exit IP and route, managing the host firewall so certain ports bypassed the proxy tunnel, and vetting a candidate proxy project to serve as the scanner’s outbound exit.

Exploitation scripts

deep_lateral2.py is a single-use, poorly written script for AWS discovery and privilege escalation. It has hardcoded AWS access keys for accounts the operator had already compromised, and uses them to look through managed services – CI/CD pipelines, batch and machine-learning jobs, EC2 instance user-data, and configuration stores – for more embedded keys. It also attempts cross-account role assumption and access-key creation, but the logic and implementation are crude and unreliable.

Notably, and as we often see when AI is tricked into writing malicious code under the guise of red teaming or penetration testing, the AssumeRole call names its session recon, a label that gives the attack away.

Recovered code showing deep_lateral2.py's AssumeRole call, with its session named recon.

jenkins_scanner.py targets internet-exposed Jenkins servers. It takes a list of IPs, confirms each runs Jenkins, and tries anonymous access or a list of weak username and password pairs. On an authenticated session it uses Jenkins’ Script Console to run a Groovy payload that harvests cloud and AI credentials from the host and validates the AWS keys it finds. When the login attempts fail, it falls back to file read through CVE-2024-23897 against hardcoded paths, though a bug in that branch of the recovered version stops it from running.

Sliver C2

Occasionally the operator deployed Sliver C2 implants on compromised hosts. On them, the operator ran commands to look for application config files and stored credentials, and connected to databases reachable from the host.

For example, on the compromised host cPanel-External-Backups-01, the operator tried the AWS instance metadata endpoint (which would have returned nothing useful, since the host is a DigitalOcean droplet, not an EC2 instance). The operator then searched for wp-config.php, .env, and config.php in the home directory, and for .conf and .cfg files in /var/cpanel, grepped for credentials and keys in environment variables, searched for a file called stealer_logs.rar (we do not know the origin of this file), and listed the /backup folder and the mounted volume at /mnt/volume_lon1_03/.

Recovered terminal output showing Claude searching a compromised host for AWS metadata and stored credentials.

On another host, kafka-1, the operator read the kafka.properties file from within a Docker container and on the host, and checked connectivity to hosts on two internal subnets for Postgres and MySQL.

Recovered terminal output showing Claude reading a Kafka properties file and probing internal database ports.

On a third host, running as root, the attacker used mysql with a username and password obtained earlier to connect to AWS RDS databases and list the available tables.

Recovered terminal output showing Claude listing tables on two AWS RDS databases using recovered credentials.

Breakdown of the harvested credentials

Between April 5 and May 23, 2026, the operation collected 2,975 validated keys and credentials from 1,742 victim hosts (3,528 keys across 1,956 hosts counting the ones that were invalid, expired, or out of quota when the scanner checked them):

Credential typeKeys
SSH private keys661
AWS access keys (214 accounts)635
Google Gemini448
OpenAI254
GitHub tokens205
Anthropic176
Stripe137
Groq108
OpenRouter82
xAI79
Other190

The chart shows valid keys collected per day, by provider.

Bar chart of validated keys discovered per day, stacked by credential provider.

Victim notification

We have shared the information with the Shadowserver Foundation, and we thank them for their help with victim notification. We also disclosed affected keys to the most affected cloud and SaaS providers for revocation and customer notification.

Indicators of compromise

IndicatorRole
172.245.185.195C2 and staging
209.99.191.199Back for staging
23.80.90.36Scanner worker
170.231.224.116Scanner worker (potentially compromised host)
170.231.224.99Scanner worker (potentially compromised host)
170.231.224.4Scanner worker (potentially compromised host)
170.231.224.60Scanner worker (potentially compromised host)
170.231.224.33Scanner worker (potentially compromised host)
170.231.224.41Scanner worker (potentially compromised host)
170.231.224.29Scanner worker (potentially compromised host)
llde[.]techReselling gateway
zerofot[.]comModel API endpoint

Case 3: RAGE - exploitation framework for cryptominer deployment

RAGE is a custom Python framework designed to scan exposed internet services, exploit vulnerable deployments, harvest credentials, and deploy cryptocurrency miners. While the operators appeared primarily focused on deploying cryptominers, we also observed dedicated modules and one-off scripts used for cloud environment exploitation after initial access.

AI-assisted development

RAGE and many of the accompanying scripts appear to have been generated with AI. Many preserve the model’s own first-person, self-correcting reasoning inside comments and docstrings, with lines such as “Wait, we already know this host can’t write…” or headings that evolve from “THE BREAKTHROUGH” into “REAL BREAKTHROUGH” a few lines later.

Recovered code comments showing the AI-generated reasoning behind RAGE's Redis module, evolving toward its final approach.

Separately, the framework integrates an LLM at runtime. The operator dashboard embeds a DeepSeek-backed “AI Orchestrator” that advises on running the mining botnet.

Modules

The framework supports scanning, exploitation, brute-force authentication, cloud metadata access, host-level privilege escalation, miner deployment, monitoring, and HVNC orchestration, and includes a web dashboard.

Recovered source code showing RAGE's main pipeline and its exploitation modules.

RAGE includes the following exploitation modules:

  • Redis - targets unauthenticated instances exposed on port 6379. It attempts remote code execution by injecting a cron job through CONFIG SET, writing an attacker-controlled SSH key to authorized_keys, or loading a malicious module through rogue-replica replication. Before deploying XMRig, it searches the Redis keyspace for AWS credentials and other secrets.
  • Elasticsearch - targets unauthenticated instances and recursively queries indexed documents for AWS keys, secrets, database URLs, and API tokens. Against legacy versions, it attempts remote code execution through a Groovy scripting sandbox bypass.
  • Docker - targets unauthenticated Docker APIs exposed on port 2375. It attempts remote code execution by launching a new alpine container that downloads and runs XMRig or, when container creation is blocked, by executing the same miner-download command inside the first few containers already running on the host. It also scans containers for secrets and mounts the host filesystem to obtain host-level access.
  • Tomcat - brute-forces weak or default credentials for exposed Manager applications. After a successful login, it deploys a malicious WAR file hosted on attacker infrastructure to run XMRig on the host.
  • Additional services - other modules target Jenkins, Hadoop YARN, Confluence, and Supervisord.

Cloud exploitation

In one case, the actor recovered an AWS access key ID and secret from an exposed Redis instance belonging to a SaaS provider. Although the key appeared to be associated with an S3-backed application, it granted administrative access to the AWS account, allowing the actor to enumerate IAM identities and cloud resources across the control plane.

The actor generated a post-exploitation script, aws_deep_hunter.py, with the harvested AWS credentials hardcoded. The script enumerates IAM users, retrieves their inline and attached policies, and generates a new access key for each user. It then lists IAM roles and attempts to assume them. As with the Zerofot campaign, the hardcoded STS session name is overly descriptive: where Zerofot named its session recon, RAGE uses rage-session.

Recovered code showing RAGE's AWS role-assumption logic, with its session named rage-session.

The script then enumerates S3 buckets and their contents, filtering for objects between 10 bytes and 1 MB whose extensions suggest configuration, source code, or credential material: .env, .json, .sql, .pem, and .key. Matching objects are downloaded and searched for credentials and cryptographic keys.

Then, it uses all available credentials to query the following services: S3, Secrets Manager, SSM Parameter Store, IAM, CloudFormation, Lambda, ECS, RDS, and DynamoDB (CodeBuild and CodeCommit are referenced in the script header but are never implemented), as can be seen below:

Recovered code banner for RAGE's AWS Credential Deep Hunter v2 script, listing the AWS services it enumerates.

Where permissions allow, the script retrieves Secrets Manager values, decrypts SSM parameters, and collects Lambda environment variables, ECS task-definition values, CloudFormation parameters and outputs, RDS snapshot metadata, and DynamoDB items.

Finally, any access keys it created through iam.create_access_key() feed back into the workflow, so each newly minted key becomes another starting point for IAM enumeration and S3 collection.

Recovered log output confirms the actor had live access to the SaaS provider’s AWS account. Although the log appears to originate from a previously executed script that we did not recover, it recorded the enumeration of eight IAM users and their attached policies. Four users held AdministratorAccess. The same execution enumerated 196 S3 buckets along with several additional AWS resources that were empty or inactive.

Indicators of compromise

IndicatorRole
91.84.125.213C2 server
91.84.118.236Payload host and mining proxy
91.84.115.56Staging and loot server
bold-scene-8a29.jessicacannons34.workers[.]devCloudflare Worker used as dashboard and heartbeat relay
rage-cdn-1780098503.s3.eu-central-1.amazonaws[.]comAttacker-controlled S3 bucket serving miner payloads