All your MP3s are belong to us

2008-09-01

Christoph Alme

Secure Computing, Germany

Micha Pekrul

Secure Computing, Germany

Dennis Elser

Secure Computing, Germany
Editor: Helen Martin

Abstract

Christoph Alme and his colleagues walk through the complete attack process of the Win32.ASF-Hijacker.A trojan, which has two different sets of victims: those affected by the trojan itself and those affected by media files altered by the trojan.


Shortly following the appearance of the crafted malicious ASF (Advanced Systems Format) media files that hit the road earlier this year [1], a new class of malicious ASF media file appeared with growing prevalence. The malicious files seemed to have originated from legitimate (benign) media files which were all tampered with in the same way. It took another month and some more close collaboration with fellow malware researchers to finally get hold of the nasty newbie and find the missing part of the puzzle. In this article, we walk through the complete attack process of the Win32.ASF-Hijacker.A trojan, which has two different sets of victims: those affected by the trojan itself and those affected by media files altered by the trojan.

Delivering the goods

The root of all evil lies on a ‘warez’ website in this instance. People searching for serial numbers, cracks or key generators may find themselves with a trojan downloader instead of ‘just’ the illegal content they were looking to download. In this case, the search for an activation key for the popular Nero Burning ROM program does the undesired trick. A simple hidden IFrame pointing to a page that embeds the executable as an OBJECT element triggers a drive-by download.

Attack process in two stages.

Figure 1. Attack process in two stages.

The downloader retrieves an XOR-obfuscated list of malware download URLs from ‘smart-security.biz’, then downloads the various malware files – one of which is the ASF-infector component. Paying respect to desktop firewalls in its very own way, the downloader first creates remote threads in either the Internet Explorer or Firefox browser and then lets this trusted process perform the download. To add to our headache, the downloader retrieves what appears to be a legitimate GIF image. The image can be displayed as normal, but the file’s header denotes the image size as 52 x 34 pixels – GIF images of this size are normally about 2 KB in size, but this one is 36 KB, so there seems to be some ‘added value’ in it. A comparison of the supposed GIF image to a set of benign GIF images of the same file size reveals only slight deviations in their data’s overall information entropy gradient (see Figure 2). The benign GIFs’ data is just as random (e.g. compressed at similar quality), but the insidious GIF shows two anomalous downward spikes that bear some resemblance to an executable’s section padding areas.

Information entropy gradients of insidious GIF (yellow) compared to several benign GIFs (all green).

Figure 2. Information entropy gradients of insidious GIF (yellow) compared to several benign GIFs (all green).

Indeed the infector component is compressed with the PECompact runtime packer, XOR-obfuscated and appended to the GIF image. While the downloader retrieves the key to deobfuscate the infector component from the file at eight bytes from its end, an x-ray scan for a valid PE header easily reveals the embedded executable as well.

Probably as a countermeasure against desktop behaviour blockers and on-disk scanning, the infector component does not touch down on the hard disk at any time – except for infecting all your precious MP3s and videos, that is. Having deobfuscated the infector component, the trojan downloader does not drop and execute it; instead it executes the legitimate ‘winver.exe’ from the Windows installation as a suspended process. Then it replaces the complete executable image in memory by unloading winver.exe’s image via ntdll’s ZwUnmapViewOfSection() API (from user mode), mapping the infector component into the process space through WriteProcessMemory(), and finally resuming the main thread of the process.

Hijack and exit

The trojan searches for MP2, MP3 (MPEG-1 Layer 3) and ASF media files on the local hard disk and on mapped shares (all drives with a Win32 API drive type of either DRIVE_FIXED or DRIVE_REMOTE). The Windows Media Format SDK’s WMCreateReader() and WMCreateWriter() APIs are used to convert MP2 and MP3 files to ASF format first, before using the WMCreateEditor() API to create an ‘IWMMetadataEditor’ COM object and injecting a script command via a call to the AddScript() method of the ‘IWMHeaderInfo’ interface of the same COM object (see Figure 3).

Spot the difference: MP3s before and after running the trojan.

Figure 3. Spot the difference: MP3s before and after running the trojan.

The Advanced Systems Format (ASF) is a general-purpose container format for media files, used for Windows Media Video (WMV) and Windows Media Audio (WMA) files, for example. The ASF format basically consists of data chunks, each starting with a 16-byte GUID identifier followed by an unsigned 64-bit field containing the length of this chunk in bytes (including the chunk’s header). The interesting chunk, which can contain script commands [2], has the GUID ‘30 1A FB 1E 62 0B D0 11 A3 9B 00 A0 C9 03 48 F6’ (in raw byte order). Similar to the ‘HREF track’ in QuickTime movies [3], script commands are executed based on elapsed playback time. Skipping the chunk’s header and a first array with type information, a second array follows with all the script commands encoded in UTF16 Little-Endian. It is not zero-terminated, but the number of characters is stored in an unsigned 16-bit field in front of each string.

Conversion and infection steps visualized in IDA Pro.

Figure 4. Conversion and infection steps visualized in IDA Pro.

