A thorough investigation into reputed Chinese APT actor Winnti Group turned up a previously undocumented backdoor that was used to compromise a popular Asian mobile hardware and software vendor — perhaps as a prelude to launching a major supply chain attack against its users.
Dubbed PortReuse, the modular malware is a passive network implant that piggybacks on an active process’s open TCP port and then lays in wait for a "magic packet" before launching malicious activity, according to ESET researchers Marc-Etienne M.Léveillé and Mathieu Tartare in a newly released white paper and corresponding blog post. ESET does not specifically name the Asian tech company that was targeted by the malware, but does note that it did notify the company and has been collaborating on a remediation of the attack.
Also known as APT 41, Axiom and Blackfly, the Winnti Group has historically been tied to a number of prominent supply chain attacks that replace companies’ legitimate software with weaponised versions in order to infect the machines that install them. Its members have often targeted game developers and their users, inserting backdoors into various games’ build environments. Malware associated with Winnti Group include CCleaner, ShadowPad, ShadowHammer and, of course, Winnti, after which the ATP group is named.
ESET researchers describe PortReuse as a "listening-mode modular backdoor" that "injects into a running process already listening on a TCP port." In essence, it is reusing an already open port; hence, its name. It then "hooks the receiving function and waits for a ‘magic packet’ to trigger the malicious behavior. The legitimate traffic is forwarded to the real application, so it is effectively not blocking any legitimate activity on the compromised server."
ESET further reports that PortReuse’s initial launch file arrives in one of three formats: embedded in a .NET application the launches the Winnti packer shellcode, a VBScript that deserialises and invokes a .NET object that launches the shellcode, or as an executable with shellcode directly at the entry point.
"Only a single file is written to disk to start PortReuse," the white paper explains. "All other components exist in memory only," presumably to minimise the malware’s footprint. Additionally, no command-and-control server address is coded into the malware, because it uses NetAgent, a module that handles TCP hooking, to listen in on open sockets for the attacker to connect directly to the compromised host.
NetAgent is just one of the malware’s components. The first of these components to be launched is InnerLoader, which looks for a specific process in which to inject NetAgent and another payload called SK3. The latter of these two payloads decrypts and processes encrypted traffic that is forwarded by NetAgent through a named pipe. The SK3 module comes with two packed executables that are included for the purpose of executing commands in other processes and proxying communications. In some PortReuse variants of, NetAgent and SK3 are packaged together.
According to ESET, PortReuse typically targets ports 53, 80, 443, 3389 and 5985.
Knowing the magic packet that triggers the malicious activity, ESET researchers, with assistance from public search engine Censys, scanned the internet for potential victims of the PortReuse campaign and found eight IP addresses that replied with an HTTP response that matched PortReuse’s signature. All of them belonged to the Asian hardware/software manufacturer that was found to be compromised.
On a separate note, ESET also reported that the Winnti Group actors continue to use and update their ShadowPad malware, which is still being updated and used multiple times in 2019, while still using the same modular approach with additional obfuscation techniques.
The original version of this article was published on SC Media US.