|
|
Recently, McAfee Avert Labs received a suspicious CHM file containing nineteen wonderful pictures from a National Geographic article by Tolstoy Ilia, titled “Across Tibet from India to China”. Other security companies seem fascinated by these pictures too.
Interestingly, we received another suspicious CHM file a week earlier, also containing some images related to Tibet, and more specifically about Tsering Chungtak who was crowned Miss Tibet 2006!
(Just to clarify: a CHM file is a compiled and compressed Microsoft HTML Help file that can contain formatted text but also documents, scripts and executable files.
When a CHM file is opened, the HTML Help viewer, called hh.exe and located in the Windows directory, extracts the compressed files and executes them, that’s why CHM files are sometimes used maliciously.)
As the two cases looked similar (both drop a file named music.exe; both contained pictures related to Tibet), I decided to investigate them further and… bingo, both are linked to the same remote servers and involve the same family of malware (Spy-Agent.cp), which is a multi-part trojan composed of a loader, an infostealer, a backdoor component and an update installer.
Actually the file “music.exe” is just the first part of the puzzle – the figure below represents the attack architecture:

Although the CHM file will stay on the infected machine, music.exe will be deleted either by avp.exe (1st variant of the trojan) or by conime.exe (2nd variant). These two executable files also control the DLL loading.
The file zipfldr.dll (named the same as the file used in Windows’ built-in ZIP handling) is the infostealer component that stores data in two different files: C36YKNy.dat and C36YKNz.dat.
The former contains logs of when the execution of the dll started and stopped, the hostname and IP address of the machine, and the intercepted keystrokes. However the keystrokes will be written into the other logfile too.
The latter contains various data from the machine:
These passwords are retrieved from the Protected Storage System Provider key and by enumerating the Protected Storage. To do that the malware doesn’t load pstorec.dll directly but instead copies the file to xactsrv.dll located alongside the two .dat. This newly created dll file is loaded and its exported function PStoreCreateInstance() is called, providing an instance of IPStore.
Additionally, the malware uses the WNetEnumCachedPasswords() function from MPR.dll to gather cached passwords – a common trait of infostealer Trojans!
Last but not least zipfldr.dll attempts to connect to a remote server chosen amongst a list of three IP addresses. If successful two further components are downloaded:
The URL used doesn’t reference the executable files directly, moreover a server-side script receives a specific UID as the effective parameter. The parameter that means “let me get the other files please” is “DD01x51″.
As you can see below, the files are encoded in Base64 and they are enclosed between the tags “1401C4F9071401C4F92317″:


And as previously mentioned, the dll file is able to intercept keystrokes by installing a high-level keyboard hook (WH_KEYBOARD).
There is hardly anything to mention about winzip.exe (the malicious one, of course!): as it’s just an executable looking for new files to install and setup their required registry keys.
Setup.dat is the backdoor component. The control connection to the attacker’s machine is done by sending a HTTP request to the server-side script file again passing UID “DDF03”.
The remote server to contact is chosen from a list of ten hardcoded IP addresses and URLs, which are also stored in the following registry key:
[HKCU\Software\Kodak\Imaging\Etc\]
“host%d”=host_to_contact (where %d is a digit).
It’s worth mentioning that the list of hosts may be updated by the attacker at any time by using a specific command.
Other commands available during remote control also include:
[HKCU\Software\Kodak\Imaging\Etc\]
“Refresh”=local_date_and_time
The CHM files received were used in two targeted attacks, so this multi-part trojan is unlikely to be widely distributed, but I would not be surprised to find it for sale in underground forums”¦
Our detection includes all components of this malware as Spy-Agent.cp.dr!chm, Spy-Agent.cp.dr, Spy-Agent.cp.dll and Spy-Agent.cp, and of course we will still keep an eye out for similar attacks!!!
|
|
Wow a .chm file? Is CWS back in business? It’s been a while since I have seen that.
Thanks Elodie for this great analysis ! You rock babe !
Keep up the good work !
To Jack :
Maybe you could stop executing every file you get without knowing where they come from ?
You know, this is not a hack. This is a normal use of this file format. Like exe files, chm ones can execute some code.
For your second question, it’s like asking if there is a way to stop a self-extracting zip file to extract its content.
Moreover, once the malicious file is dropped, the “on-access scan” will detect it right away…
what are the best ways to protect from chm file attacks ?
Is there anyway we can stop this “drop” from chm file especially using AV software file access rules ?
Submit your own comments / message for this post