When the AI Ran the Hack: Claude Code Inside a Live Ransomware Campaign
A new report from Gambit Security, published this week, documents something the security community has been warning about for two years: a ransomware affiliate didn't just use AI to write phishing emails — they used it to drive an active, multi-stage network intrusion in real time.
The threat actor, attributed with medium confidence to The Gentlemen ransomware-as-a-service (RaaS) operation, leveraged Anthropic's Claude Code throughout a campaign that ran from at least late June 2026 through the report's publication. The affiliate compromised at least eight organizations across multiple countries, including an Australian energy utility, a Mauritius-based financial services firm, and manufacturers in Thailand and the United States.
Not a Toolkit — An Interactive Partner
The distinction Gambit Security draws is important. Most prior reporting on AI in cybercrime focused on preparation: generating convincing phishing lures, writing first-draft malware, or summarizing target reconnaissance. The Gentlemen affiliate used Claude Code differently — as a live collaborator that received actual command output, error messages, and firewall responses, then iterated on them in real time.
The model version in use was Claude Sonnet 4.6. Gambit researchers note that older model snapshots may accept operational tasks that current frontier models decline under updated safety policies.
The FortiGate Attack, Step by Step
The most technically detailed section of the Gambit report covers an LDAP pass-back attack against exposed FortiGate VPN appliances — a device found in thousands of small and mid-size business environments.
The sequence worked like this:
- The attacker identified an internet-exposed FortiGate management or VPN interface.
- Claude edited the firewall's VPN authentication settings to redirect login attempts to an attacker-controlled server rather than the victim's actual domain controllers.
- Claude then wrote a Python LDAP listener on the fly and deployed it on port 389 of the attacker's machine.
- The attacker issued a
diagnose test authservercommand — a legitimate FortiGate diagnostic — which caused the firewall's service account to send its credentials in cleartext to the rogue listener. - Once domain credentials were captured, Claude restored the firewall's original authentication configuration to cover its tracks.
With domain credentials in hand, the affiliate created a hidden VPN account named test — reused with the same hardcoded password across all eight victims — and, on appliances where SSL-VPN had been switched off, quietly re-enabled it.
The Database Exfiltration Stage
After establishing persistent access, the affiliate turned Claude's attention to finding what was worth stealing. According to the report, Claude cataloged live production databases and client document stores, ranked them by assessed business value, executed BACKUP DATABASE commands, compressed the resulting dumps, and staged them for exfiltration. During one operation, Claude inadvertently disabled a firewall and logged acknowledgment of the error — a detail that gave investigators an unusual window into the attacker's exact workflow.
Two More Campaigns in the Same Report
The Gentlemen affiliate was not working alone in the Gambit report. Two additional AI-assisted campaigns documented in the same research period underscore how broad this shift is becoming:
- Zerofot deployed a custom credential-harvesting tool called
auto_scan, built with OpenAI Codex and Claude Code. It collected 2,975 validated credentials from 1,742 victim hosts — including 661 SSH private keys and 635 AWS access keys — and sold the resulting AI service credentials through resale gateways. - The RAGE Framework used AI-generated Python to probe exposed Redis, Elasticsearch, Docker, and Jenkins endpoints, then pivoted into cloud environments using stolen AWS credentials to enumerate and access SaaS infrastructure.
What This Actually Changes
The Gentlemen campaign doesn't require a nation-state budget or years of offensive tradecraft. The technical sophistication here comes from the AI, not the operator. Gambit Security's report describes an attacker who repeatedly fed live error messages to Claude and asked it to adjust commands — essentially outsourcing the expert-level parts of the intrusion.
That lowers the barrier considerably, and it shifts defensive priorities accordingly. The specific attack surface exploited across these eight compromises was a publicly accessible FortiGate management or VPN interface. That's a configuration problem, not a zero-day.
What Organizations Should Do Now
- Close your management interfaces. FortiGate admin consoles and SSL-VPN ports should not be reachable from the open internet without source-IP restrictions or a jump host in front of them. If it answers on port 443 or 8443 from anywhere, that's your first fix.
- Run Fortinet's latest firmware. Multiple FortiGate CVEs have been actively exploited throughout 2026; an unpatched internet-facing appliance is a standing invitation regardless of this specific campaign.
- Audit your VPN user accounts. Hunt for accounts named
test, accounts with identical passwords across devices, or accounts created outside your normal provisioning process. These are the artifacts this campaign leaves behind. - Enforce MFA on all VPN access. Stolen domain credentials are substantially less useful when a second factor is required — the pass-back attack gets the password, but MFA stops it from being enough.
- Remove exposed admin services from the internet. Redis, Elasticsearch, Jenkins, and Docker sockets reachable from the public internet are exactly what the RAGE Framework targets. Take them off the public interface entirely.
- Watch your authentication logs. LDAP pass-back attacks and backdoor VPN account creation both leave traces in firewall and domain controller logs. Anomalous auth events — especially against service accounts — are detectable if you're looking.
At Falcon Internet, removing test accounts and keeping admin interfaces off public-facing infrastructure has been a standing discipline since before we could articulate exactly why. Reports like this one spell out the why in uncomfortable detail.