The script command that the trojan injects is named ‘URLANDEXIT’, followed by a URL that will be opened with the default browser when playing the media file. The trojan infects all ASF media files, including the converted MP3s, with ‘URLANDEXIT’ commands to point collectively to ‘isvbr.net’, a domain hosted in Hong Kong. At the time of writing, the site returns a 302 status code to then redirect to the real malicious site, currently ‘flashcodec.com’.

When done with its raid, the trojan changes a registry setting (‘URLAndExitCommandsEnabled’) and an INI file that alter the default behaviour of Windows Media Player and WinAmp, respectively. These changes will cause the compromised computer’s media player to ignore any ‘URLANDEXIT’ script commands, so the user can play their videos and audio streams without noticing any change.

And here comes the codec

So what’s the point in infecting media files on the compromised computer, but then disabling the feature that would allow the injected script commands to run? The victim of this first stage of attack acts as a proxy to spread the second stage, and they won’t notice. The user may be exchanging music files or videos on file-sharing portals or peer-to-peer networks, such as Gnutella (the network behind the popular Limewire client). As the infection remains unnoticed by the user, sooner or later they will upload files to share with others (in exchange for new files). The road to hell is paved with good intentions – sometimes illegal ones, too.

Those unlucky users who download these files and try to play them will receive a notification stating that a codec is missing and needs to be installed in order to play the video or audio stream. A well-known social-engineering trick, it is not surprising to find that this codec is actually malware. The only slight surprise is that in this case, it is not a Zlob trojan but an LDPinch password-stealer.

Do you want to run this software? No, you don’t!

Figure 5. Do you want to run this software? No, you don’t!

Probably in order to enforce compatibility with the Windows Firewall (apologies for the sarcasm), the LDPinch password-stealer adds itself to the following registry key in order to pass through it without any alerts: HKEY_LOCAL_MACHINE\SYSTEM\...\FirewallPolicy\...\AuthorizedApplications\List

Once that has been done, it can harvest all kinds of credentials – such as from the victim’s ICQ, Miranda or Trillian installations, credentials stored in FTP clients and in the Firefox and Opera web browsers, Outlook mail account credentials, and last but not least Windows Dial-Up network credentials. All the goods are delivered back through HTTP POST requests to ‘keygenguru.com’, a domain hosted in Russia.

Conclusion

Simply staying away from shady or illegal websites won’t necessarily keep you safe these days – with SQL injection and ‘malvertizing’ hitting many legitimate websites – but in the case of the Win32.ASF-Hijacker.A trojan, it would. Users downloading from peer-to-peer networks need to exercise caution anyway (without going into a discussion of the legal implications), but they also need to be wary of any pop-ups that appear while playing a downloaded video or audio stream: a strong indication that they should bail out quickly.

Surprisingly, the ‘missing codec’ trick remains one of the most widespread and obviously successful social-engineering tricks. As is so often the case, running one’s PC with a limited user account rather than as Administrator with full privileges would also help protect against the undesired installation of the fake codec. Doing so raises the bar for the attackers, and does not even require Windows Vista.

Bibliography

[2] Microsoft Corp.: Using Script Commands Supported by Windows Media Player. http://msdn.microsoft.com/en-us/library/aa391231(VS.85).aspx.

[3] Alme, C.; Elser, D. Blow up your video. Virus Bulletin, December 2007, p.13. http://www.virusbtn.com/virusbulletin/archive/2007/12/vb200712-blow-up-video.

twitter.png
fb.png
linkedin.png
hackernews.png
reddit.png

 

Latest articles:

Nexus Android banking botnet – compromising C&C panels and dissecting mobile AppInjects

Aditya Sood & Rohit Bansal provide details of a security vulnerability in the Nexus Android botnet C&C panel that was exploited to compromise the C&C panel in order to gather threat intelligence, and present a model of mobile AppInjects.

Cryptojacking on the fly: TeamTNT using NVIDIA drivers to mine cryptocurrency

TeamTNT is known for attacking insecure and vulnerable Kubernetes deployments in order to infiltrate organizations’ dedicated environments and transform them into attack launchpads. In this article Aditya Sood presents a new module introduced by…

Collector-stealer: a Russian origin credential and information extractor

Collector-stealer, a piece of malware of Russian origin, is heavily used on the Internet to exfiltrate sensitive data from end-user systems and store it in its C&C panels. In this article, researchers Aditya K Sood and Rohit Chaturvedi present a 360…

Fighting Fire with Fire

In 1989, Joe Wells encountered his first virus: Jerusalem. He disassembled the virus, and from that moment onward, was intrigued by the properties of these small pieces of self-replicating code. Joe Wells was an expert on computer viruses, was partly…

Run your malicious VBA macros anywhere!

Kurt Natvig wanted to understand whether it’s possible to recompile VBA macros to another language, which could then easily be ‘run’ on any gateway, thus revealing a sample’s true nature in a safe manner. In this article he explains how he recompiled…


Bulletin Archive

We have placed cookies on your device in order to improve the functionality of this site, as outlined in our cookies policy. However, you may delete and block all cookies from this site and your use of the site will be unaffected. By continuing to browse this site, you are agreeing to Virus Bulletin's use of data as outlined in our privacy policy.