informa
News

Chinese-Affiliated APT31 Cloned & Used NSA Hacking Tool

APT31 cloned and reused a Windows-based hacking tool for years before Microsoft patched the vulnerability, researchers report.

APT31, an attack group affiliated with China, copied and used a National Security Agency (NSA) hacking tool years before Microsoft patched the vulnerability, Check Point Research reports.

Related Content:

8 Ways Ransomware Operators Target Your Network

Special Report: Understanding Your Cyber Attackers

New From The Edge: Breach Etiquette: How to Mind Your Manners When It Matters

Researchers have evidence revealing APT31 was able to access and clone a Windows hacking tool linked to the Equation Group, an operation discovered by Kaspersky in 2015. This group, described as one of the world's most advanced, is believed to have been active since 2001 or earlier and is widely thought to have ties to the NSA's Tailored Access Operations (TAO).

Both the American-affiliated and Chinese-affiliated versions of the hacking tool exploit CVE-2017-0005, a Windows privilege escalation vulnerability that was unknown at the time and previously attributed to APT31. The APT group has used its own version of the tool, which researchers call "Jian," since at least 2015 and until Microsoft patched the vulnerability in 2017.

Jian was caught and reported to Microsoft by Lockheed Martin's Computer Incident Response Team, indicating APT31 possibly used it against an American target. Some reports now indicate Lockheed Martin discovered the Chinese version of the tool used on a US-based network; however, it has not been confirmed which organization was affected. 

Now, researchers report Jian was actually a reconstructed version of an Equation Group tool. This tool, dubbed "EpMe," is one of four different privilege escalation exploits included in the DanderSpritz attack framework, a post-exploitation framework used by the Equation Group that has a range of tools for persistence, reconnaissance, lateral movement, and bypassing security tools. EpMe dates back to 2013, years before APT31 was caught using it in the wild.

While they may exploit the same vulnerability, Check Point researchers point to "meaningful changes" between the original EpMe tool and the repurposed Jian tool. 

"EpMe, the exploit by Equation Group, is much more comprehensive and more professional," says Itay Cohen, a Check Point senior security researcher. The entire DanderSpritz framework, of which EpMe is a small part, "is huge, it's very professional, and it's very well written," he continues. "On a personal note, it is one of the best malware frameworks I've ever analyzed."

When comparing EpMe to Jian, Cohen points to differences in the quality of the code. It's believed APT31 did not have access to EpMe's source code and reverse-engineered the tool. APT31 also made mistakes when implementing the exploit: The group tried to support Windows 2000, for example, even though this version of the OS wasn't affected by the vulnerability.

"They did [this] because they took artifacts from the exploit that they did not really understand," Cohen says. 

Two of the privilege escalation exploits in the DanderSpritz framework were zero-days at the time the framework was developed. One of these zero-days, code-named "EpMo," was never publicly discussed and patched by Microsoft in 2017 with no apparent CVE-ID. In a writeup of their findings, researchers say this was seemingly in response to the Shadow Brokers leak. The other two exploits in DanderSpritz are code-named ElEi and ErNi. 

Evidence indicates APT31 had access to EpMe's files, both the 32-bit and 64-bit versions, at least two years before the Shadow Brokers leak. So far, it's unclear exactly how APT31 gained access to the tool, though researchers have more confidence in some theories than others.

"It is always possible that when Equation Group deployed the exploit, it was somehow caught," says Check Point vulnerability researcher Eyal Itkin. Equation Group may have used it against a Chinese target in a network that was monitored, and the tool was captured and analyzed.

Another possibility is that Equation Group may have used EpMe against a third-party target. If APT31 was present on the same network, it may have discovered the tool there, he says. 

"We know for sure that different APTs monitor the networks they infiltrate," Itkin continues. "So if they find an additional APT, they will look for exploits and tools used by the APT so they can clone them."

A third, less likely option would be APT31's infiltration into Equation Group infrastructure, such as an attack server. However, Itkin notes that in this case, APT31 would have gained access to additional tools and exploits; so far, there is no evidence indicating this has occurred.

The Story Behind the Discovery: CPR Investigation
Check Point's malware and vulnerability researchers have spent the past few months focused on recent Windows privilege escalation exploits attributed to Chinese actors. It was during this investigation that they discovered the origins of the Jian tool.

"In this project, we revisit and analyze exploits, specifically zero-days in Windows," Cohen explains. "We do this in order to map and extract fingerprints from them. These fingerprints are unique artifacts that we find inside the exploit files and we then can use them to hunt, or to attribute, past and future exploits."

This discovery started with a single exploit, says Itkin. After reading reports and discovering additional exploits, they found matching artifacts, or modules, between two exploits that are attributed to Chinese actors: one from 2019, and one from 2017.

"Once we find a common module or shared resource between two samples, we can try to make it a unique artifact of [one] actor," he says. When they analyzed the CVE from 2017, researchers noticed unique configurations and artifacts, which they assumed would be used by the same developer in additional samples they analyze — if they can find them.

"Essentially, it's a shot in the dark," Itkin adds. "Sometimes we find a good artifact and we find additional samples; sometimes we find nothing."

In this case, researchers extracted an artifact from a sample of code, made a search based on the artifact, and surprisingly discovered Equation Group exploits instead of Chinese exploits. This was what ultimately led them to today's story and technical writeup, he notes.

Recommended Reading: