Threat Level: green Handler on Duty: Didier Stevens

SANS ISC: The Kill Chain: Now With Pastebin SANS ISC InfoSec Forums

Participate: Learn more about our honeypot network
https://isc.sans.edu/honeypot.html

Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!
The Kill Chain: Now With Pastebin

I have yet another maldoc sample. They still keep coming, these malicious Word and Excel documents with VBA macros designed to download a trojan. Each day they are slightly different, and sometimes I see something worth sharing.

The "sample of the day" (26B857A0A57B89166584CBB7167CAA19) includes Pastebin in its attack. When the VBA code executes, it downloads the contents of 2 pastes on Pastebin. First one is base64 encoded:

The base64 string decodes to pieces of scripts delimited by HTML-like tags:

These pieces of .BAT, .VBS and .PS1 scripts are recombined by the VBA code to produce the final scripts. These are written to disk in the temporary folder (%TEMP%).

On Windows XP, the VBA code launches a .BAT script, which in turn launches a .VBS script. This .VBS script downloads the trojan. The trojan is launched by the .BAT script.

On Windows Vista and later, the chain is longer and includes Powershell: the VBA code launches a .BAT script, which launches a .VBS script, which launches a .PS1 script. This .PS1 script downloads the trojan and launches it.
 

In both cases, the URL of the trojan is retrieved from a second paste on Pastebin:

As you can see, the trojan is hosted on Dropbox.

Including Pastebin in the kill chain adds flexibility for the malware authors. But it also makes the chain longer, possibly weaker, and it gives us one more opportunity to detect the attack.

I know several corporations that block sites like Pastebin. They are immune to this attack, if the VBA macro can not retrieve its instructions from Pastebin, it can not infect.

What's the policy for sites like Pastebin in your organization?

DidierStevens

401 Posts
ISC Handler
Looks oddly familiar to the analysis that I posted a couple days ago...

http://www.bleepingcomputer.com/forums/t/572650/another-look-at-the-dridex-banking-trojan/
Anonymous
Yes, this has been going on for a couple of days now.
I warned about it first via my Twitter account on Wednesday: twitter.com/DidierStevens/status/…
And then my blog: blog.didierstevens.com/2015/04/08/quickpost-maldocs-vba-and-pastebin/

If you look at the VT info, you'll see the time of the first submission: 2015-04-08 14:07:11 UTC
DidierStevens

401 Posts
ISC Handler
Good stuff. I found it within 3 intercepted e-mails at 11:47am Wednesday, and went from there. It was pretty much undetected when I submitted it to VT, but looks like most AVs have been updated. Wondering how long it will take for us to find the rotated payload file...
DidierStevens
2 Posts
Anybody find out what the 2 png files are for?

Powershell call to http://savepic.su/5530591.png

VB Call to http://savepic.su/5533663.png
Anonymous
For statistics. savepic.su displays counters for the pictures it hosts. First png was downloaded around 2900 times.
DidierStevens

401 Posts
ISC Handler
"What's the policy for sites like Pastebin in your organization?"

This is a great place for defense in depth. Here is how my network is protected from this :

1. Email spam detection & a/v
2. Email attachment filtering/scanning.
3. Office configured to send a security warning about macros - endusers educated
( I would deny all macros, but we have some excel users who rely on them )
4. Desktop a/v
5. Web access filtering denying pastebin/dropbox to common users ( Exceptions on a case by case basis )
6. endusers notified by internal security dept. email.

Work in progress :

Deny company provided mobile devices from installing dropbox.
DidierStevens
1 Posts

Sign Up for Free or Log In to start participating in the conversation!