WEBVTT

00:00.000 --> 00:03.165
>> Hey everyone, welcome
back to the course.

00:03.165 --> 00:04.440
In the last video,
we talked about

00:04.440 --> 00:05.580
the different components of

00:05.580 --> 00:07.230
malware with similar
definitions.

00:07.230 --> 00:10.335
I bet you understand all of
those terms for your exam.

00:10.335 --> 00:12.960
In this video, we're going
to cover static versus

00:12.960 --> 00:15.440
dynamic analysis for malware,

00:15.440 --> 00:16.770
but I want to
stress that this is

00:16.770 --> 00:18.360
going to be a
high-level overview.

00:18.360 --> 00:20.100
We are not going
to deep dive into

00:20.100 --> 00:23.410
malware analysis in
this particular module.

00:24.380 --> 00:28.155
Basic Static Malware Analysis.

00:28.155 --> 00:29.950
As the name implies, we're

00:29.950 --> 00:31.400
not executing the actual code,

00:31.400 --> 00:33.475
we're just taking a look at it.

00:33.475 --> 00:35.975
First step is generally always

00:35.975 --> 00:38.335
scanning it with some
type of tool we have,

00:38.335 --> 00:40.330
like your Malwarebytes, Sophos,

00:40.330 --> 00:42.960
TrendMicro, et cetera.

00:42.960 --> 00:44.780
Whatever you decide to use, or

00:44.780 --> 00:45.920
whatever your company's using,

00:45.920 --> 00:47.465
we just scan it with that first.

00:47.465 --> 00:48.950
Then we can also take a hash

00:48.950 --> 00:50.555
for finger printing purposes.

00:50.555 --> 00:52.910
For example, if we want
to upload that hash

00:52.910 --> 00:55.670
to something like
Virus Total to see

00:55.670 --> 00:56.860
if it's been found before,

00:56.860 --> 00:58.040
and so we can get
information about

00:58.040 --> 01:00.725
that particular malware, and
even see if it is malware.

01:00.725 --> 01:05.480
Or, if we don't find it
on a site like that,

01:05.480 --> 01:08.000
then we have a hash that we
can then report to them,

01:08.000 --> 01:10.765
and say, hey, found this
new malware or whatever.

01:10.765 --> 01:12.690
Searching strings so we can

01:12.690 --> 01:16.085
search any type of
URL connections.

01:16.085 --> 01:18.905
Does it copy files to
a specific location?

01:18.905 --> 01:23.390
Then also, if the malware is
Pax over Packer was used,

01:23.390 --> 01:26.525
then generally we're
going to see few strings

01:26.525 --> 01:28.430
showing, and that
could potentially

01:28.430 --> 01:32.100
indicate that the
file is malicious.

01:32.720 --> 01:37.860
Here's an example of just
taking a look at a string.

01:38.240 --> 01:40.470
Again, we're not diving into

01:40.470 --> 01:43.100
actual malware analysis,
or deep dive, or anything.

01:43.100 --> 01:44.540
I just want to show you what we

01:44.540 --> 01:46.445
might look for as
an investigator.

01:46.445 --> 01:50.255
You'll see things like
VP3, VW3 et cetera.

01:50.255 --> 01:52.715
Those look like just
random characters.

01:52.715 --> 01:54.325
Generally you can ignore those.

01:54.325 --> 01:55.950
The things you want to focus on,

01:55.950 --> 01:57.465
we see an IP address
right there.

01:57.465 --> 01:58.850
That's definitely one.

01:58.850 --> 02:04.565
We also see GetLayout
GDI32.DLL set layout.

02:04.565 --> 02:06.620
We also see an
error message back.

02:06.620 --> 02:09.570
Those are things we
would want to focus on.

02:09.680 --> 02:13.810
The Getlayout here,
and also SetLayout.

02:13.810 --> 02:15.440
These are windows
functions that are used

02:15.440 --> 02:17.450
by Windows graphics library.

02:17.450 --> 02:21.320
These are meaningful
things to look

02:21.320 --> 02:25.490
at because these are actual
legitimate things in use,

02:25.490 --> 02:27.545
not just some jumpy
characters like

02:27.545 --> 02:30.575
the T$@ symbol or whatever.

02:30.575 --> 02:33.965
Also, GDI32.DLL.

02:33.965 --> 02:36.290
That's [inaudible]
because it's a name of

02:36.290 --> 02:39.785
a common Windows DLL that's
used by graphics programs.

02:39.785 --> 02:43.835
This contains executable code

02:43.835 --> 02:49.150
that the malware could be
using in some capacity.

02:49.150 --> 02:51.600
Finally, the error message.

02:51.600 --> 02:54.350
Oftentimes when you're
doing static analysis,

02:54.350 --> 02:57.230
oftentimes the error
messages are very

02:57.230 --> 03:01.895
valuable, because they can
show you different things.

