WEBVTT

00:00.000 --> 00:04.140
Okay, we're about time so thank you again for being here.

00:04.280 --> 00:07.380
Um, hopefully you've been enjoying DEF CON.

00:07.380 --> 00:10.400
Closing ceremonies will be soon here for the village.

00:10.460 --> 00:14.340
Later on you can go and head out to uh, closing ceremonies for DEF CON.

00:14.340 --> 00:17.680
If this is your first time, hopefully you had a good time.

00:17.720 --> 00:23.140
I hope that you made some friends and if you haven't, then please talk to the person next to you.

00:23.220 --> 00:25.980
They might uh, be into the same things that you are.

00:25.980 --> 00:28.860
Uh, and I really recommend you go to the closing ceremonies.

00:28.860 --> 00:30.300
It's always a lot of fun.

00:30.300 --> 00:31.920
Again, thank you for being here.

00:31.920 --> 00:32.780
Cheers.

00:34.860 --> 00:36.960
Round of applause.

00:40.500 --> 00:42.120
Alright, welcome.

00:42.120 --> 00:46.160
Uh, really cool way to finish up the day.

00:46.160 --> 00:53.220
Uh, understudy 77, he is uh, not only paranoid but he is actually a-paranoid.

00:53.220 --> 00:55.820
Like that's, that's in his title.

00:55.820 --> 00:57.200
How cool is that, right?

00:57.200 --> 01:00.780
So, um, he's a paranoid with Verizon.

01:00.840 --> 01:02.820
Um, head of security operations.

01:03.180 --> 01:05.600
Head of security operations.

01:05.740 --> 01:11.680
And um, he's going to talk, talk to you guys a little about uh, hold on.

01:14.300 --> 01:15.300
Okay, cool.

01:15.300 --> 01:20.820
Um, he's going to talk with you guys about uh, an introduction of malware RE, reverse engineering.

01:20.820 --> 01:23.440
If you haven't done it before, he and I were just talking.

01:23.980 --> 01:30.740
Um, this is a really cool talk because it's going to be an anybody can do malware reverse engineering kind of talk.

01:30.740 --> 01:32.580
So, really looking forward to this.

01:32.580 --> 01:33.480
Give him a hand.

01:40.350 --> 01:42.170
Uh, sorry just to interrupt.

01:42.170 --> 01:46.330
We just, we just, the open talk just ended so if you hear a little bit of noise it's because of that.

01:46.370 --> 01:51.950
So, why don't we just give him a good applause to everyone that participated in the open talk because they just completed.

01:51.950 --> 01:53.150
CTF is over.

01:53.250 --> 01:54.390
Sorry for that.

02:00.070 --> 02:08.170
So, I want to start off at the end of the weekend by asking, did everybody have a really good DEF CON and Hacker Summer Camp?

02:09.910 --> 02:10.970
All right.

02:11.570 --> 02:15.030
So, I've been here most of the weekend and I want to say two things.

02:15.030 --> 02:19.450
First off, I want a round of applause for all the volunteers and organizers of Blue Team Village.

02:19.450 --> 02:23.210
They kicked ass, did a really good job and a lot of work.

02:26.150 --> 02:28.750
And secondly to Open Sock.

02:28.970 --> 02:36.210
Um, it was an awesome CTF and I sat up here in the evening and watched them rebuild the whole thing because everybody killed it.

02:36.390 --> 02:38.150
So, they worked tirelessly.

02:38.150 --> 02:40.890
I'm sure they're all tired and somebody should buy them beer.

02:46.940 --> 02:50.260
So, let's do an introduction to malware analysis.

02:50.320 --> 02:52.000
Uh, I'll start with the introductions.

02:52.140 --> 02:54.720
I'm the head of the security operations center at Verizon Media.

02:54.840 --> 02:58.420
I was an IR and breach consultant once upon a time, slash threat hunter.

02:58.680 --> 03:02.620
Um, I'm probably a little bit rusty on this topic so don't hold anything too far against me.

03:02.620 --> 03:03.360
Management.

03:03.600 --> 03:05.140
Uh, and I'm pretty shitty at Twitter.

03:06.320 --> 03:08.900
Now, let's talk about what this is and what this isn't.

03:09.000 --> 03:11.800
Um, I have not done this every day in a little while.

03:11.800 --> 03:16.500
I love teaching this because every time I add something new and I get to do something new and learn something new.

03:16.820 --> 03:20.580
Um, there's a lot more tools and different things than what I'm going to be using.

03:21.080 --> 03:23.440
This is very much an introduction.

03:23.780 --> 03:32.780
Um, I built this specifically to lower the entry barrier and make the concept of analyzing malware seem not so difficult.

03:33.120 --> 03:36.880
So, some people may or may not be my target market and that's okay.

03:36.880 --> 03:40.660
But, I just want to make sure that I'm very clear about what this is going into it.

03:41.300 --> 03:44.980
So, we can talk a little bit about what tools we're going to be using primarily.

03:45.100 --> 03:47.300
I run Ubuntu 14.04 with Remnux.

03:47.300 --> 03:50.420
Remnux is an open source malware analysis distro.

03:50.660 --> 03:54.200
Oh, I should mention as well, photos are fine this way.

03:54.780 --> 03:58.780
Um, I wouldn't take them that way but I know that's a sensitive topic so I want everybody to know I don't care.

03:59.580 --> 04:07.960
Um, in Remnux we're going to use some tools like PDF ID, PDF parser, um, OLE tools and VMs.

04:07.960 --> 04:13.360
From a VM perspective we're going to be looking at things like Process Explorer, RegShot, Fiddler, Wireshark.

04:13.560 --> 04:20.560
Um, we're also going to kind of touch a little bit on Cuckoo Sandbox and how you can kind of automate some of this process that we're going to go over as well.

04:21.340 --> 04:24.140
So, let's set up the scenario.

04:24.760 --> 04:26.900
You are a security analyst for the Daily Bugle.

04:26.900 --> 04:30.800
You received an alert or notification about a suspicious email with an attachment.

04:30.980 --> 04:33.200
You got a copy of that attachment.

04:33.760 --> 04:35.880
So you have a PDF right now.

04:35.940 --> 04:38.240
So now we can jump right into it.

