Threats

Apiiro decodes 80,409 China-linked espionage commands from GitHub history

Adam Bream
By Adam Bream , Tech Content Writer
Apiiro decodes 80,409 China-linked espionage commands from GitHub history
Cover © Anonhaven

A China-linked spy operation left 80,409 of its own commands readable in public GitHub history. Apiiro researchers decoded every one of these espionage commands. Over two years the orders reached victims in 23 countries, from a Trump club website vendor to Taiwan's opposition party.

Apiiro published the decoded command log on December 2, 2026. Kaspersky had exposed the campaign as Operation ShadowCloud two weeks earlier, naming nine operator accounts but not their commands. Apiiro found 104 operator repositories, 97 never reported before, and 92 of them were connected to victim machines. They asked for 2,902 distinct files.

The GitDoor backdoor takes orders from a public repository. Each implant polls GitHub for a command file named for its session, main.<code>.<4 chars>.js in newer repositories and main.<code>.js in older ones. The operator commits that file, the implant reads and runs it, and the file is deleted later. Git records each deletion as one more commit, so every order and its queue time stayed public.

Each command file is base64 text XORed with its own file name. It wraps an AES-256 blob whose key sits in the same file. Inside is a JSON verb with its arguments, and nothing in the file is signed.

scanDir lists a folder, downloadFile sends one back, uploadFile drops a tool and shell opens a command line. Other verbs load more code into memory. On Linux servers they load ELF objects, start an Ably proxy and read the host's public IP address.

Operator commits carry the author name INSOMNIA <INSOMNIA@github.com> and the message "commit from INSOMNIA". A commit author can be set to anything, but GitHub's push records log the account whose token made each push. Those records tie every command in the 92 command-and-control (C2) repositories to the operators' own accounts. Deletions usually came hours later, in bulk sweeps that cleared several victims at once.

Apiiro found the repositories in four passes. Monthly GitHub commit searches for "commit from INSOMNIA" since 2024 returned 61. A search on the INSOMNIA email found all but two of the rest, GH Archive added those two, and batch-registered accounts gave five more.

A queued command is not proof of theft. Implants sent their answers to private repositories that Apiiro did not open. Implants did answer, since operators listed a drive, opened a listed folder, then picked a file inside. The report describes what the attackers requested, not what arrived.

"Espionage operations are usually seen through their malware and servers, and rarely through their orders. This record is the operators' own task list: what they asked for, from whom and when, across every victim, down to the minute."

— Apiiro Research, "The spies left the door open", December 2, 2026

Two days after the US midterms, operators listed a private-club web builder's client sites. They picked out the Trump properties and asked for 32 Trump-named site folders zipped into one archive. The folders, an ice rink and test copies of some sites among them, cover about 20 Trump clubs and resorts, including Mar-a-Lago, Bedminster and Doral.

  • 06:34 UTC scanDir D:\ClientSites
  • 06:35 UTC scanDir D:\ClientSites\TrumpNationalGolfClub2016ColtsNeck
  • 06:53 UTC downloadFile C:\Users\Public\Documents\Trump-LaskerRink.zip

The same session sought the Trump Organization folder and contacted an internal host named TRUMP-WS1. A day later the operators wanted about 150 modules of the vendor's own platform code, including single sign-on, payments and the member directory. Every one of these commands went to the vendor's servers, and nothing in the log shows access to the Trump Organization's own network.

In summer 2025 the operators were inside one of the largest US industrial unions. On a headquarters IT administrator's machine, they went for the travel VPN configuration, the email account-recovery guide and the member portal's password-reset screens. They sought the staff directory, a local's Slack export covering 2017 to 2024, and passwords, hashes and session cookies to impersonate staff. Two mail archives named for its top officer were listed, one requested three times.

In October 2026 the target was a federal contractor's accounting database and the software vendor behind it. The operators tried to pull the entire software installation, with its FedRAMP customizations, and a 903 MB software build. Apiiro thinks the aim was to find flaws usable against other government contractors.

