WEBVTT

00:00:00.368 --> 00:00:01.367
(Aaron) I see.

00:00:01.368 --> 00:00:04.368
(Tyler) So we want to go in and we want to decode all this, right?

00:00:04.368 --> 00:00:06.368
We want to see, especially the configuration files,

00:00:06.368 --> 00:00:10.368
if we were to decode the plugins, we're just going to see executables.

00:00:10.368 --> 00:00:14.368
We can still go in and then do reverse engineering on those executables.

00:00:14.368 --> 00:00:19.868
But, they're going to have all of the protections that the initial stage,

00:00:19.868 --> 00:00:22.186
like you saw when you were throwing it into IDA Pro and all

00:00:22.186 --> 00:00:24.367
that to try to do reverse engineering.

00:00:24.368 --> 00:00:27.368
We're more interested, at this point, with the configuration files.

00:00:27.368 --> 00:00:28.368
(Aaron) Right.

00:00:28.368 --> 00:00:30.367
Fastest path to get some usable information.

00:00:30.368 --> 00:00:31.368
(Tyler) Right, it's going to give us indicators.

00:00:31.368 --> 00:00:33.368
Now, you can see here, at least with this one,

00:00:33.368 --> 00:00:36.368
remember, this is the injectDll64 plugin,

00:00:36.368 --> 00:00:38.368
which is to grab banking activity.

00:00:38.368 --> 00:00:40.368
And we've got three configuration files in here.

00:00:40.368 --> 00:00:43.368
But you know, let's just try to open it up really fast.

00:00:43.368 --> 00:00:44.368
I'm going to open it up in Notepad++.

00:00:44.368 --> 00:00:46.367
(Aaron) Oh, great.

00:00:46.368 --> 00:00:47.082
(Tyler) It's all binary data.

00:00:47.082 --> 00:00:47.368
It's encrypted.

00:00:47.368 --> 00:00:50.368
So we need to figure out how are we going to decrypt this.

00:00:50.368 --> 00:00:53.368
Fortunately, there are some great tools available that will allow us to do that.

00:00:53.368 --> 00:00:54.368
(Aaron) Okay.

00:00:54.368 --> 00:00:56.367
(Tyler) The tools come from a researcher,

00:00:56.368 --> 00:00:59.368
a malware researcher, named hasherezade.

00:00:59.368 --> 00:01:00.368
She is amazing.

00:01:00.368 --> 00:01:02.701
If you go out to her GitHub,

00:01:02.701 --> 00:01:07.368
she's got tons of tools that she's created for malware analysis,

00:01:07.368 --> 00:01:08.367
especially for TrickBot.

00:01:08.368 --> 00:01:12.368
And so, we're going to use her tools in order to decode the files here.

00:01:12.368 --> 00:01:13.367
So, I've got two tools that we're going to use from her.

00:01:13.368 --> 00:01:17.368
One is called make_bot_key, which is an executable.

00:01:17.368 --> 00:01:19.368
You can actually go and download the source code for this

00:01:19.368 --> 00:01:21.368
or the compiled version from her GitHub.

00:01:21.368 --> 00:01:25.367
And then a Python script called trick_config_decoder.

00:01:25.368 --> 00:01:27.368
Now, the first thing we need to do is get the bot key,

00:01:27.368 --> 00:01:31.367
and this is the key that's used to encrypt all the files.

00:01:31.368 --> 00:01:35.367
There are ways that we can kind of use the settings,

00:01:35.368 --> 00:01:38.867
that INI file that TrickBot drops, to get some of the key out,

00:01:38.867 --> 00:01:41.168
but then we kind of have to brute force the rest,

00:01:41.168 --> 00:01:42.368
and that could take a while.

00:01:42.368 --> 00:01:44.368
If we run this program, it's just going to give us the key.

00:01:44.368 --> 00:01:47.368
(Aaron) Is this leveraging information that's dropped by TrickBot,

00:01:47.368 --> 00:01:51.368
or is this just doing the same thing that TrickBot did to make the key?

00:01:51.368 --> 00:01:53.368
(Tyler) A little of both.

00:01:53.368 --> 00:01:54.368
What it does is,

