China-backed hacker group APT41 has breached six U.S. state governments.

Prolific for carrying out state-sponsored espionage as well as financially motivated activity, APT41 conducted a months-long campaign, using vulnerable internet-facing web applications, including a zero-day vulnerability in the USAHerds application,  as well as the now-infamous zero-day in Log4j, to infiltrate and compromise at least six U.S. state government networks.

While the campaign’s purpose remains unknown, Mandiant’s investigation into each of these intrusions revealed APT41 leveraged several new techniques, malware variants, evasion methods and capabilities.

In three investigations from 2021, APT41 exploited a zero-day security vulnerability in the USAHerds web application a CoTS application written in ASP.NET and used by 18 states for animal health management. Once APT41 obtained the machineKey, the group compromised servers on the internet running USAHerds; as such, Mandiant warns there are additional unknown victims.

The breach occurred due to hardcoded credentials and text credentials in source code, explains Joshua Aagard, Vulnerability Analyst on the Photon Research Team at Digital Shadows. Embedded credentials, often placed in source code for convenience of access rather than neglect, lamentably enabled access for all servers once the brute force was accomplished. “Thus, the app permitted access to the application server, and the server allowed access to the networks of half a dozen state governments,” Aagard says. “A threat actor that can pinpoint an attack on target which monitors food supply safety such a custom target and combine it with a widespread vulnerability, such as Log4Shell, is opportunistic as well as resourced.”

Mandiant says APT41’s most recent campaign began shortly after the release of the famous security vulnerability in Log4j and its related proof-of-concepts exploits in December 2021.

After gaining access to an internet-facing server, the espionage group performed extensive reconnaissance and credential harvesting, Mandiant says. Using common tactics such as deploying a ConfuserEx obfuscated BADPOTATO binary to escalate privileges, they began credential harvesting and exfiltration.

While investigating one of the U.S. government intrusions, Mandiant observed a new malware family, tracked as DUSTPAN, used by APT41. DUSTPAN an “in-memory dropper written in C++” leverages ChaCha20 (a family of stream ciphers) to decrypt embedded payloads. Mandiant also observed APT41 continuing to use advanced malware in their toolkit, including the DEADEYE launcher and LOWKEY backdoor, with added security capabilities and anti-analysis techniques that hinder investigations.

During multiple of Mandiant’s investigations, the threat group packaged their malware with VMProtect to slow reverse engineering efforts, and even incorporated another anti-analysis technique by pairing a VMProtect packaged DEADEYE binary into multiple sections on disk, reducing the chance that all samples can be successfully obtained during a forensic investigation. The group also changed standard VMProtect section names (.vmp) to UPX section names (.upx) to further evade basic hunting detections. 

The recent activity demonstrated that APT41 can quickly adapt, retool, deploy capabilities through new attack vectors all while remaining undeterred by the U.S. Department of Justice (DOJ) indictment in September 2020, in which APT41 actors were charged with computer intrusion campaigns against more than 100 victims globally.

A critical step organizations can take in responding to these threats, including Log4j, is to have a thorough inventory of systems, including a detailed breakdown of deployed software to quickly remediate systems when vulnerabilities are found, says Silas Cutler, Principal Reverse Engineer at Stairwell.

Because Log4j is a utility integrated into numerous other pieces of software, it will take a long time for this issue to be resolved, and “software companies need to ensure they are using up-to-date versions of Log4j in their products,” Cutler says.

While the security industry has focused on Ukraine over the past two months, Cutler warns that the threat of attacks from cybercrime groups and other nation-state actors has not diminished. “Researchers like myself have been anticipating this for some time and forecasting how long it would take before Chinese threat actors start escalating attacks while the spotlight is on Ukraine,” he adds.

Cutler notes that TA416/Mustang Panda has reportedly shifted part of their targeting to potentially collect information related to refugee policies of European countries since the start of the conflict. “Groups like APT41, who have a proven track record of being able to scale up their attacks, certainly pose a greater risk at this time,” Cutler says.