04:38.240 --> 04:39.300
Into the good part.

04:39.380 --> 04:45.360
By the way, this is all demo pretty much and I've prayed intensely to the demo gods that this is going to work out okay.

04:46.780 --> 04:51.760
So, we have a PDF right here.

04:52.020 --> 04:53.680
Here's our suspicious PDF.

04:54.020 --> 04:56.460
We can do a couple things to look into this.

04:56.460 --> 04:58.740
I like to start with PDF ID.

04:59.180 --> 05:00.300
Is this big enough?

05:00.300 --> 05:01.360
Can everybody read it?

05:01.360 --> 05:03.480
I tried to make the size really big.

05:03.480 --> 05:04.320
Great.

05:04.500 --> 05:11.640
So, I'm already in my directory and we can hit PDF ID and our file name.

05:12.360 --> 05:14.400
And we can see what's going on with this.

05:14.540 --> 05:17.560
So, if we look through this, this is going to tell us in the header what's there.

05:18.060 --> 05:21.060
So, this is going to tell us objects.

05:21.160 --> 05:23.800
This is going to tell us JavaScript.

05:24.600 --> 05:27.740
Importantly in this case, this is going to tell us that we have an embedded file.

05:28.960 --> 05:29.820
That's interesting.

05:29.820 --> 05:31.480
Why would you put a file inside your PDF?

05:32.540 --> 05:34.360
So, there's a couple different ways we can get it.

05:34.360 --> 05:35.340
We can go to a sandbox.

05:35.340 --> 05:37.560
We can open the PDF and we can get the file.

05:37.620 --> 05:39.560
Or we can use some other tools.

05:39.560 --> 05:42.360
But let's see if we can find out some more information about it first.

05:42.640 --> 05:44.880
So, I'm going to go ahead and clear this out.

05:45.520 --> 05:47.800
And then let's see what we can find out about that file.

05:47.800 --> 05:52.940
And let's start with the file name and see if we can find that.

05:57.960 --> 05:59.240
So, embedded files.

05:59.240 --> 06:00.340
Looks like a Word doc.

06:01.720 --> 06:03.060
602803.doc.

06:03.460 --> 06:04.740
Also interesting.

06:05.320 --> 06:08.020
What can we find out about that file?

06:08.980 --> 06:12.340
Or general information about this PDF in general.

06:12.420 --> 06:15.000
Or more information about this PDF in general.

06:17.480 --> 06:20.920
And this is where the demo stuff happens.

06:20.920 --> 06:22.560
Because I forget to type things.

06:22.560 --> 06:25.280
So, we see that there's an embedded file.

06:26.100 --> 06:27.280
We can go through.

06:27.280 --> 06:28.500
There's the name.

06:29.380 --> 06:31.100
Some additional information.

06:31.260 --> 06:36.140
This will basically break down the whole PDF and give you general information from it.

06:36.380 --> 06:37.580
It's really useful.

06:37.640 --> 06:41.400
It's not as human readable as either of the other tools we just talked about, though.

06:42.320 --> 06:47.300
So, here's our who wrote and who made.

06:48.080 --> 06:49.760
So, now we need to get that.

06:49.900 --> 06:52.180
And preferably I think we'd like to get that in a safe way.

06:52.180 --> 06:55.400
Although I do like clicking on everything that I can click on.

06:55.640 --> 06:58.140
I find that that's one of my favorite things in this world to do.

06:58.980 --> 07:01.020
But we'll do it the safe way.

07:01.900 --> 07:03.460
So, we'll do detach again.

07:03.780 --> 07:05.640
We know there's only one file there.

07:05.640 --> 07:06.980
So, we can do save all.

07:07.860 --> 07:09.380
And then we can hit step one.

07:09.380 --> 07:15.000
So, if you take a look here, this is all laid out for ease of use in case something breaks.

07:15.140 --> 07:22.540
But if I run this and we take a look back there, we've now saved out our document.

07:22.980 --> 07:23.720
Easy.

07:24.340 --> 07:28.880
So, we've now successfully extracted a document from a PDF file.

07:29.240 --> 07:31.460
So, now we get into analysis of that document.

07:32.240 --> 07:34.080
There's no internet for this.

07:34.080 --> 07:36.520
Typically I would be on a VPN and online.

07:36.520 --> 07:40.580
But I don't really want to be executing live malware throughout this experience.

07:41.080 --> 07:46.200
So, I'm going to go ahead and I'm going to open up a VM.

07:46.200 --> 07:47.380
And we're going to start there.

07:47.400 --> 07:52.820
So, we will start with opening up this document and seeing what we see.

07:54.620 --> 07:56.520
Because I find that to be fun.

07:57.900 --> 08:01.680
So, if we take our doc, we move it over to our VM.

08:05.040 --> 08:07.280
We can run a couple things here.

08:07.460 --> 08:12.020
And we're going to talk more in-depthly about different tools as we get into the file analysis as well.

08:12.880 --> 08:16.720
So, as soon as this paces, this is the downside of live demos, right?

08:18.340 --> 08:20.860
I can start opening things though.

08:23.740 --> 08:28.260
For anybody unfamiliar, Fiddler is basically a web debugger.

08:28.620 --> 08:41.140
So, if I have, if I'm suspicious that web based call outs are going to happen or something of that nature and I'm not worried about just general TCP connections, I like to use Fiddler because it displays everything really nicely and very easily.

08:41.180 --> 08:42.740
So, I'm a big fan.

08:42.900 --> 08:45.120
We'll use Wireshark later as well.

08:47.950 --> 08:49.190
Come on.

08:53.210 --> 08:58.930
You know the really crappy part about this is I practiced this six times and had no issues.

09:00.390 --> 09:02.850
And now, everything wants to freeze.

09:05.780 --> 09:06.820
Cancel.

09:14.030 --> 09:15.830
Let's try that again.

09:27.310 --> 09:28.270
Hey, there we go.

09:28.270 --> 09:29.090
It's back.

09:38.410 --> 09:39.610
All right.

09:39.610 --> 09:40.930
So, we have a document.

09:41.290 --> 09:43.470
We have something capturing web traffic.

09:45.050 --> 09:50.890
And right now, we're going to get something capturing processes as well.

