An Interesting Bypass
September 30, 2010I was analyzing a piece of malware the other day and came across a unique method to place malware locally on a host without using the network to transfer it. This is something that is so simple in design, and yet so effective in its delivery. Let’s take a closer look.
To get the malicious file, one would simply need to visit or open malicious HTML content. Okay, we’ve heard of this before: bad sites and unexpected emails are breeding grounds for bad stuff. Of course you know to stay away from those things, and of course you should have the Internet security settings locked down, or at the least have them set to warn.
In fact, when viewing the HTML in Internet Explorer, we do get the warning about restricting the file from showing active content.
Cool. That offers a bit of relief to those who have taken some precautions or at least have left the Internet Explorer defaults, so they will have a forewarning. (A little social engineering may still allow success, but that’s a whole other discussion.)
Let’s say for argument’s sake that you didn’t have minimum protection, or got social-engineered. (This would never happen, right?)
If you did allow the content to run, the malware would start to build a text file using simple commands by echoing and then piping hex into a file. In the code below you will notice the MZ header being added:
objShell.Run “cmd /c echo 4d 5a… >> textfile.hex”
The malware continues until the file is complete:
objShell.Run “cmd /c echo c6 08 d1 00 3a 00 00 00 00 00… >> textfile.hex
etc… etc..
So now we have a full hex text file, built from the HTML commands and placed onto your desktop. All is done locally. There is no traffic going across the wire; thus this process would bypass network IDS or other network monitors that you may have.
So what does this malicious HTML do next?
I don’t want to go into too many details, but suffice it to say a method is used to turn this hex file into a binary using just two commands.
The only thing left is to run the executable.
It’s as simple as:
objShell.Run “cmd /c Malicious_File.exe”
In the sample I analyzed, the executable was corrupted and could not run. Had it worked, however, the host would now be infected, with no sign of a download.
The take-away is to be sure you are cautious of active content when visiting websites. This also shows us that malware does not have to be overly technical to bypass certain controls. Ingenuity counts for much; therefore, the fight continues.
As always, browse safely.
Oh, yes we do detect the malicious HTML file as Generic Dropper.xa in our supported DATs.
Posted by Kevin Beets