KMT chair Cheng Li-wun met Chinese President Xi Jinping in Beijing on April 10, 2026. The KMT (Kuomintang) is Taiwan's main opposition party. On April 5 the operators requested her final talking points for "the important meeting" from the party's Mainland Affairs Department. Over the Qingming holiday that month, the team working the KMT sent 651 commands.

The decoded path was F:\大陸部\115兩黨高層會面\行程文稿\重要會談講話參考-最終版(7-2).docx. In Apiiro's translation it holds trip scripts for the 2026 leaders' meeting and the file "Talking points for the important meeting, final version (7-2)".

Taiwan's other two main parties were read from inside too, ahead of the November 28 local elections. From a Taiwan People's Party (TPP) legislator's office came the caucus strategy for a floor fight and draft amendments to military service laws. At the Hsinchu office of the ruling Democratic Progressive Party (DPP), they requested a directory of central department heads and the nomination timetable.

Two drone suppliers to Taiwan's military had their sales folders listed and files requested. From a contractor that automates military bases, the operators sought monitoring-system architecture diagrams, camp CAD drawings and IP tables. Infrastructure targets included a metro maintenance system's source tree, a water utility's smart-meter documents, Kaohsiung industrial control configs and a camera maker's firmware private key.

Kaspersky's report went live at 08:00 UTC on November 17, and the operators kept working. Fifteen minutes earlier they had uploaded a Windows kernel exploit to the repository serving the KMT. It rebuilds the public exploit for CVE-2026-42980, which Microsoft patched in June and, according to Apiiro, still lists as not exploited. The bug is not in CISA's Known Exploited Vulnerabilities catalog.

Time What the commands show
Nov 17, 08:23 UTC New command to a KMT machine holding the party's domain policy files. 239 commands after the report that day, 188 of them to that machine. A Group Policy task set to run their program on 16 party machines. Two loaders and a disguised driver signed through Microsoft's driver attestation planted
Nov 18, 07:31 UTC A second Group Policy with no host filter. 454 more commands across 12 C2 repositories by 09:45 UTC. On an operator test machine, a trial of a rootkit driver controller that hides processes, network connections, ports and files
Nov 19, 06:02 to 06:38 UTC Modified SockTail build uploaded to the KMT machine
Nov 20 Spread through the network of the Philippine National Nutrition Council, a new victim
Nov 23 New KMT session on a machine with the party's website and payment-site folders, proxy through Pusher, 236 commands to victim machines by Apiiro's last check that day. The Latin America and Italy team planted a DLL side-loading package disguised as Windows DFS components

SockTail, an open-source tool, joins a machine to a private Tailscale network and opens a proxy into it. It would give the operators a route into the KMT that bypasses GitHub. The commands do not show whether it started.

The Philippine Coast Guard drew more commands than any other victim, 3,696 over a year. They asked for 248 distinct file names. Dated papers ordered there were a median of two days old, against 32 days for all victims.

The operators tracked US forces through the Coast Guard. A memo on the annual Balikatan exercise was requested two days after it was written. They also sought papers on a US Marine Corps rotation and a report on a joint US-Philippine maritime activity.

On October 15 the operators uploaded a small tool that decrypts the desktop Signal database. They asked for a military user's messages exported to text files. Its last run order, on another machine, came about five hours before Kaspersky's report on November 17.

One team spent five weeks in spring 2026 inside a leading foreign-policy think tank in Rome. On the institute's file server it requested 14 mailboxes, including the president's mail archive twice, plus at least 300 MB in split archives. Before leaving, the team had the server's event logs wiped. In July it came back for the institute's domain controller database, which holds every account's password hash.

In Eswatini, one shared administrator password took the operators across the national data center. They sought eVisa and payment configs, 2024 border crossing records and the private key of a government web certificate.

In Peru, one Ministry of Defense help-desk account served the attackers for five months. Its password never changed. On seven days between December 2024 and April 2025, they requested 81 split RAR parts from its file shares.

Other orders hit India's national electronic toll collection system through a toll-plaza server. They also sought password hives from Mexico's economy ministry. A Caribbean energy ministry's embassy cable on crude refining was listed, as were three years of a Laotian bank's outgoing SWIFT records. At a Central Asian foreign ministry they dropped a Veeam credential decryptor and sought the backup archives.