09:51.550 --> 09:53.570
For this, we'll use process explorer.

09:54.610 --> 10:00.870
Process explorer is essentially like task manager on steroids and will give you a lot more information.

10:04.450 --> 10:05.250
Yes.

10:07.590 --> 10:09.250
So, interesting thing.

10:09.250 --> 10:11.510
Process explorer is going to be pretty live.

10:11.510 --> 10:12.950
So, things are going to disappear.

10:12.950 --> 10:14.290
Things are going to go away.

10:14.970 --> 10:16.950
Where Fiddler is going to record.

10:17.010 --> 10:22.750
So, in this use case, I tend to always keep process explorer top so that I can pay attention to it quickly.

10:22.850 --> 10:26.250
And then I'll go back to and look at the network traffic afterward.

10:26.610 --> 10:30.850
So, as we open up this document, we can see here that there is a macro.

10:32.970 --> 10:35.690
We can also shrink this down so it's out of our way.

10:35.690 --> 10:38.970
And we can enable content because we like to live dangerously.

10:41.330 --> 10:44.230
So, we can see WinWord here.

10:44.950 --> 10:48.990
We can see PowerShell just popped up and did a lot of things.

10:48.990 --> 10:49.850
And now, it's gone.

10:51.830 --> 10:54.410
So, let's move over here and see what else happened.

10:54.650 --> 10:58.830
A lot of these are going to be Microsoft because I don't open Word that often.

11:01.350 --> 11:04.890
But I see a couple things that look kind of suspicious over here.

11:04.890 --> 11:06.350
They can't go anywhere.

11:06.470 --> 11:07.950
But that's not traffic I would expect.

11:07.950 --> 11:09.910
That's relatively suspicious.

11:10.630 --> 11:12.770
So, it's trying to get something.

11:13.730 --> 11:20.090
And if I expand this out a bit, we can go take a look and see if it did anything.

11:20.090 --> 11:24.170
Although, we probably won't see very much because it's not connected to the internet.

11:25.230 --> 11:26.250
Where are you?

11:27.190 --> 11:33.270
So, that's one way without network connection that we can get access to see this kind of stuff.

11:33.790 --> 11:34.930
So, here's something interesting.

11:34.930 --> 11:38.210
We see two URLs at least in this use case.

11:38.370 --> 11:39.590
It couldn't connect to one.

11:39.590 --> 11:40.610
It jumped to another.

11:40.750 --> 11:44.530
A lot of different pieces of malware will have multiple URLs built in.

11:45.290 --> 11:55.770
In the case of those multiple URLs, if you connect to the first one, meaning if the first time you run it, you're on a virtual machine that connects to the internet, you might never see the second piece.

11:56.290 --> 12:01.810
So, I tend to run everything first offline and then run online.

12:01.810 --> 12:06.250
I also tend to let a lot of this stuff sit for several hours to see if anything happens afterward.

12:06.530 --> 12:09.870
But in this case , I think there's an easier way to go through this data.

12:10.670 --> 12:14.270
So, we can go ahead and we can close out some of this stuff.

12:14.270 --> 12:15.530
We'll keep some of it open.

12:17.870 --> 12:19.630
And we can go back over here.

12:20.610 --> 12:24.430
So, there's a tool suite called OLE tools.

12:24.430 --> 12:27.670
Which basically will look at things and tell us what they are.

12:28.570 --> 12:33.130
In this case, we're going to use OLE VBA because we know there's visual basic.

12:34.290 --> 12:35.830
Step two.

12:37.030 --> 12:40.730
So, we know we have a macro user form one.

12:41.650 --> 12:43.930
It can auto exact document open.

12:43.930 --> 12:49.770
It may execute or may run an executable or a system command which it launched CMD.

12:49.790 --> 12:55.190
Hex encoded strings detected and executable file name being that it ran CMD.

12:55.450 --> 13:01.750
So, if we want to see more on this, hit D to decode.

13:03.070 --> 13:05.430
And again, pipe more.

13:06.450 --> 13:10.090
So, this is going to give us the full context around that.

13:10.450 --> 13:15.170
So, just from the beginning, we can see call command line, call PowerShell.

13:15.690 --> 13:16.810
No profile.

13:16.810 --> 13:19.410
So, it's going to ignore any built in PowerShell settings.

13:19.410 --> 13:20.470
Window style hidden.

13:20.470 --> 13:21.870
So, you're not going to see it run.

13:22.070 --> 13:23.170
Executable bypass.

13:23.170 --> 13:27.590
So, it's going to try to bypass execution policy that you have on your computer and run locally.

13:27.610 --> 13:31.070
And then we've got a whole bunch of other stuff going on here.

13:31.130 --> 13:32.430
Just numbers.

13:33.550 --> 13:35.930
And numbers and numbers and numbers.

13:36.510 --> 13:40.470
So , what that data ends up looking like is this.

13:42.350 --> 13:45.850
Not really super useful yet, right?

13:46.490 --> 13:50.830
So, we could probably assume that this entire section here is encoded.

13:51.290 --> 13:54.050
Actually, this entire section here is decimal encoded.

13:54.750 --> 14:00.510
Is anybody here or everybody here familiar with a tool called CyberChef?

14:01.370 --> 14:02.890
Great tool for this kind of stuff.

14:02.890 --> 14:04.390
Makes everything very fast.

14:04.390 --> 14:05.690
So, I can go in here.

14:05.950 --> 14:07.630
I can paste all that in.

14:08.050 --> 14:10.510
And I can go from decimal.

14:10.510 --> 14:11.530
Well, that didn't work.

14:11.530 --> 14:13.710
But everything is comma delimited.

14:13.710 --> 14:15.330
And you have to specify that.

14:15.630 --> 14:19.110
So, if I specify comma delimited, now we have a lot more information.

14:20.850 --> 14:22.910
So, we can see some stuff.

14:22.910 --> 14:24.590
But there's still a lot going on.

14:24.590 --> 14:26.510
So, I can see that there's an XOR key.

14:26.770 --> 14:28.570
This looks like byte string.

14:30.450 --> 14:32.970
Some pieces of URLs down there.

14:32.970 --> 14:35.150
But there's a lot going on with this.