00:01:54.368 --> 00:01:59.367
hasherezade has gone through and done a lot of reverse engineering on TrickBot,

00:01:59.368 --> 00:02:02.367
and so she knows what it needs in order to make the key.

00:02:02.368 --> 00:02:04.367
So I'm going to run this.

00:02:04.368 --> 00:02:05.368
Just going to do make_bot_key,

00:02:05.368 --> 00:02:11.368
and you can see here it says the bot key is this really long string.

00:02:11.368 --> 00:02:18.368
So I'm just going to copy this out.

00:02:18.368 --> 00:02:23.367
So throw it in Notepad because we're going to use this later.

00:02:23.368 --> 00:02:24.367
So that is our bot key.

00:02:24.368 --> 00:02:26.367
What I'm going to do here is we're going to try and decode these.

00:02:26.368 --> 00:02:30.368
And so I'm going to go into this directory,

00:02:30.368 --> 00:02:31.368
if we're looking here we have the three files.

00:02:31.368 --> 00:02:33.367
I'm going to run the Python script.

00:02:33.368 --> 00:02:35.367
I've already installed Python on my system,

00:02:35.368 --> 00:02:37.225
so obviously if you're going to run these you would have to

00:02:37.225 --> 00:02:39.368
do it on a system that has Python on it.

00:02:39.368 --> 00:02:41.367
And just to show we're not doing any tricks here,

00:02:41.368 --> 00:02:44.784
let me run the make_bot_key again and you can see it

00:02:44.784 --> 00:02:45.368
does come up with the same key.

00:02:45.368 --> 00:02:48.743
So it's not necessarily dependent on where you're running it from the system,

00:02:48.743 --> 00:02:49.368
which is good to know.

00:02:49.368 --> 00:02:52.510
There are some tools that you need to be in a certain directory,

00:02:52.510 --> 00:02:53.367
something like that.

00:02:53.368 --> 00:02:54.368
(Aaron) Got it.

00:02:54.368 --> 00:02:55.367
And it's not time-dependent either?

00:02:55.368 --> 00:02:56.368
(Tyler) Correct.

00:02:56.368 --> 00:02:57.368
(Aaron) Great.

00:02:57.368 --> 00:03:00.368
(Tyler) So what I'm going to do here, get rid of this,

00:03:00.368 --> 00:03:03.368
I'm going to run Python tools\hasherezade,

00:03:03.368 --> 00:03:09.368
and then our code name, trick_config_decoder.

00:03:09.368 --> 00:03:11.368
Now, it does need a number of options.

00:03:11.368 --> 00:03:14.367
We need to give it the bot key, the data file that we're decoding,

00:03:14.368 --> 00:03:17.367
and then we're going to need to tell it where to put that.

00:03:17.368 --> 00:03:18.367
So we're going to run that now.

00:03:18.368 --> 00:03:21.368
(Aaron) Does this work on any of the module's configs?

00:03:21.368 --> 00:03:22.368
(Tyler) So far, yes.

00:03:22.368 --> 00:03:22.701
Now,

00:03:22.701 --> 00:03:25.034
this doesn't mean that TrickBot can't change

00:03:25.034 --> 00:03:26.868
tomorrow and modify what it's doing,

00:03:26.868 --> 00:03:31.368
but it will work on any of the files that are on here.

00:03:31.368 --> 00:03:33.367
So what I'm going to do is I'm going to give it the data file.

00:03:33.368 --> 00:03:37.368
We're going to start with the first one, the dinj one.

00:03:37.368 --> 00:03:39.368
I'll give it the botkey.

00:03:39.368 --> 00:03:44.368
We can copy/paste that into here.

00:03:44.368 --> 00:03:47.368
If you don't give it an outfile it will just throw it onto the screen.

00:03:47.368 --> 00:03:48.367
I want to have it put somewhere.

00:03:48.368 --> 00:03:53.368
So I'm going to do outfile, and we'll call this dinj_out.txt.

00:03:53.368 --> 00:03:54.368
(Aaron) Great.

00:03:54.368 --> 00:03:56.368
(Tyler) And hopefully it worked.

00:03:56.368 --> 00:03:58.243
Any time it decodes something,