03:01.895 --> 03:03.530
In this example, this can

03:03.530 --> 03:05.300
show us that the
malware probably does

03:05.300 --> 03:06.480
send messages because we see

03:06.480 --> 03:09.285
a mail system error
and a send mail error.

03:09.285 --> 03:11.320
Then, also,

03:11.320 --> 03:15.020
it may indicate to us
that we want to go ahead,

03:15.020 --> 03:18.830
and check email logs
for suspicious traffic.

03:18.830 --> 03:20.660
In this example that we

03:20.660 --> 03:22.855
can use as a forensic
investigator.

03:22.855 --> 03:25.040
Again, I want to
stress we are not deep

03:25.040 --> 03:27.080
because you can actually
have a whole course on

03:27.080 --> 03:29.180
malware analysis as
you probably see out

03:29.180 --> 03:31.670
there. We're not
taking a deep dive.

03:31.670 --> 03:32.930
I just want to show
you an example of

03:32.930 --> 03:36.510
static analysis as
a very basic level.

03:37.130 --> 03:40.660
Portable executable format PE

03:40.660 --> 03:42.725
is something that you just
want to know for your exam.

03:42.725 --> 03:45.560
Just understand
that the PE header

03:45.560 --> 03:47.674
can contain the
code information,

03:47.674 --> 03:49.040
the application type,

03:49.040 --> 03:51.725
library functions
that will be used,

03:51.725 --> 03:54.600
requirements of the malware.

03:54.950 --> 03:57.170
Different files in there you

03:57.170 --> 03:58.564
>> might see like the text file

03:58.564 --> 04:01.410
>> contains instructions
at the CPU executes.

04:01.410 --> 04:03.380
That's the executable code

04:03.380 --> 04:05.364
>> information in the text file.

04:05.364 --> 04:09.510
>> The rdata contains import,
and export information.data,

04:09.510 --> 04:12.305
as the name implies, but
it contains global data,

04:12.305 --> 04:14.300
not local data, but
the global data.

04:14.300 --> 04:16.060
Just keep that in
mind for your exam.

04:16.060 --> 04:18.490
Then rsrc contains
a resources used,

04:18.490 --> 04:20.480
so things like your
icons, or images, or

04:20.480 --> 04:23.460
even menus that the
malware is calling.

04:23.990 --> 04:26.390
Linking libraries, you'll just

04:26.390 --> 04:27.785
want to be familiar with this.

04:27.785 --> 04:29.630
Specifically, you'll
want to be familiar

04:29.630 --> 04:32.060
with a tool called
Dependency Walker.

04:32.060 --> 04:34.520
Runtime linking only when

04:34.520 --> 04:36.695
the function is needed,
static linking,

04:36.695 --> 04:38.720
all the library code is

04:38.720 --> 04:42.350
copied into the executable,
and more commonly,

04:42.350 --> 04:43.730
the dynamic linking is probably

04:43.730 --> 04:45.650
the most common one
that you see out there.

04:45.650 --> 04:47.150
That's only one that
the program is loaded

04:47.150 --> 04:49.580
does it pull the information.

04:49.580 --> 04:52.580
The Dependency Walker
tool that I mentioned,

04:52.580 --> 04:54.560
you'll want to know for
the exam that one lists

04:54.560 --> 04:57.155
out the dynamically
linked function.

04:57.155 --> 04:59.975
Just know for the exam
that Dependency Walker

04:59.975 --> 05:03.300
is used for static
malware analysis.

05:04.610 --> 05:07.310
We can use it for static
malware analysis.

05:07.310 --> 05:08.810
Just keep that aspect in mind.

05:08.810 --> 05:10.835
I should correct myself there.

05:10.835 --> 05:14.310
Basic static malware
analysis continued.

05:14.310 --> 05:17.810
We can look here

05:17.810 --> 05:21.980
in CurrentVersion\Run, and
that'll show us basically

05:21.980 --> 05:26.090
controls which programs
are run at startup, and

05:26.090 --> 05:27.815
then we can also see

05:27.815 --> 05:30.950
registry strings commonly
used by malware as well.

05:30.950 --> 05:34.310
This one here, you may
commonly see in the malware,

05:34.310 --> 05:36.590
especially if you decide
to unpack it, or if

05:36.590 --> 05:38.810
you can unpack it or honestly,

05:38.810 --> 05:39.890
if you can just see the code of

05:39.890 --> 05:41.660
it If it's not using a packer,

05:41.660 --> 05:43.680
It's probably the easiest way.

05:43.760 --> 05:47.460
Just a quick post assessment
on question of static.

05:47.460 --> 05:48.830
Dynamic linking is generally

05:48.830 --> 05:50.975
the most common form of
linking seen in malwares.

05:50.975 --> 05:53.020
Is that true, or false?

05:53.020 --> 05:55.980
That one's true. Again,

05:55.980 --> 05:58.275
that's the most common
one that we see.