14:35.450 --> 14:39.270
And this is kind of an interesting way to encode an additional layer.

14:39.770 --> 14:42.130
Basically, what they're doing is they're shifting numbers.

14:42.130 --> 14:46.710
So, like in URLs, they're saying 10, 1, 13.

14:46.710 --> 14:51.070
And that's taking this list here and counting from that list, that number.

14:51.370 --> 15:00.530
So, if we use that and take a look at that in another way, that's the wrong, oh, no, that's the right one.

15:00.530 --> 15:01.990
Because that's this.

15:02.530 --> 15:04.650
We can also see an executable down there.

15:05.510 --> 15:09.290
So, if we use that and we want to get rid of that, we'll use URLs as an example.

15:09.290 --> 15:11.450
So, I took each one of those URL pieces.

15:11.450 --> 15:13.390
I haven't found an automated way to do this, by the way.

15:13.390 --> 15:15.810
If anybody knows an automated way to do this, that would be great.

15:15.810 --> 15:17.530
Because manual takes some time.

15:18.530 --> 15:20.030
Count them from 0 up.

15:20.030 --> 15:21.250
So, 0 to 20.

15:21.250 --> 15:22.830
And then piece these together.

15:22.830 --> 15:28.290
10, H, 1, TTP, and so on and so forth.

15:28.410 --> 15:29.970
And you now have three URLs.

15:30.530 --> 15:31.990
So, we saw two.

15:32.030 --> 15:33.370
We didn't see the third one.

15:33.370 --> 15:36.630
But we know that there's three hard-coded URLs in this sample.

15:37.210 --> 15:38.710
Or in this piece of code.

15:38.710 --> 15:43.150
If we deobfuscate the whole thing, it gets more interesting.

15:43.390 --> 15:45.170
So, we see our PowerShell.

15:45.170 --> 15:46.270
We see no profile.

15:46.270 --> 15:47.290
We see hidden.

15:47.610 --> 15:49.630
We see executable bypass.

15:49.850 --> 15:52.550
And now we start to get into some other interesting stuff.

15:52.550 --> 15:54.150
So, some variable calling.

15:54.150 --> 15:56.530
There's an XOR key in there for XOR encoding.

15:57.570 --> 16:00.490
Um, byte string link sets.

16:00.670 --> 16:01.970
Here's our URLs.

16:02.190 --> 16:04.490
And then we start to get into down here.

16:05.310 --> 16:07.710
So, write host URL.

16:10.820 --> 16:12.180
There's our file.

16:12.180 --> 16:13.340
That we're going to see.

16:13.960 --> 16:15.180
Here's our write.

16:15.320 --> 16:16.480
New object.

16:16.480 --> 16:18.640
Download file invoke URL.

16:18.900 --> 16:20.640
And then unXOR.

16:22.400 --> 16:25.820
And then write bytes unXOR and start said process.

16:25.820 --> 16:31.780
So, what that means, and this is a little bit out of scope of what I'm going to talk about throughout the whole thing.

16:31.780 --> 16:32.820
But it's worth mentioning.

16:32.820 --> 16:38.800
If I go to one of those URLs and I WGIT and I pull down that file, it's an incomplete file.

16:39.040 --> 16:43.940
It's an XOR file that needs to be unencoded again, which this script does.

16:44.520 --> 16:46.580
Um, I've already done that part.

16:46.880 --> 16:49.000
So, I already have the completed file.

16:49.320 --> 16:51.980
So, we can start talking about that completed file.

16:54.240 --> 16:58.680
So, now we get down to an EXE.

16:58.680 --> 17:00.020
So, we have an EXE.

17:00.020 --> 17:01.560
We can take a look at it.

17:01.740 --> 17:02.560
We're unsure.

17:02.560 --> 17:05.600
And now is where we get into running malicious files.

17:06.980 --> 17:08.720
So, same system.

17:08.720 --> 17:10.500
We're going to have process explorer up.

17:12.140 --> 17:14.160
In this case, we're going to use Wireshark.

17:19.080 --> 17:20.920
And I'm going to hide that off in the bottom.

17:23.720 --> 17:25.940
And we're going to use another tool called RegShot.

17:26.480 --> 17:30.360
So, RegShot will take two snapshots of your registry at different times.

17:30.360 --> 17:33.100
So, I click a button, it captures the entirety of my registry.

17:33.120 --> 17:36.260
I click another button, it captures the entirety of my registry again.

17:36.260 --> 17:38.940
And then compares the two files for any potential changes.

17:40.560 --> 17:42.560
So, we'll go ahead and pop that open.

17:43.060 --> 17:44.880
And we'll take our first shot.

17:47.660 --> 17:50.540
Now, none of this is an exact science.

17:50.540 --> 17:56.360
If you have any background processes running, things that can affect your registry, those things may come up as well.

17:56.600 --> 18:00.140
So, unless it's a completely clean system, you might run into some things.

18:00.140 --> 18:06.740
One of the reasons why I didn't restart this is so that it would be cleaner and all background processes would finish running.

18:06.740 --> 18:09.020
So, that I would get the best shot possible.

18:10.300 --> 18:12.920
So, now we will move over our file.

18:16.830 --> 18:18.170
We've got everything open.

18:18.170 --> 18:20.750
I want to make sure Process Explorer is front and center.

18:23.070 --> 18:24.530
And we'll run it.

18:24.870 --> 18:27.270
So, we see here it is.

18:27.270 --> 18:30.810
And it's making a call to SVCHost, which is Windows Service Host File.

18:30.810 --> 18:32.030
And now it's gone.

18:32.210 --> 18:36.050
But, SVCHost with that file still there.

18:37.390 --> 18:38.670
That's interesting.

18:38.670 --> 18:39.950
It's doing something.

18:40.690 --> 18:42.170
Do we have any network traffic?

18:43.650 --> 18:46.250
In this case, I'm just going to filter for TCP.

18:49.110 --> 18:50.810
And we have network traffic.

18:51.390 --> 18:54.810
Not much of any network traffic, because, again, not connected to the internet.

18:54.810 --> 18:56.970
But, that's an unexpected call.

18:56.970 --> 19:01.790
I don't know why my computer would be going to 199.36.194.27.

19:03.050 --> 19:04.850
So, we have network traffic, too.

