AI Agent Steals OpenAI, DeepSeek Keys to Power Fraud Ring

A resource-acquisition AI agent scanned fofa.info for exposed servers, harvested live OpenAI and DeepSeek API keys, and spent the stolen quota to run an academic-fraud operation that exposed 5,132 students' records.

The short version: Security researchers at VECERT have documented a campaign — dubbed Operation Ghost-Campus — in which an autonomous "resource-acquisition" AI agent scans the asset search engine fofa.info for misconfigured servers, extracts live OpenAI and DeepSeek API keys with regular expressions, and checks each key's remaining balance by reading its HTTP status code. Keys that still have quota get fed into an interactive GoTTY terminal called "Pi — AI Coding Assistant," which in turn drives academic-fraud scripts tied to Shanghai Publishing and Printing College. Those scripts exposed data belonging to 5,132 students at the college's Fengxian campus. No human ever had to manually test or resell the stolen keys — the agent did the discovery, validation, and monetization itself.

What investigators found

VECERT tracked the activity as VECERT-TI-2026-1107-B and linked it to a Chinese threat actor operating from a Tencent Cloud server in Guangzhou. The operation's purpose, per the researchers, is to give the operator perpetual, cost-free access to large language models by continuously harvesting other people's paid API credentials rather than paying for compute directly.

That framing matters. This isn't a smash-and-grab where a leaked key gets dumped on a forum and resold. It's a standing pipeline: register accounts, scan for exposed keys, test each one, and route the working ones into an attacker-controlled development environment — all run by code that behaves like an agent rather than a one-off script.

How the agent gets in: fofa.info and disposable identities

The operation's entry point is fofa.info, a search engine for internet-connected assets, similar in purpose to Shodan or Censys. Researchers at gbhackers.com reported that the agent targets fofa.info to find servers exposing configuration files, environment variables, and credentials. To get around the platform's registration limits, the operator didn't rely on throwaway email providers — those are easy to block. Instead, investigators found a purpose-built catch-all mail system on the domain melocc.cc, with subdomains for mail, API, POP, IMAP, and SMTP all resolving to a single IP address. A script uses that infrastructure to register a FOFA account, read its own confirmation email, extract the activation link, and finish activation within seconds — no human involved.

Investigators recovered a file named fofa_accounts.csv confirming at least 1,438 fake accounts, each with working passwords and JWT tokens ready to drive further API calls. That's industrial-scale account farming built specifically to feed a scanning pipeline.

Validating stolen keys without ever "attacking" OpenAI or DeepSeek

This is the part that should concern anyone who ships a key in an .env file, a Docker config, or a public Git repo. Once the FOFA scanner locates a vulnerable host, the agent uses regular expressions to pull API keys for AI platforms directly out of exposed files and sort them by provider.

For OpenAI project keys — the ones beginning sk-proj- — the agent queries api.openai.com directly and reads the response. A key that returns HTTP 429 with no credits is tagged valid_no_balance; a 401 response marks a revoked key. OpenAI's own documentation draws this same distinction: a 429 can mean either rate limiting or an exhausted prepaid balance, while a 401 means the key itself is invalid or revoked. The agent doesn't need to guess — it reads the status code the same way OpenAI's SDK does, and sorts the key accordingly.

DeepSeek keys get the same treatment. They match a predictable pattern — sk-[a-f0-9]{32} — and the agent checks each one's monetary balance directly. DeepSeek publishes a balance endpoint for exactly this purpose, and the agent simply calls it. A recovered dashboard listed three working keys holding 50.68, 8.52, and 0.80 units respectively, taken from servers associated with the domains labibiyat.com and nyisu.com.

None of this requires breaking into OpenAI or DeepSeek's infrastructure. It requires reading a key off someone else's misconfigured server and then asking the provider, politely and automatically, "how much is left on this one?"

From stolen quota to academic fraud

The validated keys don't get resold. They get spent. The stolen compute powers an interactive web terminal built on GoTTY and branded "Pi — AI Coding Assistant," which the operator uses as a development environment, and which in turn supports scripts aimed specifically at Shanghai Publishing and Printing College's Fengxian campus.