00:03:58.243 --> 00:04:01.367
the script will extract the module to a DLL file

00:04:01.368 --> 00:04:03.368
and dump the decoded text there.

00:04:03.368 --> 00:04:05.618
The only time we're really concerned about the DLL file is

00:04:05.618 --> 00:04:07.368
if we're decoding one of the plugins.

00:04:07.368 --> 00:04:12.368
You still get some data outside of it if you're doing the configuration files,

00:04:12.368 --> 00:04:13.367
but you can ignore that.

00:04:13.368 --> 00:04:15.367
(Aaron) I see.

00:04:15.368 --> 00:04:20.367
So it's decoding the executable, as well as the config file?

00:04:20.368 --> 00:04:21.368
(Tyler) Exactly.

00:04:21.368 --> 00:04:21.568
Normally, yes,

00:04:21.568 --> 00:04:24.367
but in this case we're just telling it to do the configuration file.

00:04:24.368 --> 00:04:26.368
So I'm going to, let me do it to the other two.

00:04:26.368 --> 00:04:29.368
So I want to do it to dpost.

00:04:29.368 --> 00:04:32.368
That's another configuration file.

00:04:32.368 --> 00:04:33.167
And again,

00:04:33.167 --> 00:04:40.367
I'm going to keep the same bot key and I'm going to change the outfile.

00:04:40.368 --> 00:04:43.368
All right, great.

00:04:43.368 --> 00:04:47.367
And one last one, the sinj file.

00:04:47.368 --> 00:04:49.368
(Aaron) Perfect.

00:04:49.368 --> 00:04:49.967
(Tyler) So again,

00:04:49.967 --> 00:04:55.368
these are the configuration files for the injects into the banking activity.

00:04:55.368 --> 00:04:56.368
So in other words,

00:04:56.368 --> 00:05:00.367
we're going to see some of the configuration for the bank stealing activity.

00:05:00.368 --> 00:05:02.510
The thing to note, too,

00:05:02.510 --> 00:05:05.368
is that each of these plugins can have different configuration files,

00:05:05.368 --> 00:05:06.368
and they often do,

00:05:06.368 --> 00:05:08.225
and that means that they can often be going to

00:05:08.225 --> 00:05:10.367
different command and control IP addresses.

00:05:10.368 --> 00:05:15.034
So just because you figured out where one module is going to on the

00:05:15.034 --> 00:05:18.367
internet doesn't mean that anybody else is going to that.

00:05:18.368 --> 00:05:19.368
(Aaron) And they're different purposes, right?

00:05:19.368 --> 00:05:22.568
I'm assuming there's certain targeted sites for the browser injection

00:05:22.568 --> 00:05:25.201
that it's going to focus on whereas that isn't necessarily something

00:05:25.201 --> 00:05:27.368
that's going to be on the password grabber module.

00:05:27.368 --> 00:05:28.368
(Tyler) Right.

00:05:28.368 --> 00:05:29.368
So now we have our three outputs.

00:05:29.368 --> 00:05:33.368
So I'm going to, let's do sinj first because it's kind of small.

00:05:33.368 --> 00:05:35.368
So I'm going to open that up in Notepad++.

00:05:35.368 --> 00:05:39.731
The first one, the sinj, it didn't decode properly or it did decode properly,

00:05:39.731 --> 00:05:44.368
but here I'm opening up dpost and you can already see that there's a bunch of

00:05:44.368 --> 00:05:48.367
command and control IP addresses in there that were decoded.

00:05:48.368 --> 00:05:54.368
(Tyler) Let's even open up the original one and you can see it went from this,

00:05:54.368 --> 00:05:55.923
with all this binary data, encrypted data,

00:05:55.923 --> 00:05:56.368
to this.

00:05:56.368 --> 00:06:01.368
And now, we can use this information to look for this activity on our network.

00:06:01.368 --> 00:06:04.368
We can search for anybody going to these IP addresses,

00:06:04.368 --> 00:06:07.367
we can do information lookups on these IP addresses.

00:06:07.368 --> 00:06:10.367
You can see that some of the ports are port 8082.

00:06:10.368 --> 00:06:14.367
So that's kind of an unusual port that we could look for.