19:05.430 --> 19:07.570
So, we have network traffic.

19:07.570 --> 19:10.070
We have a suspicious SVCHost running.

19:10.250 --> 19:12.790
We can take a look at the properties of that and kind of go through.

19:12.790 --> 19:15.130
We can continue to see the parent process here.

19:15.470 --> 19:22.930
We can continue to see what it's doing, what it looks like, if there's an auto start location, the command line that was run, where it's running from.

19:23.550 --> 19:25.750
Get performance graphs of how it's running.

19:26.630 --> 19:28.030
General performance of it.

19:28.030 --> 19:29.250
GPU graph.

19:30.450 --> 19:33.310
Threads that it's running and strings of that file.

19:33.310 --> 19:35.790
So, this is strings of the actual SVCHost.

19:36.030 --> 19:39.030
We can run strings of the specific file, as well, over here.

19:40.630 --> 19:46.350
Strings are... I don't know how to properly explain them.

19:48.270 --> 19:49.250
Step 8.

19:50.290 --> 19:51.710
Step 9.

19:53.230 --> 19:56.570
But, you can go through this and you can find some interesting things.

19:56.670 --> 20:02.570
So, going through this, a lot of it's going to seem a little bit out of place, but I might be able to find some interesting calls.

20:02.570 --> 20:04.610
And I know there's a couple interesting ones in here.

20:07.010 --> 20:10.350
So, I can see a couple things right through here.

20:10.350 --> 20:23.190
So, set class, registry, call message filter, some calls to some DLLs, initializations, all of these things are kind of the full word pieces of the pieces that I'm potentially interested in when I'm going through this.

20:23.190 --> 20:25.710
This might give me an idea of what the file does.

20:26.370 --> 20:29.150
Before I run it or after I run it or whenever.

20:29.430 --> 20:30.590
I'll get some idea.

20:30.590 --> 20:33.530
And if we look at the registry, some of that should match up.

20:34.730 --> 20:36.850
So, we'll go ahead and take our second shot.

20:45.120 --> 20:46.660
And then we'll compare.

20:49.840 --> 20:51.060
So, let's see.

20:51.060 --> 20:52.800
We added three keys.

20:53.320 --> 20:57.220
Google one, that's probably Google doing something.

20:57.960 --> 21:00.500
Microsoft tracing to SVC host, that's expected.

21:00.500 --> 21:04.340
We saw that file kind of launch from SVC host.

21:04.340 --> 21:05.600
So, we expect that.

21:06.040 --> 21:07.700
But now we know it's in registry.

21:07.700 --> 21:11.200
We have enable file tracing, enable console tracing.

21:11.440 --> 21:14.240
And again, this is very much a touch base on things.

21:14.240 --> 21:16.760
So, I'm not going to go into what every one of these things may mean.

21:16.940 --> 21:22.280
Just how to run it, how to find it, some things that might be concerning or interesting.

21:23.160 --> 21:25.660
So, file directory.

21:25.660 --> 21:30.700
Then we get into our modified values, which we're also going to get some stuff in here.

21:31.880 --> 21:34.100
I'm not as good at reading text as I used to be.

21:36.020 --> 21:43.520
So, looking for potential current versions of different file pieces, window placement, so on and so forth.

21:46.810 --> 21:48.610
So, we have network traffic.

21:49.850 --> 21:55.990
We have a rogue process that looks like a legitimate Windows process and we have registry files that have changed.

21:56.130 --> 21:58.610
So, there's a couple different ways that you can go about this.

21:58.670 --> 22:04.890
You can reimage a box like most places do or you can go kind of harp in on each one of those individual problems.

22:04.890 --> 22:06.230
Piece by piece.

22:08.310 --> 22:20.390
There's also a much easier way to do this, although I genuinely suggest that everybody kind of do it in an automated or in a manual fashion as they're learning this process.

22:20.410 --> 22:23.410
I also realize that I'm speeding through this really fast.

22:23.410 --> 22:25.850
So, I hope I'm not like blowing anything off.

22:25.850 --> 22:27.510
I tend to go a little quick.

22:29.970 --> 22:31.190
Speak louder?

22:31.770 --> 22:32.570
Sorry.

22:32.630 --> 22:35.770
Yeah, I was standing back there yesterday and I realized I couldn't hear much either.

22:37.590 --> 22:38.730
No problem.

22:39.130 --> 22:42.190
So, automated sandboxing.

22:42.410 --> 22:43.870
Is anybody not familiar?

22:43.870 --> 22:44.570
Familiar?

22:45.250 --> 22:46.610
We'll talk about it anyway.

22:47.210 --> 22:48.850
Everything here is free and open source.

22:48.850 --> 22:51.450
Everything that I'm using throughout the course of this is free and open source.

22:51.450 --> 22:52.330
So, you can do it at home.

22:53.130 --> 22:56.610
As we get into automated sandboxing, you can build this, set it up yourself.

22:56.610 --> 23:01.190
You need a VM, some scripts to point to it, things of that nature.

23:01.210 --> 23:03.350
And it's literally drag and drop.

23:03.750 --> 23:10.530
So, I can take this file, I can drag and drop it to submit and then I can tell it a whole bunch of things.

23:10.530 --> 23:12.010
Do I want it to connect to the internet?

23:12.010 --> 23:12.930
Yes, no.

23:13.130 --> 23:14.670
Do I want to give it a priority?

23:14.710 --> 23:15.570
What's the time out?

23:15.570 --> 23:17.650
So, how long do I want to let this run for?

23:17.850 --> 23:27.110
Now, again, one of the things I like about running something manually is I will let a file, if I'm doing an engagement or was doing an engagement, I would often let a file run for like 24 hours.

23:27.110 --> 23:29.850
See if it did anything else interesting in that time period.

23:29.890 --> 23:33.470
In this case, you're looking at 60 to 120.

23:33.470 --> 23:38.090
You can give it whatever set you want, but it might not get any more information.

23:38.430 --> 23:46.350
You can add remote control, enable injection, dump process memory, um, dump full memory, and a whole bunch of other options.

23:46.350 --> 23:51.030
There's also a wild amount of add-ons that exist for this tool.

23:51.770 --> 23:53.770
So, you can add just about everything you want.

