Researchers Analyze Vietnamese Hackers’ Suite of RATs
BlackBerry Cylance security researchers have analyzed a suite of remote access Trojans (RATs) that the Vietnam-linked threat actor OceanLotus has been using in attacks for the past three years.
Also referred to as APT32, CobaltKitty, and APT-C-00, the OceanLotus group has been targeting corporate and government organizations in Southeast Asia, particularly in Vietnam, the Philippines, Laos, and Cambodia.
The group is known for the use of a two-stage malware deployment method, employing a dropper for the initial stage of the attack, along with a backdoor to perform actions on the target system.
The hackers have been using a suite of RATs the security researchers refer to as Ratsnif that provide them with new network attack capabilities. The RATs provide capabilities such as packet sniffing, gateway/device ARP poisoning, DNS poisoning, HTTP injection, and MAC spoofing.
The researchers analyzed a total of four Ratsnif samples, three developed in 2016 and one in the second half of 2018.
The earliest of the samples was compiled on the same day its command and control (C&C) domain was first activated. Another variant was compiled in September 2016, less than 24 hours after the previous sample.
The sample appears to have been automatically submitted to an online scanning service by the developer within 1 minute after being compiled. A release build, this is likely one of the first variants of Ratsnif to have been deployed in attacks.
The sample’s capabilities include HTTP communication with the C&C, packet sniffing, ARP poisoning, DNS spoofing, HTTP redirection, and remote shell.
Upon execution, the malware creates a mutex and harvests system information such as username, computer name, workstation configuration, Windows system directory, and network adapter details. The information is sent to the C&C and the threat then starts routing logs to the C&C.
Next, it loads wpcap.dll and imports a series of functions, after which it receives a command code to check for commands every 10 seconds. The RAT features one or more hardcoded C&C domains along with support for over a dozen commands received via HTTP.
Observed in the second half of 2018, the fourth Ratsnif sample introduces a configuration file and does not rely on C&C for operation. It also includes HTTP injection, protocol parsing, and SSL hijacking capabilities.
The actual sniffer is hidden within a loader DLL that decodes the payload, copies it to memory and executes a first stage shellcode to decompress the binary and execute the second stage shellcode in a separate thread. This shellcode will then inject the sniffer executable into memory.
After execution, the sniffer reads the configuration from the specified file, decodes it and parses it to an in-memory structure. If the “-sniff” parameter is specified in the configuration, it adds a firewall exception and disables Large Send Offload (LSO) for each network adapter in the registry.
The malware also creates threads responsible for ARP poisoning and DNS spoofing and performs SSL hijacking to decrypt SSL traffic using the WolfSSL open source library, along with separately supplied certificate and private key files.
The malware asks for the MAC addresses of all the machines on the subnet specified in the configuration, then sends unsolicited ARP packets to those addresses, updating the MAC address of the default gateway for each victim so as to route all traffic through Ratsnif and potentially manipulate it.
“Ratsnif is an intriguing discovery considering the length of time it has remained undetected, likely due to limited deployment. […] While all samples borrow heavily from open-source code/snippets, overall development quality is deemed to be poor. Simply put, Ratsnif does not meet the usual high standards observed in OceanLotus malware,” Blackberry Cylance concludes.