ISC Stormcast For Wednesday, October 25th 2017 https://isc.sans.edu/podcastdetail.html?id=5726

BadRabbit: New ransomware wave hitting RU & UA

Published: 2017-10-24
Last Updated: 2017-10-24 16:09:36 UTC
by Xavier Mertens (Version: 1)
4 comment(s)

About 2 hours ago, reports started to come about a new ransomware wave hitting RU Media agency Interfax, but it is extending to others in both RU and UA
https://www.bloomberg.com/news/articles/2017-10-24/russian-news-agency-interfax-faces-unprecedented-hacker-attack
https://frontnews.eu/news/en/16198
https://twitter.com/GroupIB/status/922818401382346752

It seems to be delivered via malicious URL as fake flash update and then using EternalBlue and Mimikatz for lateral movement and further spreading.

1dnscontrol[.]com/flash_install.php

Discoder/#BadRabbit IOCs as found by ESET:
Dropper:
https://www.virustotal.com/en/file/630325cac09ac3fab908f903e3b00d0dadd5fdaa0875ed8496fcbb97a558d0da/analysis/
https://www.virustotal.com/en/file/8ebc97e05c8e1073bda2efb6f4d00ad7e789260afa2c276f0c72740b838a0a93/analysis/

There are still lots of speculation though as analysis is early stage, more need to come. At least it's not Friday!

Xavier Mertens (@xme)
ISC Handler - Freelance Security Consultant
PGP Key

4 comment(s)

Stop relying on file extensions

Published: 2017-10-24
Last Updated: 2017-10-24 07:05:45 UTC
by Xavier Mertens (Version: 1)
3 comment(s)

Yesterday, I found an interesting file in my spam trap. It was called '16509878451.XLAM’. To be honest, I was not aware of this extension and I found this on the web: "A file with the XLAM file extension is an Excel Macro-Enabled Add-In file that's used to add new functions to Excel. Similar to other spreadsheet file formats, XLAM files contain cells that are divided into rows and columns that can contain text, formulas, charts, images and… macros!” Indeed, the file contained some VBA code:

$ oledump 16509878451.XLAM
A: xl/vbaProject.bin
A1:       463 'PROJECT'
A2:        80 'PROJECTwm'
A3: M   18788 'VBA/RRWIx'
A4: m     991 'VBA/Sheet1'
A5: M    1295 'VBA/ThisWorkbook'
A6:      8673 'VBA/_VBA_PROJECT'
A7:      1665 'VBA/__SRP_0'
A8:       243 'VBA/__SRP_1'
A9:       214 'VBA/__SRP_2'
A10:       230 'VBA/__SRP_3'
A11:       557 'VBA/dir'

The file is already know on VT (SHA256: c55e26fff6096362fab93dd03b6b4c5e4e62ed5a8a7fc266c77f34683b645bf6[1]) and contains a dropper macro that grab the following payload: hXXps://a.pomfe[.]co/ezrtecm.png. Nothing special.

Then, I found another one called 'PL-BL.R01’. This extension is used to indicate that we have a multi-volumes RAR archive. This method was very popular in the 90’s when the Internet was not as stable as today or when a big amount of data had to be split across multiple devices. By curiosity, I checked the files received by my spam trap in 2017, here is an overview of the files received:

 

At the bottom of the list, I found:

ACE 5
R01 3
ARJ 2
XLAM 1
CAB 1

The main reason why such files have exotic extensions is to try to bypass dump filters based on regex like:

.*\.(doc|zip|exe|cab|com|pif|bat|dll)$

Instead of relying on file extensions, use libmagic[2] or YARA[3]. Here is a simple test in Python with the magic module:

# python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import magic
>>> ms = magic.open(magic.NONE)
>>> ms.load()
0
>>> ms.file(“/tmp/no_ext_file")
'JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 1600x512, frames 3'
>>>

And the same file analyzed with a simple YARA rule:

$ cat jpeg.yar
rule IsJPGImage
{
    meta:
        author = "Xavier Mertens (https://blog.rootshell.be)";
        description = "Detect if a file is a JPG image"
    strings:
        $header1 = { FF D8 FF DB }
        $header2 = { FF D8 FF E0 }
        $header3 = { FF D8 FF E1 }
    condition:
        $header1 in (0..3) or $header2 in (0..2) or $header3 in (0..3)

}
$ # yara jpeg.yar /tmp/no_ext_file
IsJPGImage /tmp/no_ext_file

YARA is also perfectly supported in Python! So, please stop relying on file extensions to decide if a file must be flagged as suspicious or not. Microsoft Windows has tons of extensions[4] (some very old like the .lzh or .lha compression algorithms) that are still supported by many tools!

[1] https://www.virustotal.com/#/file/c55e26fff6096362fab93dd03b6b4c5e4e62ed5a8a7fc266c77f34683b645bf6/detection
[2] https://github.com/threatstack/libmagic
[3] https://github.com/VirusTotal/yara
[4] https://en.wikipedia.org/wiki/List_of_filename_extensions

Xavier Mertens (@xme)
ISC Handler - Freelance Security Consultant
PGP Key

3 comment(s)

Comments


Diary Archives