23:53.770 --> 24:02.050
Now, that said, even though I'm going fast, if I run this right now, it'll take like 10 minutes probably to go through and boot.

24:02.050 --> 24:05.910
But I've already run it because, again, I'm terrified something's going to break.

24:06.190 --> 24:08.270
So, we can just look at the report.

24:08.730 --> 24:12.370
So, same file we looked at before, let's see if anything matches up.

24:13.170 --> 24:15.570
Cuckoo also adds a whole bunch of base signatures.

24:15.570 --> 24:19.510
So, it's looking for things that look suspicious, essentially.

24:19.510 --> 24:22.750
So, we can see a couple different things as we go through this.

24:22.750 --> 24:24.950
We can, I like to start with red.

24:24.950 --> 24:25.870
Red is bad.

24:25.870 --> 24:27.070
Yellow could be bad.

24:27.070 --> 24:28.290
Blue, maybe.

24:28.950 --> 24:30.890
Order of priority by color.

24:31.810 --> 24:34.590
Um, attempts to identify installed AV.

24:34.590 --> 24:36.210
It's looking for trend micro.

24:36.410 --> 24:38.210
Deletes its original binary from disk.

24:38.210 --> 24:39.550
We watched that happen.

24:40.090 --> 24:43.050
Collects information about some other installed applications.

24:44.650 --> 24:46.430
Queries details from the computer.

24:46.430 --> 24:50.310
So, you can get a lot of general information from this.

24:50.670 --> 24:52.930
Just from running something in a sandbox.

24:52.930 --> 24:55.690
You can also find about a bunch of them online.

24:55.790 --> 25:01.670
But full disclaimer, don't use like things that you're using for work and then upload them to some website.

25:02.450 --> 25:06.570
Um, unless where you work for is cool with that, then by all means.

25:07.330 --> 25:09.570
Um, and then here we see our IP address.

25:09.570 --> 25:13.330
Although, it does look like after six years that IP address has finally died.

25:13.690 --> 25:17.110
Um, the last time I did this a couple months ago, it wasn't dead.

25:17.110 --> 25:18.950
It was, everything was still completely live.

25:18.950 --> 25:21.730
And I was amazed by that because this is a six year old piece of malware.

25:21.830 --> 25:24.430
Proving that this stuff never really goes out of style.

25:24.430 --> 25:28.070
Like, it still exists and functions and runs.

25:29.250 --> 25:33.210
Um, it'll also give us any of the network connections, anything that we saw.

25:33.210 --> 25:39.630
Again, if your box isn't completely clean though, you will add in some extra things that could hurt.

25:39.750 --> 25:42.270
We can look at some static analysis of that file.

25:42.270 --> 25:46.470
So we can look at any compile time or PDB path.

25:47.550 --> 25:53.270
Any imports for DLLs, which we saw some of those when we went through strings.

25:54.030 --> 25:57.470
Any artifacts that were extracted during that time frame from that file.

25:57.470 --> 25:59.670
In this case, there were no other ones.

25:59.770 --> 26:00.930
Behavioral analysis.

26:00.930 --> 26:03.110
This shows us that process tree.

26:03.310 --> 26:05.810
The file itself goes to SVC host.

26:06.390 --> 26:08.530
Any network analysis that we have.

26:11.010 --> 26:13.290
So we can look at general host connections.

26:13.450 --> 26:15.070
You can also pivot to MOLOC.

26:15.070 --> 26:20.250
Good shout out to MOLOC, even though I'm not going to cover that because Verizon Media, the company that I work for, makes it and open sources it.

26:20.250 --> 26:21.290
So it's a good shout out.

26:21.890 --> 26:24.570
Um, but you can pivot right to MOLOC for full packet capture.

26:25.070 --> 26:27.610
It'll tell you about any files that potentially dropped.

26:27.610 --> 26:30.230
In this case, the dropped file was the file we looked at.

26:30.830 --> 26:32.330
Um, process memory.

26:32.330 --> 26:33.470
It'll pull as well.

26:33.470 --> 26:36.450
So any potential URLs that exist in process memory.

26:36.450 --> 26:39.250
Again, all of these might not be related to that file.

26:40.110 --> 26:44.930
Um, because this is not quite as clean as I would have liked it when I ran this sample.

26:47.660 --> 26:51.060
So you get a kind of a good idea of what you can look at from this perspective.

26:51.060 --> 26:52.520
And there's a lot of other tools too .

26:52.520 --> 26:55.220
Say you're not a Linux guy, you're a Windows guy.

26:55.660 --> 27:04.300
If I hop back into here, which is horribly, horribly infected, and I copy my file back in,

27:07.390 --> 27:16.810
there's a tool called, not that one, PE Studio.

27:16.810 --> 27:17.710
That's it.

27:18.130 --> 27:22.390
So PE Studio essentially does a lot of this from a straight RE perspective.

27:22.390 --> 27:24.850
So you can just drag and drop a file for analysis.

27:25.390 --> 27:27.670
It'll kick into analysis with said file.

27:30.760 --> 27:34.920
Um, it will connect to virus total and look for that hash and give you any indicators.

27:34.920 --> 27:37.580
If this thing did connect to virus total, it would light up like a Christmas tree.

27:37.580 --> 27:39.580
I think it's like 46 out of 64.

27:40.300 --> 27:43.820
Um, it'll give you any potential indicators based by severity.

27:43.820 --> 27:49.220
So installation of hooks, blacklisted libraries, different section names being blacklisted.

27:49.500 --> 27:56.580
Again, we see some of the same things that we saw from each investigation method and maybe a little bit more as we go through each one of these processes.

27:57.040 --> 28:03.300
Um, when you get into that, it'll tell you certain sections, um, string analysis and the strings that it found that were weird.

28:03.300 --> 28:08.900
So the string analysis that we did via command line, this does, and it'll call out the things that are blacklisted.

28:08.940 --> 28:11.200
So, there's our DLL calls.

28:11.720 --> 28:14.260
Very, very convenient tool, also free.

28:14.880 --> 28:22.500
Um, but has to be run on Windows, which means you have to drop it from Windows, so make sure it's on a box that you don't mind completely screwing over.

