Threat Level: green Handler on Duty: Rick Wanner

SANS ISC: Internet Storm Center - SANS Internet Storm Center Internet Storm Center


Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!

Latest Diaries

It's Not An Invoice ...

Published: 2017-08-20
Last Updated: 2017-08-20 12:50:28 UTC
by Didier Stevens (Version: 1)
0 comment(s)

Jeff received an invoice via email, did not trust it and submitted it to us.

As expected, it was not an invoice, but a malicious Word document (MD5 9c4c3234f20b6102569216675b48c70a).

I do a step by step analysis in this diary entry, but you can also watch a video of the analysis:

Let's take a look with oledump.py:

As we can see from the M and m indicators, there are streams inside this OLE file with VBA macros.

Let's take a look at the first stream with macros:

This code seems to contain a lot of useless strings, to obfuscate the real malicious code. But we see an autoopen subroutine, so this code will automatically execute when the document is opened (and permissions are given).

One of the tricks I like to use to quickly search through obfuscated code, is to look at lines that contain a dot (.), like this:

So we see CreateObject, with Run$. And also an expression accessing the "Comments" document property.

Let's take a look at the metadata:

It sure looks like the comments property contains BASE64 data. Let's try to decode it with base64dump.py:

This looks like UNICODE text, let's take a closer look:

It's definitively UNICODE text, a PowerShell script.

Let's extract it (option -S dumps strings):

This PowerShell script is obfuscated: backquotes are used inside variable names (W`scR`Ipt) and strings are split.

But we can still see that some string fragments contain URLs. We can take the PowerShell expression that concatenates the split string with URLs, to recover the URL. Doing this in PowerShell is not a risk, since this is a pure string expression that does not execute any malicious code.

When I did this analysis, 4 URLs were still active and hosted the same malicious executable (MD5 72fd33962214213bfa5d5a166e21b526): a variant of Emotet.

Didier Stevens
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

Keywords: maldoc powershell
0 comment(s)

If you have more information or corrections regarding our diary, please share.

Recent Diaries

tshark 2.4 New Feature - Command Line Export Objects
Aug 19th 2017
2 days ago by Guy (0 comments)

EngineBox Malware Supports 10+ Brazilian Banks
Aug 18th 2017
3 days ago by Renato (0 comments)

Maldoc with auto-updated link
Aug 17th 2017
4 days ago by Xme (1 comment)

Analysis of a Paypal phishing kit
Aug 16th 2017
5 days ago by Xme (0 comments)

(Banker(GoogleChromeExtension)).targeting("Brazil")
Aug 15th 2017
6 days ago by Renato (0 comments)

Malspam pushing Trickbot banking Trojan
Aug 15th 2017
6 days ago by Brad (0 comments)

Sometimes it's just SPAM
Aug 14th 2017
1 week ago by DidierStevens (0 comments)

View All Diaries →

Latest Discussions

Mobile App TLS connection
created Aug 13th 2017
1 week ago by Anonymous (0 replies)

RSS Feed: Example of Infocon level change?
created Aug 8th 2017
1 week ago by Matt M. (2 replies)

Topics
created Aug 4th 2017
2 weeks ago by Anonymous (0 replies)

Benefits of IoT Security
created Aug 1st 2017
2 weeks ago by Madison (0 replies)

Phishing mail/URL link scanning with the online/freeware tool.
created Jul 26th 2017
3 weeks ago by Anonymous (0 replies)

View All Forums →

Latest News

View All News →

Top Diaries

Wide-scale Petya variant ransomware attack noted
Jun 27th 2017
1 month ago by Brad (6 comments)

Using a Raspberry Pi honeypot to contribute data to DShield/ISC
Aug 3rd 2017
2 weeks ago by Johannes (10 comments)

Maldoc with auto-updated link
Aug 17th 2017
4 days ago by Xme (1 comment)

OAUTH phishing against Google Docs ? beware!
May 3rd 2017
3 months ago by Bojan (6 comments)

Microsoft Patch Tuesday August 2017
Aug 8th 2017
1 week ago by Johannes (6 comments)