One of those scripts is a "heartbeat" bot that imitates a student's active reading session: it sends an HTTP 200 response roughly every 30 seconds, claims bonus points through an internal campus API — on the order of +10 points per cycle — and checks periodically that the account hasn't been frozen. Recovered logs show the bot reaching account balances such as 252 points, entirely through automated, fraudulent activity logged as genuine student engagement.

Alongside the fraud bots, the same infrastructure ran a scraper against the college's financial and identity systems. Investigators recovered full names, student IDs, mobile numbers, 18-digit national ID numbers, family home addresses, campus-card balances reaching 1,474.84 yuan, and detailed microtransaction histories for 5,132 students, with the scraper set to refresh its haul every 48 hours. A separate QR-code module, controlling more than a thousand active sessions, could reportedly generate valid payment codes for high-balance cards — a path from stolen data straight to in-person financial fraud.

5,132
students at the Fengxian campus whose identity and financial data was harvested
1,438
fake FOFA accounts automatically registered to run the key-harvesting scans
1,474.84
yuan — the highest recovered campus-card balance exposed in the scrape

Incident chronology

1 · Account farming

A catch-all mail system on melocc.cc auto-registers and auto-activates fofa.info accounts, eventually reaching at least 1,438 fake accounts with usable credentials.

2 · Scanning and extraction

The agent uses those accounts to scan fofa.info's index of internet-connected assets for misconfigured servers, then pulls OpenAI and DeepSeek keys out of exposed files using regex.

3 · Balance validation

Each key is tested against the provider's own API. A 429 with no credits is sorted as valid_no_balance; a 401 is sorted as revoked; working keys with remaining balance are kept.

4 · Compute laundering

Working keys are injected into the operator's own development environment, powering a GoTTY terminal and the scripts built on top of it.

5 · Academic fraud and data theft

Heartbeat bots fake student activity for reward points; a parallel scraper pulls PII and campus-card data for 5,132 students, refreshing every 48 hours.

Why "autonomous" is the part that matters

Key theft from exposed .env files and Git repos isn't new — it's one of the most common findings in any API security audit. What's different here is the absence of a human in the validation and spending loop. The same agentic pattern that lets a legitimate developer point a coding assistant at a shell and let it "figure out the pipeline" is being used here to let an attacker's tooling figure out which stolen keys are worth keeping, without anyone manually checking balances or writing bespoke scripts per provider.

That's consistent with a broader trend security teams are tracking: agentic frameworks that are handed a shell and network access can assemble multi-step attack chains at runtime, testing large numbers of low-complexity misconfigurations without fatigue. A credential that's readable off a misconfigured server used to mean "someone might find this eventually." Increasingly, it means "something will find this, test it, and start spending it within the same pipeline that found it" — no separate actor, no delay, no manual triage.

The uncomfortable part: every control this campaign bypassed — secret scanning, .env hygiene, Git history audits — is still worth doing. None of it would have mattered once a key was already sitting in plaintext on a reachable server, because the agent's validation step doesn't care how the key leaked. It only cares whether the provider's API still accepts it.

What actually closes this hole

The standard advice after an incident like this is correct as far as it goes: keep API keys out of web-accessible .env files, container configs, and public Git repositories; rotate keys that touch any exposed system; set hard spend limits on every provider account. Those are table stakes, covered in more depth in our API security guidance and in 5 API Key Security Mistakes That Put Your Business at Risk.

But this incident is also a clean illustration of a narrower, structural problem: if the literal key value is ever written to disk, to an environment variable, or to a process that an agent — human-driven or autonomous — can read, that key is a liability the moment the surrounding system is misconfigured. It doesn't matter whether the misconfiguration is a public Git repo, an open Docker API, or a debug endpoint. The key existing in readable form anywhere outside the request itself is the vulnerability.