00:06:14.368 --> 00:06:16.368
(Aaron) That's interesting, too.

00:06:16.368 --> 00:06:20.367
So some of it is correctly on 443, some of it's on 80 like it normally would be,

00:06:20.368 --> 00:06:22.367
but this is attacker infrastructure, right?

00:06:22.368 --> 00:06:25.367
And one thing we do know about attacker infrastructure is that changes.

00:06:25.368 --> 00:06:27.367
It has to because it's going to be blacklisted, etc.

00:06:27.368 --> 00:06:30.368
So is this something that gets updated often?

00:06:30.368 --> 00:06:32.256
(Tyler) Yes, in fact, what will happen is,

00:06:32.256 --> 00:06:33.939
every once in a while, the attacker,

00:06:33.939 --> 00:06:37.367
the TrickBot will go out and will download new configuration files.

00:06:37.368 --> 00:06:42.368
Notice, too, something about the lines that specify port 443.

00:06:42.368 --> 00:06:48.368
Notice that they're http:\\, not https:\\.

00:06:48.368 --> 00:06:53.367
So that could mean that they are, in fact, unencrypted data going over port 443.

00:06:53.368 --> 00:06:58.368
So, this is a quick way that an attacker could trick an analyst.

00:06:58.368 --> 00:07:01.082
If they're not looking into the data, and they just see oh,

00:07:01.082 --> 00:07:03.367
it's 443, which is normally SSL traffic,

00:07:03.368 --> 00:07:06.368
they would think that oh, it's encrypted,

00:07:06.368 --> 00:07:07.368
I don't need to look at it.

00:07:07.368 --> 00:07:08.368
When, in fact, it's not necessarily.

00:07:08.368 --> 00:07:10.368
(Aaron) Interesting.

00:07:10.368 --> 00:07:11.368
(Tyler) So let's look at the last one.

00:07:11.368 --> 00:07:14.368
Hopefully this decoded some information as well.

00:07:14.368 --> 00:07:15.368
(Aaron) It's earning its name TrickBot.

00:07:15.368 --> 00:07:16.367
(Tyler) There we go, cool.

00:07:16.368 --> 00:07:18.367
This is the really big one.

00:07:18.368 --> 00:07:22.368
These are all of the different injects that this

00:07:22.368 --> 00:07:25.368
module will do into the browser.

00:07:25.368 --> 00:07:31.368
So we can see the first line here, not the first line, the first section here.

00:07:31.368 --> 00:07:33.367
We have it where it's going to,

00:07:33.368 --> 00:07:38.368
if it sees anything going to netteller.com /login2008/Authentication,

00:07:38.368 --> 00:07:42.367
it's going to grab that data and it's going to send it to that IP address there.

00:07:42.368 --> 00:07:43.368
(Aaron) Got it, okay.

00:07:43.368 --> 00:07:44.913
So that's for each different handler and where it's

00:07:44.913 --> 00:07:46.368
going to send to using that PHP method.

00:07:46.368 --> 00:07:47.368
(Tyler) Exactly.

00:07:47.368 --> 00:07:48.367
And this file is 142k.

00:07:48.368 --> 00:07:53.082
So we can start going down here and you can just start seeing all of

00:07:53.082 --> 00:07:56.367
the different sites and banks and everything that it tries to go to

00:07:56.368 --> 00:07:59.368
and that it's going to steal data from.

00:07:59.368 --> 00:08:02.368
And, more importantly, where it's going to send it to.

00:08:02.368 --> 00:08:04.368
It's going to send it to this IP address.

00:08:04.368 --> 00:08:09.368
At least the ones we've seen so far are, you know, 107.174 and so on.

00:08:09.368 --> 00:08:11.367
(Aaron) It's also interesting that it's hard coded IP.

00:08:11.368 --> 00:08:13.368
So that's another tell.

00:08:13.368 --> 00:08:14.939
(Tyler) Right, but remember, you know,

00:08:14.939 --> 00:08:19.368
it can very easily go and update a new configuration file and download it,

00:08:19.368 --> 00:08:21.367
and all these could change within minutes.

00:08:21.368 --> 00:08:26.368
(Aaron) Certainly, which is why