Victims also include the Philippine Justice Department's Office of Cybercrime and Argentina's foreign ministry. Other victims sit in Brazil, Uganda, Zambia, Cambodia and Thailand.

The operators uploaded 494 Windows programs, and VirusTotal had never seen 347 of them. Of 355 that Apiiro analyzed, only two match a hash Kaspersky or Sophos published. Of 170 side-loading DLLs (malicious libraries placed beside a signed program that loads them), 117 come from one codebase. Apiiro decoded 87 distinct GitDoor versions, none matching Kaspersky's sample.

The operators built 28 versions of an Exchange key-stealing tool over two days in November 2025. A separate plugin steals data from 11 messaging apps, including WeChat, LINE, Telegram and WhatsApp. For WhatsApp Desktop they built a toolchain that recovers the local message database key and runs code inside the logged-in session.

Linux servers received two public kernel exploits for root, Copy Fail and Dirty Frag. Both ran straight from memory, and the first Dirty Frag command came five days after that bug was disclosed. At Caribbean ministries the attackers dropped a driver calling itself "Kaspersky Blinder & Sustained Killer", signed with a certificate that expired in 2012.

In the Philippines they deployed antino, a Rust implant that takes commands through Microsoft Graph. It was built on GitHub Actions. They ran proxies over Ably and Pusher and built 27 uploaders that send files to OneDrive and, from September 2026, Google Drive. Some 2025 GitDoor builds skipped GitHub for lookalike domains posing as Adobe and Outlook services, and in October 2026 one team probed GitLab.

Vietnam got a Cobalt Strike beacon built for one network. Its folder was named VPQH, the Vietnamese abbreviation for the Office of the National Assembly. The beacon reached its server through a proxy inside that network. Between August and September 2026 a custom Rust loader hid it in the Windows registry.

Apiiro sees one operation run by six regional teams. Each has its own GitHub accounts, relay servers and implant build. Their regions are Taiwan, the Philippines, Vietnam and Southeast Asia, Zambia and Uganda, South and Central Asia, and Latin America with Italy.

About 85% of all commands were written between 8 a.m. and 7 p.m. Beijing time, with a break at lunch. Activity all but stops on most mainland public holidays and resumes on the Saturdays China declares official workdays. The accounts use Yahoo and NetEase 163.com addresses, and the operators' framework is called medusa.

"We assess that the operators are an office team based in mainland China. That is an assessment, not proof, and it agrees with Sophos, which calls the group China-based, and with Kaspersky, which points to Chinese-speaking groups."

— Apiiro Research, "The spies left the door open", December 2, 2026

CC Switch was installed on one operator test machine. The tool switches the model provider behind the coding agents Claude Code and Codex. Nothing shows a coding agent at work, and the commands read as typed by hand.

Kaspersky's November 17 report covered GitDoor and a second backdoor, GraphDoor. Both hide their C2 behind Microsoft SharePoint, GitHub and Ably, and GitDoor uses one repository for commands and another for results. Kaspersky saw mainly government victims in Asia and Africa, narrower than Apiiro's 23 countries.

At a Taiwanese organization the attackers ran a MeshCentral agent. The entry point is unknown, but Kaspersky says evidence points to reuse of a prior infection.

Kaspersky found implants of two Chinese-speaking groups, FamousSparrow and CopperTurtle, in GitDoor's staging folders. Its seven repositories held 17,385 queued commands by November 17, and 17,382 were later deleted. Of the 22 relay servers Kaspersky listed, 20 appear in Apiiro's commands, and one Kaspersky C2 domain, ekmt.tw, mirrors the KMT's internal domain name. Sophos tracks a fragment of the same operation as BRONZE SANDCASTLE, a China-based group known for Sandboxie DLL side-loading and payload versions 1.1.5 and 1.1.7.

Apiiro reported the repositories to GitHub and the signed drivers to Microsoft on November 19, 2026. It notified CISA, the FBI and the national CERTs of 17 affected countries. By November 25, GitHub had taken down all 104 repositories. No patch applies, since GitDoor abuses a legitimate service, not a software bug.