28:23.700 --> 28:26.760
So, that's about the course of the demo.

28:26.880 --> 28:30.860
So let's kind of loop back in and talk a little bit about this.

28:32.600 --> 28:40.240
So, as a security person, all of us blue team-ish, what can we do with the information that we got?

28:40.380 --> 28:41.740
So we have a file.

28:42.360 --> 28:43.620
We know the hash.

28:43.720 --> 28:46.640
We have endpoint detection software, we can block that hash.

28:46.640 --> 28:48.660
We can look for that hash across our network.

28:48.960 --> 28:51.380
We have call-outs in multiple areas.

28:51.380 --> 28:54.460
So we have the initial call-out from the document that downloads the file.

28:54.780 --> 28:57.740
We can use that to see if anybody else potentially downloaded the file.

28:58.240 --> 29:08.680
We can also use the actual call-out with the semantics cert, the IP call-out, to see if anything went wrong or if anybody is infected with that file.

29:08.680 --> 29:10.940
Just because it tried to download doesn't mean it's infected.

29:10.940 --> 29:12.280
Something could have stopped that.

29:12.640 --> 29:20.560
So we have a whole host of information that we can use in our environment, especially if this came in as an email, it probably went to more than one user.

29:20.720 --> 29:27.820
So we can take a whole host of all the information that we pulled and get an idea of what this looks like across the scope of our whole network.

29:28.600 --> 29:31.700
Which is super useful in any situation.

29:32.720 --> 29:38.060
So, I like to leave this kind of stuff in case anybody wants to take pictures of this kind of stuff.

29:38.440 --> 29:42.500
So we have different commands that were run, um, the very specific commands.

29:42.500 --> 29:44.340
I'll give everybody a minute on that one.

29:48.240 --> 29:49.400
Lot of phones up.

29:49.400 --> 29:49.900
Good.

29:49.900 --> 29:50.640
Good.

29:52.600 --> 29:59.220
I, I keep them up because then we have the picture slide which is links to all different kinds of tools.

29:59.280 --> 30:04.500
Virus total is an amazing tool for seeing what AV vendors know about different stuff.

30:04.500 --> 30:08.440
URL void and IP void, great for IP and URL reputation.

30:08.900 --> 30:14.000
Um, malware.com is a very similar to cuckoo online sandbox that you can upload stuff to.

30:14.220 --> 30:16.400
Then there's a bunch of different tips.

30:16.420 --> 30:20.660
Um, reverse engineering tips, a lot from Lenny Zeltzer who's fantastic at this.

30:20.660 --> 30:26.940
There's great sans courses on the topic and I personally love the malware analyst cookbook and practical reverse engineering.

30:26.940 --> 30:30.880
If this is something that you want to get into, these are some of my recommendations.

30:31.460 --> 30:35.000
The next recommendation page however is a little bit more dangerous.

30:35.460 --> 30:36.900
Links to live malware.

30:37.720 --> 30:41.480
And I, I say disclaimer right now, use those at your own risk.

30:41.880 --> 30:45.280
Um, I suggest having a separate box.

30:45.480 --> 30:49.480
This box is literally the user name is guest and the host name is like malware.

30:50.220 --> 30:54.580
There's no identifiable information to me on this box whatsoever.

30:54.580 --> 30:56.240
I've never logged into a personal account.

30:56.240 --> 30:56.960
I've never done any of that.

30:56.960 --> 30:58.460
But again, paranoid.

30:58.840 --> 31:01.800
Maybe you don't need to do quite that, but that's my thing.

31:01.920 --> 31:04.460
But there you have some links to live malware.

31:05.100 --> 31:06.360
End of speech.

31:06.360 --> 31:10.380
However, I do have stuff for the three best questions.

31:10.500 --> 31:12.240
If anybody has any.

31:18.320 --> 31:21.880
So why don't I use process hacker instead of sys internals?

31:21.960 --> 31:25.280
Probably just stuck in my ways and I don't do it every day anymore.

31:33.830 --> 31:38.330
So easier to use procmon to capture the log and then look through the processes afterward.

31:38.330 --> 31:42.830
And I agree, it's more time consuming and harder to show like this though.

31:53.800 --> 31:59.080
So, VM aware malware, what method would I use to test that?

31:59.480 --> 32:00.160
Right?

32:01.420 --> 32:03.220
If it won't run on a virtual machine.

32:03.480 --> 32:09.380
Um, so I not only have this box, I have a couple other hard boxes that I can use to test this stuff on.

32:09.540 --> 32:13.540
Um, and just a base image, like a base windows image wipe.

32:13.900 --> 32:19.760
Um, a lot of stuff will run in virtual machine and it's much easier to teach this because I have both tools in the same place.

32:19.920 --> 32:25.160
But I have another laptop specifically with wipeable images that I can use for anything that's VM aware.

32:26.640 --> 32:27.580
What's that?

32:29.220 --> 32:31.120
For the image wiping?

32:31.860 --> 32:33.680
It's some enterprise tool.

32:44.220 --> 32:47.260
So, how often do I see something new is the question.

32:47.260 --> 32:49.140
And admittedly I don't do this every day anymore.

32:49.140 --> 32:52.980
But I will say that when I did IR it was in waves.

32:53.440 --> 33:02.960
So, you would see essentially the same thing a lot for a little while and then something new a lot for a little while and then something new a lot for a little while.

33:03.180 --> 33:07.780
Um, crypto miners when I was rolling out of IR and into management were the big thing.

33:08.100 --> 33:14.520
And just personal opinion, if somebody is going to hit you with that, like that's, it couldn't be better than that.

33:14.520 --> 33:16.480
Like there's not a lot of damage there.

33:16.760 --> 33:18.100
But it's waves.

33:18.100 --> 33:24.840
But eventually, I just talked to one of my IR buddies who was here the other day and he said, uh, 10 years he's seen basically the same thing over and over again.

33:24.840 --> 33:26.440
It doesn't change that much.

33:39.260 --> 33:43.240
So, when it comes to malware that's reaching out to CNC, what do you use to spoof the connections?

33:43.340 --> 33:44.860
Typically, I don't.

33:45.240 --> 33:48.520
Um, I log into a VPN and I let it make connections.