This is the architectural argument behind wire-level credential injection, which is the model KnoxCall's AI gateway is built around: the real API key never touches the application process, the CI runner, or the AI agent's context. It's injected at the egress proxy when the outbound request is actually made, scoped and swapped per call, so there's no plaintext credential sitting in a file, an env var, or a terminal session for a scanning agent to extract in the first place. It would not have stopped the original server misconfiguration in this campaign — nothing stops someone from misconfiguring a server — but it removes the thing the agent was actually after: a key it could read, test, and spend on its own.

If you're weighing that kind of architecture against a traditional secrets manager, our gateway comparison and pricing pages lay out where each approach fits, and where it doesn't.

What to check this week

  • Search your own exposed infrastructure the way an attacker would: anything indexed by asset search engines like fofa.info, Shodan, or Censys that exposes a .env file, Docker API, or debug console.
  • Rotate any OpenAI or DeepSeek key that has ever been present in a container image, a public repo, or an unauthenticated endpoint — don't wait for a 429 to tell you it's already gone.
  • Set hard spend limits on every LLM provider account; a 429 from an exhausted hard limit is a far cheaper failure mode than an open-ended balance an agent can keep draining.
  • Audit who, and what, actually holds your provider keys in plaintext today — including CI pipelines and any AI coding agent with shell access.

Frequently asked questions

What is Operation Ghost-Campus?

Operation Ghost-Campus is the name VECERT researchers gave to a campaign in which an autonomous AI agent scans fofa.info for misconfigured servers, extracts OpenAI and DeepSeek API keys, validates their remaining balance, and uses the working ones to power academic-fraud scripts and a data scraper targeting Shanghai Publishing and Printing College's Fengxian campus.

How did the AI agent steal OpenAI and DeepSeek API keys?

The agent used over a thousand automatically registered fofa.info accounts to scan for exposed servers, then pulled API keys out of exposed files with regular expressions. It confirmed which keys still worked by sending a request to the provider's own API and reading the HTTP status code — 429 for a valid key with no remaining balance, 401 for a revoked one.

What student data was exposed in the academic fraud breach?

Investigators recovered names, student IDs, mobile numbers, 18-digit national ID numbers, home addresses, campus-card balances up to 1,474.84 yuan, and microtransaction histories for 5,132 students, scraped from the college's systems on a roughly 48-hour refresh cycle.

What is a resource-acquisition AI agent?

In this context, a resource-acquisition agent is automated software designed to find and validate usable compute or API credits on its own — here, by scanning for exposed servers, extracting LLM API keys, and checking each key's live balance — so the operator gets ongoing free access to AI models without paying for them.

How can I tell if my API key has been stolen from an exposed server?

Check your provider's usage dashboard for spend or request volume you didn't generate, and watch for a sudden shift from normal usage to rapid, low-value balance-check calls. If you've ever committed a key to a public repo, left it in an unauthenticated .env file, or exposed a Docker API, treat that key as compromised and rotate it regardless of what the dashboard shows.

Does keeping API keys out of code actually stop this kind of attack?

It closes the specific hole this campaign exploited. The agent only works because a readable key value exists somewhere a scanner can reach; if the application, CI pipeline, or AI agent never holds the literal key and it's injected only at the point of the outbound request, there's nothing for a server misconfiguration to expose.

Sources

  1. AI Agents Steal OpenAI and DeepSeek API Keys From Exposed Servers While Harvesting Data of 5,132 Chinese Students
  2. Investigation: Operation Ghost-Campus: Artificial Intelligence Agents, Academic Fraud, and Global Credential Theft at the Shanghai College of Publishing and Printing
  3. Hackers Use 1,438 Fake FOFA Accounts to Steal OpenAI and DeepSeek API Keys Across the Internet
  4. Attacker Uses 1,438 Fake FOFA Accounts to Harvest Exposed OpenAI and DeepSeek API Keys
  5. Hackers Deploy Autonomous AI Agents to Steal OpenAI API Keys and Manipulate University Attendance Systems
  6. AntiFox AI Pentesting Platform Linked to Attacks That Accessed AWS Production Secrets

Stop building a key an agent can read

This campaign shows that any API key readable from a file or process will eventually be found and spent by something — human or not.

Start Free →

Or get new posts by email. Double opt-in, unsubscribe anytime.