Anyone who can write to a repository can send commands to the implant polling it. In an operation announced in January 2025, the FBI used the PlugX malware's own self-delete command to remove it from about 4,200 US computers.

"The channel that hid them can also remove them: GitHub, or law enforcement with a court order, could send the implants their own exit command, as the FBI did with PlugX in 2025."

— Apiiro Research, "The spies left the door open", December 2, 2026

Apiiro lists four signs of GitHub-based C2.

  • A server, or a desktop outside engineering, polling api.github.com/repos/<owner>/<repo>/contents around the clock, nights and weekends included.
  • Commits by INSOMNIA <INSOMNIA@github.com> with the message "commit from INSOMNIA" in any repository the organization can see.
  • Files matching main.<code>.<4 chars>.js or main.<code>.js, optionally ending in .kmap, .pmap, .apmap, .swp or .tmp, that appear and are later deleted in bulk.
  • GitHub polling from storage appliances, not only workstations. On Linux the operators ordered an autorun script written on a QNAP NAS.

Apiiro's appendix lists indicators shared across all six teams.

Type Indicator
Domains openclawapi.webredirect.org (custom remote-access tool, August 2026), n.deepso.org (custom remote-access tool, November 2026), rest.ably.io (benign, Linux proxy channel)
Side-loading pairs javaw.exe, jar.exe, jconsole.exe, jcef_helper.exe + jli.dll. sandboxiewuau.exe, Start.exe, updater.exe, agent.exe, component.exe + SbieDll.dll. wsc_proxy.exe + wsc.dll, updater.exe + libcef.dll, LineAppMgr.exe + msvcp140.dll, ituneshelper.exe + CoreFoundation.dll, zoomit.exe + winmm.dll, pythonw.exe + python39.dll, mpclient.exe + mpclient.dll, RtkNGUI64.exe + RtkNGUI64Loc.dll, adguardnetreg.exe + AdguardNetLib.dll, settings.exe + MSIMG32.dll, vmnat.exe + hpqhvsei.dll
Payload files config.ini (most common), usrClass.dat, store.dat, EASports.conf, ThirdPartyNotice.txt, update.log, legacy.key
Staging folders C:\ProgramData\intel, %LOCALAPPDATA%\Programs, %LOCALAPPDATA%\Microsoft\WindowsApps, C:\Users\Public, C:\Users\Public\Libraries, C:\ProgramData\ssh, C:\PerfLogs\sc2
Scheduled tasks \SystemOptimizer, \SystemOptimizerTemp, \SystemOptimizerCustomEvent, \SamsungMagician, Lenovo-BACKUP-<SID>, Adobe-Agent-<SID>, javaw-<SID>, \Microsoft\XblGameSave\Telemetry
Registry HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential = 1, set to store passwords in clear text
Files Record.exe with 2025.evtx (event-log wiper), proc.png, <host IP>.dmp, 11.txt (disguised LSASS dumps)
MD5 552f0a9cc5fc3755721fa49be05e8035, GitDoor sample published by Kaspersky (client version 1.1.6)

National teams that received Apiiro's victim lists have confirmed they are notifying the affected organizations.

Have a story? Become a contributor.

We work with independent researchers and cybersecurity professionals. Send us a tip or submit your article for editorial review.

Questions on the topic

What is GitDoor and how did it use GitHub?
GitDoor is a backdoor that polls a public GitHub repository for encrypted command files. Apiiro decoded 80,409 espionage commands from those repositories because Git kept every deleted file in its history.
Was the Trump Organization hacked in the GitDoor campaign?
According to Apiiro, the commands went to servers of a vendor that builds websites for private clubs, including about 20 Trump properties. Nothing in the log shows access to the Trump Organization's own network.
How can organizations detect GitHub-based C2 like GitDoor?
Apiiro advises looking for servers or non-engineering desktops polling api.github.com repository contents around the clock, and commits by INSOMNIA with the message "commit from INSOMNIA".