33:48.880 --> 33:53.180
I think you get a much more full picture of what happens when you let communication happen.

33:57.700 --> 33:58.680
What's that?

34:03.200 --> 34:05.920
Why attach it to an email instead of Google docs?

34:10.190 --> 34:15.870
Oh, so why not, from an attack perspective, not upload the PDF to Google docs instead of attaching it to an email?

34:15.870 --> 34:17.350
And that happens a lot more now.

34:17.930 --> 34:21.130
But it was just a setup scenario to start the conversation.

34:37.880 --> 34:40.100
Oh, why didn't I just upload the PDF?

34:42.380 --> 34:43.500
I don't know.

34:45.340 --> 34:46.260
Go ahead.

34:51.940 --> 34:56.100
I have and I actually have a sample of it sitting on this box, too.

34:56.240 --> 34:58.940
Um, Emotet V4, actually, I believe.

34:58.940 --> 35:00.740
I worked a big case with that.

35:00.960 --> 35:04.320
Um, you find certain things.

35:04.320 --> 35:11.420
So, like, polymorphic malware, for anybody not familiar, is malware that can change enough to change its hash to make it harder to detect, essentially.

35:11.500 --> 35:13.400
Um, and a couple other attributes.

35:13.600 --> 35:20.120
So, Emotet V4 is a module-based piece of malware that can call out and download different things and it's constantly changing itself on the system.

35:20.300 --> 35:34.660
So, in one of the cases that I used for that, I found common identifiers of the type, which specifically in this case, it was unsigned binaries under or between 60 and 74 kilobytes.

35:35.340 --> 35:41.920
And I tracked it down that way and got probably 150 different hashes until we could get Navy Vendor to do stuff.

35:42.480 --> 35:44.040
You come here, you get a gift.

35:47.040 --> 35:48.120
Yeah.

36:03.210 --> 36:06.070
So, did you say static analysis to intent?

36:12.270 --> 36:17.310
Significantly more difficult, um, from that base analysis to go into intent.

36:17.310 --> 36:26.010
Um, you're starting to get into real serious reverse engineering to get down into the code of exactly what it does outside of what you see from a dynamic perspective.

36:26.550 --> 36:33.610
Um, however, I have found that in many cases, and this is just me, like, I'm a horrible reverse engineer, I'm not going to lie.

36:33.690 --> 36:36.350
Because when I did IR, no company wanted to pay for that.

36:36.350 --> 36:39.650
They just wanted to know how to find it, how to get rid of it, and make sure it was gone.

36:48.990 --> 36:54.710
So, I just run a base VM, but I'm also sitting on a Linux box and I'm only messing with executables in this case.

36:55.670 --> 36:59.730
So, I don't do any specific VM isolation for this.

37:10.160 --> 37:14.580
What do I use to find different variances other than registry keys of the same malware?

37:14.580 --> 37:15.900
That's really interesting.

37:16.220 --> 37:17.600
And a really good question.

37:17.600 --> 37:18.840
I actually have to think about that.

37:18.840 --> 37:19.580
Also, come up here.

37:19.580 --> 37:20.460
You get a thing.

37:21.460 --> 37:26.860
Um, I mean, registry keys not being the only method of persistence in general either.

37:26.860 --> 37:35.180
So, any general auto runs that potentially exist, or any other normal common persistence mechanisms, but man, you're really stumping me with that question.

37:51.790 --> 37:58.930
So, the risk of letting network connections happen and what kind of setup I have in a lab and or VPN to accept that risk.

37:59.390 --> 38:07.830
And I will start that with a story of the one time I forgot to turn on my VPN and executed something that was terrifying and I thought I was screwed.

38:07.830 --> 38:12.470
Like, I thought I was going to get owned after I executed this thing because I completely forgot to turn it on.

38:12.810 --> 38:15.010
I was terrified for at least a week or two.

38:15.250 --> 38:17.030
I never made that mistake again, though.

38:19.250 --> 38:25.810
So, and all the fake DNS and stuff is really good, too, but it doesn't necessarily give you the full picture.

38:26.030 --> 38:29.430
So, I used private internet access for a long time and I was pretty happy with it.

38:29.430 --> 38:32.610
I switched over to Nord recently and I'm pretty happy with that, too.

38:32.930 --> 38:40.370
Um, depending on what I look at, I usually run it on host system, not on VM, so that my host system's coming from that location.

38:40.370 --> 38:46.970
I have seen a little bit of malware that's like location specific, so if you VPN, it's not necessarily going to execute anyway.

38:47.130 --> 38:48.910
But again, few and far between.

38:49.390 --> 38:52.410
Um, I've been pretty happy with standard out of the box VPN service.

38:52.410 --> 38:56.110
I haven't had problems in the five or so years that I did this regularly.

39:02.660 --> 39:05.620
Uh, I, I don't mind sharing the slides.

39:05.620 --> 39:07.000
I have no problem with that.

39:07.220 --> 39:10.600
So, is there anywhere that I can share the slides?

39:15.520 --> 39:16.320
Perfect.

39:16.520 --> 39:18.560
It'll be on blueteamvillage.org.

39:23.980 --> 39:24.960
Oh, another one.

39:24.960 --> 39:25.600
Go ahead.

39:32.710 --> 39:41.730
So, without getting into any of the ones that I can't talk about, um, one of the most interesting ones I've ever seen from a commodity perspective was that Emotet v4 sample.

39:41.930 --> 39:45.950
Because the initial payload was not malicious at all.

39:46.150 --> 39:55.370
And then it would call out and download modules, including SMB spreaders, um, different ransomware and like banking Trojan stuff.

39:55.370 --> 39:58.990
It could install other malware and it changed like every five minutes.

39:58.990 --> 40:03.590
So, trying to get a handle and I watched it shut down a company in two hours.

40:03.770 --> 40:06.610
Like completely shut down a company in two hours.

40:06.870 --> 40:16.110
So, trying to get a handle on what that was to clean it up when it kept changing was one of the most fun and stressful weekends of my life.

40:16.330 --> 40:21.650
It was also one of, on my birthday weekend, which was wonderful because I was supposed to be on vacation.

40:23.910 --> 40:25.210
Anything else?

40:27.650 --> 40:29.870
If not, thank you very much for your time, everybody.

