Why PUA/PUP are bad for you a.k.a. the evil of environment fingerprinting

November 9, 2015 in Compromise Detection, Incident Response, Preaching

In my post about sample targeting EDR I mentioned that the sample is a PUA/PUP. Looking at the code of many PUA/PUP/adware samples created in last few years it’s easy to see how far they go nowadays in fingerprinting the environments.

This is why many of them should be treated as malware & should not be ignored in ‘business as usual’ IR activities.

In the aforementioned post I listed a couple of routine names that that particular sample used. All these routines are called one by one, and a final string is generated containing reference numbers associated with each ‘discovered’ piece in the environment.

fingerprintingThis is no longer just a sandbox detection.

EDR, VPN, AV, security tools, often list of updates, hotfixes, full software list from registry, etc. is added too. Someone, somewhere populates some large databases with a lot of this ‘goodness’.

One can imagine that this data may be a very valuable piece of information – it could be sold not only to advertisers, software writers, even companies whose products are being profiled (competition/market research), but also – of course – on a darker side – to random malware authors, and guys specializing in targeted attacks. If you think of it, a good PUP/PUA campaign could be even orchestrated by the actual BAD guys.

If 0days allow a way in, a database with an information about used software may simplify and speed up a lateral movement. And why bother doing all the time-consuming illegal hacking/malware infestation/recon if you can simply deploy borderline software first. Let it populate a huge matrix including lots of information about as many hosts as possible in as many organizations as possible. And then, with such precise information about installed software & deployed countermeasures it can be leveraged to simplify many hacking operations (and targeting).

This is of course scaremongering on my side and a conspiracy theory in the making, but the only reason I am writing this is that if you are ever looking for arguments to treat PUA/PUP as malware… or someone argues that PUA/PUP can be ignored in your AV alerts then the massive fingerprinting they do nowadays is the big one…

Decrypting MalwareBytes .quar files

November 8, 2015 in Forensic Analysis

A few years ago I developed script to decrypt .quar files created by MalwareBytes. Since the decryption routine was different from a typical xor I was not sure how the MalwareBytes will react – I asked them for a permission to release the code publicly for the benefit of the DFIR/RCE community, but unfortunately, they refused at that time.

Since I posted info about my script on one of the DFIR forums I have been asked many times by many researchers to share the script with them privately.

Today I noticed that the cat is out of the bag and the code for decrypting .quar files was already made public by someone else here.

The script is actually covering many other quarantine files as well which is awesome.

Great work by the Optiv guys.

Let’s hope that code for all types of Quarantine files will eventually be made public.


Since some people asked, here is a short perl script for decrypting .quar files:

use strict;
use warnings;
use Crypt::RC4;
use Digest::MD5 qw (md5 );

my $f=shift || die ("Gimme a file name!\n");
open F,"<$f";
binmode F;
read F,my $data,-s $f;
close F;

my $rc4 = Crypt::RC4->new( md5 ('XBXM8362QIXD9+637HCB02/VN0JF6Z3)cB9UFZMdF3I.*c.,c5SbO7)WNZ8CY1(XMUDb') );
my $newdata = $rc4->RC4( $data );

open F,">$f.out";
binmode F;
print F $newdata;
close F;