Recently, FortiGuard Labs came across several malicious documents that exploit the vulnerability CVE-2012-0158. To evade suspicion from the victim, these RTF files drop decoy documents containing politically themed texts about a variety of Vietnamese government-related information. It was believed in a recent report that the hacking campaign where these documents were used was led by the Chinese hacking group 1937CN. The link to the group was found through malicious domains used as command and control servers by the attacker. In this blog, we will delve into the malware used in this campaign and will try to provide more clues as to the instigator of this campaign.
Sample decoy documents
When the documents are opened, they drop several files in one of the following folders:
Some samples drop the following files:
Taskeng.exe – signed legitimate GoogleUpdate.exe version 188.8.131.52
Psisrndrx.ebd – encrypted blob containing malware file
Goopdate.dll – decrypter and loader of malware file
Some drop the following files:
SC&Cfg.exe – signed legitimate McAfee AV application
Vsodscpl.dll – contains the malware file
Others drop the following files:
Systemm.exe - signed legitimate GoogleUpdate.exe version 184.108.40.206
Systemsfb.ebd - encrypted blob containing malware file
Goopdate.dll – decrypter and loader of malware file
Similar to other APT attacks, such as MONSOON APT, this APT uses DLL hijacking to evade the behavior monitoring technologies of security programs.
DLL hijacking is a technique used by some APT malware in which instead of the legitimate application (.exe) loading the benign DLL, the application is tricked into loading a DLL containing malicious code. This technique is employed to evade Host Intrusion Prevention System (HIPS) of security programs that monitor the behaviors of executed files. Most HIPS tools whitelist signed or trusted files, thereby excluding malware loaded using DLL hijacking by signed files from behavior monitoring.
In the context of this attack, taskeng.exe and SC&Cfg.exe are signed legitimate applications; however, they are tricked into loading malware that are disguised as the legitimate Goopdate.dll and Vsodscpl.dll files.
Taskeng.exe and SC&Cfg.exe file information
Next, Taskeng.exe needs to load and import some functions from the original Goopdate.dll file; however, the Goopdate.dll was hijacked to contain malicious code, effectively changing the original code execution to execution of the malicious code.
Snippet from taskenge.exe that loads goopdate.dll
In the same fashion, SC&Cfg.exe imports the “dll_wWinMain” function from the original vsodscpl.dll, but this DLL was hijacked as well, and also contains malicious code.
SC&Cfg.exe import table containing import from vsodscpl.dll
Once the malicious DLLs are loaded, the DLLs decrypt (from psisrndrx.ebd (1st case) or from its body (2nd case)) and load a Trojan downloader. The Trojan downloader is a DLL file. It is not dropped on disk but is only executed in memory. Also, the actual Trojan downloader in memory when dumped will not run. This is because the ‘MZ’ in the IMAGE_DOS_HEADER, the DOS stub, and the ‘PE’ signature were deliberately removed. This was done to prevent the dumped file from being analyzed properly in a debugger and decompiler. However, we can easily fix the dump by adding the ‘MZ’, a DOS stub, and the ‘PE’ signature.
Missing header items as anti-analysis
This Trojan downloader downloads a RAT (Remote Access Trojan), which we will call “NewCore” RAT, from the following domains:
The Trojan downloader first creates an autostart registry entry so it runs whenever the machine is rebooted:
Microsoft Windows Media = “%AppData%\Microsoft\Credentials\
As an anti-VM, it checks whether the environment has the registry key:
Before it can download the NewCore RAT, it needs to send the following information to the C&C server:
The above information is converted to its hex string representation, and then sent to the C&C server via HTTP GET:
GET request to the C&C server
The response is an XOR encrypted data that includes the encrypted NewCore RAT.
Response from the server
XOR decryption of response from the C&C server
We named this RAT ‘NewCore’ after we found the project name used by the author, which is indicated on the following PDB file string:
Malware project name
According to its compilation time stamp, this malware was compiled on March 16, 2017.
However, as of this writing, only a few Antivirus engines, including Fortinet detect this malware according to VirusTotal.
This RAT is a DLL file. Its malicious routines are contained in its imported function “ProcessTrans”. However, executing the DLL without using the downloader will not work as the C&C server string is not embedded in its body. When the downloader calls the function “ProcessTrans”, it supplies to the function the C&C server string and a handle to the C&C server internet session. In this case, Heuristic detection based on behavior will not work on the DLL alone.
This RAT is capable of the following:
Shutdown and restart machine commands
File manager, monitor screen, command shell commands
File manager subcommands
Based on the strings found in its body, this malware may have been derived from the PcClient and PcCortr backdoors whose source codes are publicly available, especially on Chinese language coding forums. PcClient detections usually include PcCortr.
Strings related to PcCortr modules
PcClient and PcCortr source codes can be downloaded from Chinese coding forums
PcClient was used in the past by some APT groups such as Nitro, which were also linked to a China-based hacker.
According to the PDB file string embedded in the NewCore RAT body, the creator of the project is someone using the handle “hoogle168”.
We have little clue as to who this individual is, so we tried to look for information about this handle. Our investigation led us to several Chinese language forum pages. Looking at these forums, it seems like a user using the handle “hoogle168” is very active on a certain coding forums, and is proficient in C and VC++. This user even replied to a thread and gave advice on what to learn to develop remote control software. We don’t know for sure if this person is the NewCore author.
To prevent triggering this RTF exploit, it is important to apply the patches released by Microsoft that cover CVE-2012-0158 vulnerability.
Fortinet also covers detection for these threats as MSOffice/Dropper!exploit.CVE20120158 for the malicious RTF files, and W32/NewCore.A!tr.bdr for the payload.
C&C URLs were also blocked using Fortinet's FortiGuard Web Filtering.
NewCore RAT may just be a rehashed PcClient RAT, but it proves to be effective in evading AV detection by using a combination of simple techniques such as DLL-hijacking, file-less execution of downloaded malware, and passing C&C information as parameter from downloader to the downloaded file.
As always, Fortiguard Labs will keep an eye on threats like NewCore to protect our customers against these threats.
Thank you to Tien Phan for additional insights.
-= FortiGuard Lion Team =-
Command and Control Servers:
Sign up for weekly Fortinet FortiGuard Labs Threat Intelligence Briefs and stay on top of the newest emerging threats.