05:58.275 --> 06:01.515
Basic dynamic malware analysis.

06:01.515 --> 06:03.140
The main difference
here is we're

06:03.140 --> 06:04.860
actually executing the malware.

06:04.860 --> 06:08.780
We're trying to see what's
it doing when it runs.

06:08.780 --> 06:10.880
We want to do that inside of

06:10.880 --> 06:13.880
a virtual machine, or a
sandbox, so to speak.

06:13.880 --> 06:15.110
We don't want to do that on

06:15.110 --> 06:16.130
your regular
computer because you

06:16.130 --> 06:18.335
don't know exactly what that
malware is going to do.

06:18.335 --> 06:20.570
Even if you look at it
from a static standpoint,

06:20.570 --> 06:22.010
you may not fully understand

06:22.010 --> 06:23.090
what all the code is going to be

06:23.090 --> 06:24.380
doing, so that's why you don't

06:24.380 --> 06:26.290
want to run it on
your own machine.

06:26.290 --> 06:28.335
Keep it in mind though
that when we do

06:28.335 --> 06:30.294
basic dynamic malware analysis,

06:30.294 --> 06:34.505
we may not see,

06:34.505 --> 06:36.500
all the execution
of the Malware,

06:36.500 --> 06:39.440
because sometimes it may
require user interaction so

06:39.440 --> 06:40.730
we may not be able to see

06:40.730 --> 06:42.410
>> what it's actually
going to do.

06:42.410 --> 06:43.730
>> Now, if we deep dive into

06:43.730 --> 06:46.400
advanced dynamic
malware analysis,

06:46.400 --> 06:47.570
we're actually cracking,

06:47.570 --> 06:49.190
open the malware, and looking at

06:49.190 --> 06:51.020
the code of it, and
going through, and

06:51.020 --> 06:53.630
understanding how does
this particular line of

06:53.630 --> 06:56.490
code function, then sure.

06:56.490 --> 06:57.440
We might be able to figure out

06:57.440 --> 06:58.430
exactly how it's functioning.

06:58.430 --> 07:00.350
But in this case,

07:00.350 --> 07:04.460
for a very basic dynamic
malware analysis,

07:04.460 --> 07:05.915
you may not understand fully

07:05.915 --> 07:08.120
what the malware is going to do.

07:08.120 --> 07:09.650
That's why again, we
want to make sure we

07:09.650 --> 07:12.360
run it inside of a sandbox.

07:12.650 --> 07:16.910
Things like the process
monitor can be used for PDF.

07:16.910 --> 07:19.370
Dependency Walker, as
I mentioned, again,

07:19.370 --> 07:21.260
that can be used for
static or dynamic

07:21.260 --> 07:24.305
to look at the linking
of registry shots.

07:24.305 --> 07:26.330
We basically copy the registry

07:26.330 --> 07:28.520
and then execute the
malware, and compare

07:28.520 --> 07:30.470
the different registries to see

07:30.470 --> 07:32.750
if there was a change to the
registry by the malware.

07:32.750 --> 07:35.495
Netcat so we can
look at what's open,

07:35.495 --> 07:37.810
open sessions, that stuff.

07:37.810 --> 07:40.170
Then Wireshark, of course
we know that's for

07:40.170 --> 07:41.880
packet capturing so we could

07:41.880 --> 07:44.775
potentially look at
the network traffic

07:44.775 --> 07:47.280
after we're executing a malware.

07:47.280 --> 07:50.190
Just a quick assessment
question here.

07:50.190 --> 07:51.200
I mentioned it a few times,

07:51.200 --> 07:52.910
but you do not need to use

07:52.910 --> 07:53.930
a sandbox environment for

07:53.930 --> 07:56.479
>> basic dynamic
malware analysis.

07:56.479 --> 07:58.680
>> Is that true or false?

07:59.660 --> 08:02.360
We know that's false. I
mentioned a few times

08:02.360 --> 08:04.130
that if you're going to
do dynamic analysis,

08:04.130 --> 08:06.290
you definitely want to do
it inside of a sandbox.

08:06.290 --> 08:08.195
I should recommend
static analysis,

08:08.195 --> 08:12.125
any type of malware analysis
for static, or dynamic,

08:12.125 --> 08:15.095
do those inside of a
sandbox environment.

08:15.095 --> 08:17.060
In this video, we
just wrapped up

08:17.060 --> 08:18.540
our discussion on malware.

08:18.540 --> 08:21.544
We talked about static versus
dynamic malware analysis.

08:21.544 --> 08:23.870
Again, we just touched
it on very high level.

08:23.870 --> 08:27.360
In the next module we're
going to go over email crime.

08:27.360 --> 08:30.740
We'll talk about things
like the canned spam act

08:30.740 --> 08:33.020
and analyzing a
different email files.

08:33.020 --> 08:35.190
In the next module.

