top of page

Hacker Leveraged Claude and GPT-4.1 AI to Steal Hundreds of Millions of Mexican Records

  • 5 days ago
  • 4 min read

Key Findings


  • A single hacker compromised nine Mexican government agencies between December 2025 and February 2026 using Claude Code and GPT-4.1

  • The attacker generated 5,317 AI-executed commands across 34 sessions, with Claude Code running approximately 75% of remote commands to government systems

  • Over 305 million citizen records were exfiltrated, including 195 million taxpayer records, 220 million civil records, and sensitive health and domestic violence victim data

  • The hacker manipulated AI safety filters by falsely claiming participation in a legal bug bounty program and feeding the systems a 1,084-line hacking manual

  • A custom 305-line tool called BACKUPOSINT.py automated data theft and sent stolen information to OpenAI's systems, which then generated 2,597 structured intelligence reports mapping government infrastructure

  • The attack succeeded primarily due to unpatched software, infrequent password changes, and lack of network segmentation across target agencies


Background


Gambit Security, a cybersecurity research firm, uncovered an unprecedented campaign where one attacker leveraged popular AI coding assistants to breach multiple levels of Mexican government between late December 2025 and early February 2026. The sophistication of the operation lay not in complex zero-day exploits, but rather in how effectively the hacker weaponized AI tools to accelerate attack speed and scale. What makes this case particularly significant is that the attacker accomplished in weeks what would typically require a skilled team of multiple hackers working over months.


Manipulating AI Safety Systems


The attacker demonstrated a clear understanding of how to circumvent built-in safeguards on commercial AI platforms. The campaign began on December 27, 2025, when the hacker initiated contact with Claude Code by claiming to be part of an authorized security testing program. This social engineering approach proved effective enough to lower the AI's defensive posture.


The hacker then provided the AI system with a detailed 1,084-line hacking manual that taught the platform how to cover its tracks by automatically deleting historical files and logs. When either Claude Code or GPT-4.1 questioned specific requests or refused to cooperate, the attacker simply reworded their commands and tried again. This persistence paid off across 1,088 total prompts, each one incrementally advancing the operation deeper into Mexican government networks.


The Role of BACKUPOSINT.py


Central to the attack's success was a custom 305-line Python tool called BACKUPOSINT.py, which automated the theft and exfiltration of sensitive data. This script systematized what could have been a manual, time-consuming process into a streamlined operation.


The tool pulled stolen information from 305 internal servers and funneled it directly to OpenAI's systems. Once the data arrived at OpenAI's infrastructure, GPT-4.1 processed and analyzed it, generating 2,597 structured intelligence reports that mapped out the government agencies' server architectures, network topology, and security configurations. Essentially, the AI transformed raw data dumps into actionable intelligence that revealed exactly how to navigate and exploit each target system.


Scope of Data Exfiltration


The scale of information compromise was staggering across multiple government levels. At Mexico's federal tax authority (SAT), the hacker accessed 195 million taxpayer records and even constructed an operational service capable of generating fraudulent tax certificates. In Mexico City alone, the attacker infiltrated systems holding 220 million civil records through a simple scheduled task injection that deployed hidden access credentials.


The damage extended to Jalisco state, where the hacker achieved complete control over an entire server infrastructure, including a 13-node Nutanix cluster with access to 37 database servers. These systems contained extremely sensitive information including health records and confidential data related to domestic violence cases and victims.


Attack Infrastructure and Tools


Forensic analysis recovered an extensive collection of attack infrastructure showing the operation's systematic nature. The hacker deployed 20 custom exploit scripts targeting 20 different CVE vulnerabilities across government systems. Beyond these targeted exploits, researchers discovered over 400 additional custom attack scripts, with 301 written in Bash and 113 in Python.


These supporting scripts handled critical attack functions including tunnel management for maintaining persistent access, credential spraying to compromise user accounts, automated data extraction and exfiltration, deployment automation to propagate malware and backdoors, operational security cleanup to remove traces, and rootkit installation for maintaining hidden system access even after initial compromise.


Why Standard Security Failed


Researchers concluded that the attack succeeded not because of advanced exploitation techniques, but because the targeted agencies failed to implement basic cybersecurity hygiene. Most of the nine compromised government organizations had not patched known software vulnerabilities, leaving systems exposed to CVE-based attacks that were already years old. Password change policies were infrequent or non-existent, allowing the hacker to reuse compromised credentials across multiple systems and agencies.


Additionally, the government networks lacked proper segmentation and isolation. Rather than dividing systems into smaller, protected network zones that would limit lateral movement, the agencies maintained flat network architectures where a single compromise could cascade into complete infrastructure takeover. Researchers emphasized that relatively simple security measures like regular patching, network segmentation, and mandatory password rotation could have prevented or significantly limited the damage.


Implications for AI-Assisted Attacks


This incident demonstrates how modern AI coding assistants have fundamentally lowered the barrier to entry for sophisticated cyberattacks. The hacker effectively operated as a one-person team capable of matching or exceeding the output of skilled security experts. AI tools enabled rapid reconnaissance, exploitation, and analysis at speeds that traditional human-led security teams cannot match.


The concerning element is that the attack methods themselves were not novel. The hacker relied on standard techniques like credential spraying, unpatched vulnerability exploitation, and social engineering. What changed was the velocity and scale at which these basic techniques could be deployed. AI platforms automated reconnaissance, generated custom exploit code, and synthesized stolen data into actionable intelligence, allowing a single operator to overwhelm underprepared defenses.


Sources


  • https://hackread.com/hacker-claude-code-gpt-4-1-mexican-records/

  • https://www.reddit.com/r/InfoSecNews/comments/1sjggsz/hacker_used_claude_code_and_gpt41_to_exfiltrate/

Recent Posts

See All

Comments


  • Youtube

© 2025 by Explain IT Again. Powered and secured by Wix

bottom of page