WEBVTT

00:00:00.540 --> 00:00:04.730
We're now ready for our first hands‑on demonstration. In this demonstration,

00:00:04.730 --> 00:00:07.300
we're going to start by exploring the Arkime viewer,

00:00:07.510 --> 00:00:10.550
the viewer that we'll use in order to analyze our network traffic.

00:00:10.550 --> 00:00:14.420
We'll then move on to identify key patterns and characteristics

00:00:14.420 --> 00:00:16.370
of spear phishing‑related network traffic.

00:00:17.040 --> 00:00:17.610
From there,

00:00:17.620 --> 00:00:20.500
we'll extract some key artifacts from this network traffic

00:00:20.500 --> 00:00:22.260
in order to perform further analysis.

00:00:22.260 --> 00:00:23.420
And finally,

00:00:23.420 --> 00:00:26.910
we'll wrap up this demonstration by discussing some techniques

00:00:26.910 --> 00:00:29.160
that you can use to do proactive threat hunting.

00:00:30.240 --> 00:00:35.310
For these demonstrations, I'll be using Ubuntu 20.04.1 LTS,

00:00:35.430 --> 00:00:38.710
and I have already gone through the Arkime installation according to the

00:00:38.710 --> 00:00:41.740
documentation that you can find on their website. Now,

00:00:41.750 --> 00:00:44.660
as we previously discussed, there's really three components to this.

00:00:44.670 --> 00:00:48.370
There's the viewer, there's the capture service, and then there's elastic.

00:00:48.740 --> 00:00:48.940
Now,

00:00:48.940 --> 00:00:51.490
you'll find that some of the components within Arkime

00:00:51.490 --> 00:00:54.160
still use the older terminology, Moloch,

00:00:54.220 --> 00:00:55.460
which is the case here.

00:00:55.580 --> 00:00:56.980
We have the molochviewer.service.

00:00:56.980 --> 00:01:01.530
We can use systemctl in order to check the status of the service,

00:01:01.690 --> 00:01:04.670
and what we want to see is that it's active, or running.

00:01:05.640 --> 00:01:09.060
If your viewer is not running, you can issue the start command,

00:01:09.440 --> 00:01:11.060
and that should start the Arkime viewer.

00:01:11.640 --> 00:01:14.640
If you run into problems with your viewer being able to start,

00:01:14.650 --> 00:01:16.860
then you'll need to consult the documentation and

00:01:16.860 --> 00:01:18.870
the FAQs on the Arkime website.

00:01:19.440 --> 00:01:21.570
The next component is the capture service,

00:01:21.940 --> 00:01:24.250
and this one we don't actually need to be running.

00:01:24.840 --> 00:01:26.760
This could have an active state of failed.

00:01:27.140 --> 00:01:28.720
Finally, there is elastic.

00:01:28.720 --> 00:01:32.250
We can also use systemctl with a status command,

00:01:32.260 --> 00:01:35.360
and we should see the same active, or running, state for elastic.

00:01:37.640 --> 00:01:38.700
To see the viewer,

00:01:38.710 --> 00:01:43.520
you simply need to open up a browser and navigate to localhost:8005,

00:01:43.530 --> 00:01:46.450
which is the default port that the viewer listens on.

00:01:46.800 --> 00:01:49.780
Now, you'll notice that we get an Oh no, Arkime is empty!

00:01:49.780 --> 00:01:51.330
message, and that's fine.

00:01:51.570 --> 00:01:53.870
There are usually two reasons that this can happen.

00:01:54.140 --> 00:01:58.070
One is that we simply have no data in elastic yet, which is the case here.

00:01:58.340 --> 00:02:01.620
The other is that we may actually be looking at a period of

00:02:01.620 --> 00:02:03.660
time for which we have no network traffic.

00:02:03.850 --> 00:02:04.680
When using pcaps,

00:02:04.680 --> 00:02:08.960
we'll often get the timestamp that that traffic was originally captured on,

00:02:09.440 --> 00:02:12.470
which means that even though we just ingested it now,

00:02:12.520 --> 00:02:15.250
we have to go back to when it was originally captured.

00:02:15.250 --> 00:02:19.710
We can check in the upper left‑hand corner the time frame that we're looking at.

00:02:19.710 --> 00:02:21.560
By default, it's the last hour.

00:02:21.690 --> 00:02:25.100
Selecting any one of these will cause the interface to update.

00:02:25.100 --> 00:02:27.830
To the right, we have actual dates and times.

00:02:27.830 --> 00:02:30.230
Selecting those will bring out a datetime picker,

00:02:30.500 --> 00:02:34.540
and from there we can select a very precise start and end time.

00:02:34.540 --> 00:02:35.840
For these demonstrations,

00:02:35.840 --> 00:02:38.710
it'll be okay just to select all because the traffic

00:02:38.710 --> 00:02:40.860
contained within these pcaps will be very short.

00:02:42.540 --> 00:02:44.570
So how are we going to ingest those pcaps?

00:02:44.580 --> 00:02:48.020
Well, I've provided a shell script in order to help facilitate this.

00:02:48.270 --> 00:02:50.800
We won't spend a lot of time going through all the details here,

00:02:50.880 --> 00:02:54.360
so I'll leave that up to you, but I will summarize it quickly.

00:02:55.640 --> 00:02:57.650
This script will do three important things.

00:02:58.340 --> 00:03:02.700
First, it will clear elastic so all previous data will be erased,

00:03:02.710 --> 00:03:05.280
allowing us to focus on just the traffic from the

00:03:05.280 --> 00:03:06.950
pcap that we're about to ingest.

00:03:07.340 --> 00:03:10.550
It will then use the capture service in order to ingest the pcap.

00:03:10.940 --> 00:03:12.950
And finally, it will restart the viewer.

00:03:13.440 --> 00:03:14.750
Once the script is done,

00:03:14.760 --> 00:03:17.360
you'll need a wait a few seconds before you try to

00:03:17.360 --> 00:03:21.360
look at the data in the viewer, as it can take a little bit of time to populate.

00:03:22.840 --> 00:03:24.370
Now we're ready to use the script.

00:03:24.740 --> 00:03:26.580
We'll use the sudo command,

00:03:26.580 --> 00:03:29.150
./ to tell the system to look in the current

00:03:29.150 --> 00:03:33.470
directory to execute our shell script, and then the path to the pcap file.

00:03:33.840 --> 00:03:35.760
This pcap file is also on my desktop.

00:03:36.240 --> 00:03:37.470
We can now run the script.

00:03:39.140 --> 00:03:41.640
You'll know that your network traffic is ready for analysis

00:03:41.640 --> 00:03:44.420
when you begin to see data in the Session tab.

00:03:44.620 --> 00:03:48.260
That is the main window when looking at the Arkime viewer.

00:03:49.340 --> 00:03:51.670
One of the things we want to think about as we're analyzing

00:03:51.670 --> 00:03:55.170
this traffic is how can we begin to filter this traffic down

00:03:55.330 --> 00:03:59.160
to traffic that interests us, anomalies or something malicious?

00:03:59.350 --> 00:04:02.760
One of the powerful features of Arkime is that just about

00:04:02.770 --> 00:04:05.800
everything that you see can be applied as a filter.

00:04:06.100 --> 00:04:09.640
For example, we can look under the destination port column.

00:04:09.640 --> 00:04:12.770
Click on any piece of data that's present there,

00:04:12.780 --> 00:04:16.310
and we'll get a pop‑out menu that allows us to apply that

00:04:16.310 --> 00:04:18.850
particular instance of data as a filter.

00:04:19.240 --> 00:04:23.730
Let's go ahead then and add port 80 as a filter for our query.

00:04:24.140 --> 00:04:25.760
This will show up in the filter bar.

00:04:26.300 --> 00:04:29.480
This is also a great way to explore the many filters and

00:04:29.480 --> 00:04:32.360
their syntax that are available under Arkime.

00:04:32.570 --> 00:04:37.460
Another location is to click in the upper left‑hand corner on the Arkime logo.

00:04:37.630 --> 00:04:41.250
While maybe not the most obvious place to find help, this is where you'll

00:04:41.250 --> 00:04:45.050
find all of the primary documentation for using the viewer.

00:04:46.040 --> 00:04:48.480
Once we've added the filters that we want to apply,

00:04:48.490 --> 00:04:50.150
we need to click on the search box.

00:04:50.620 --> 00:04:53.060
This will adjust whatever view that we're looking at.

00:04:53.640 --> 00:04:54.940
Our goal right now, though,

00:04:54.940 --> 00:04:57.670
is to begin to narrow down all of the traffic that we're

00:04:57.670 --> 00:05:00.780
currently analyzing to help us focus on something that's

00:05:00.780 --> 00:05:02.760
anomalous or possibly malicious.

00:05:03.340 --> 00:05:06.350
And we've done that already by filtering out all traffic

00:05:06.350 --> 00:05:08.350
that did not communicate over port 80.

00:05:08.940 --> 00:05:10.400
Why would we use port 80?

00:05:10.440 --> 00:05:15.330
Well, HTTP commonly uses port 80 for non‑secure connections.

00:05:15.330 --> 00:05:17.910
Thinking back to how we set up this demonstration,

00:05:17.910 --> 00:05:21.620
we know that in a very common attack scenario threat actors

00:05:21.620 --> 00:05:25.500
will use port 80 in order to make an HTTP request to download

00:05:25.500 --> 00:05:26.870
the next stage of their attack.

00:05:27.540 --> 00:05:29.330
As we begin to apply filters,

00:05:29.330 --> 00:05:32.970
we should generally see the number of entries being reduced.

00:05:33.340 --> 00:05:36.230
As you can see here, we only have five entries right now.

00:05:36.370 --> 00:05:38.330
But let's pretend that we had more entries.

00:05:38.330 --> 00:05:40.060
We could continue to filter.

00:05:40.540 --> 00:05:42.550
Another good technique is to use negation.

00:05:43.040 --> 00:05:45.230
So let's take a look under the information column.

00:05:45.230 --> 00:05:47.960
We have in certain occasions the URI,

00:05:47.960 --> 00:05:51.530
so oftentimes when there is an HTTP request that's being made.

00:05:51.530 --> 00:05:55.200
We can click on that drop‑down and select the and not

00:05:55.210 --> 00:05:56.840
in order to add that as a filter.

00:05:57.160 --> 00:06:00.660
So that'll get rid of everything that matches this URI.

00:06:01.140 --> 00:06:03.490
Now, this may be a little more precise than we need,

00:06:03.490 --> 00:06:07.370
so we can further refine our filters by removing certain

00:06:07.380 --> 00:06:11.270
components of the URI and maybe adding in a wildcard.

00:06:11.740 --> 00:06:15.060
So we'll get just the domain and wildcard everything else.

00:06:15.060 --> 00:06:19.290
And you can see we've now reduced the number of entries from 5 to 3.

00:06:19.290 --> 00:06:20.010
Again,

00:06:20.010 --> 00:06:22.100
this seems a bit trivial when we only have a few

00:06:22.100 --> 00:06:23.840
entries to deal with in the first place,

00:06:23.840 --> 00:06:26.600
but this can be a really good approach for helping you to get

00:06:26.600 --> 00:06:30.410
rid of the known good traffic to help sift through and narrow

00:06:30.410 --> 00:06:31.950
the scope of what you're looking at.

00:06:32.390 --> 00:06:33.680
So what do we have left?

00:06:33.690 --> 00:06:37.090
Well, we still have requests to domains that are likely good,

00:06:37.090 --> 00:06:38.650
DigiCert and Microsoft.

00:06:38.870 --> 00:06:40.950
It's very unlikely that something malicious is

00:06:40.950 --> 00:06:42.760
coming from those particular hosts,

00:06:42.900 --> 00:06:45.360
so we could continue to narrow or filter those out.

00:06:45.740 --> 00:06:46.170
However,

00:06:46.170 --> 00:06:50.020
we can see our last session includes a URI to a less

00:06:50.020 --> 00:06:53.870
common TLD, top‑level domain. That is .ir.

00:06:54.340 --> 00:06:58.750
Another piece of data that I oftentimes use is the Databytes/Bytes column.

00:06:59.240 --> 00:07:02.230
This tells you how much data was returned, both in the request

00:07:02.240 --> 00:07:04.250
and the response from that particular session.

00:07:04.740 --> 00:07:08.040
Here you can see that we had quite a bit of data that was returned.

00:07:08.290 --> 00:07:12.250
So if this is in fact a PDF file, it's a really large PDF,

00:07:12.480 --> 00:07:14.370
and that stands out as a bit odd to me.

00:07:14.490 --> 00:07:18.550
We can also use databytes in order to help divide our traffic, because

00:07:18.550 --> 00:07:20.970
this can be used as filters as we're already doing.

00:07:21.340 --> 00:07:26.100
We could look for sessions that have very large databyte sizes and

00:07:26.100 --> 00:07:29.490
potentially identify downloads of malicious artifacts such as

00:07:29.490 --> 00:07:34.830
executables or DLLs. When we're ready to investigate more details

00:07:34.830 --> 00:07:38.590
about any particular session, we can click on the icon on the

00:07:38.590 --> 00:07:40.540
leftmost side of the interface.

00:07:40.910 --> 00:07:44.630
This will expand that session, and now we can get more refined details.

00:07:44.840 --> 00:07:46.420
Not only do we get more details,

00:07:46.420 --> 00:07:49.550
but you can see we have a lot more data that we could use as filters.

00:07:50.240 --> 00:07:54.230
The first portion of this is about the TCP data. Of course, this data will

00:07:54.230 --> 00:07:56.660
vary based off the protocols that you're investigating.

00:07:57.340 --> 00:07:59.560
So if we scroll down a little bit further,

00:07:59.570 --> 00:08:02.950
we'll see information about the application layer protocol, in this case,

00:08:02.950 --> 00:08:06.970
the HTTP request and response, as well as additional

00:08:06.970 --> 00:08:10.830
information that can be generated by Arkime, such as the MD5

00:08:10.830 --> 00:08:13.520
hashes of the HTTP payload, that is,

00:08:13.520 --> 00:08:16.110
the content of the body. We'll actually come back to

00:08:16.110 --> 00:08:17.450
this information in just a moment.

00:08:18.540 --> 00:08:21.460
Scrolling down yet a little bit further will show the

00:08:21.460 --> 00:08:23.380
actual content from that session.

00:08:23.590 --> 00:08:27.360
So here we can see the HTTP request which is on the left‑hand

00:08:27.360 --> 00:08:31.450
side in red and the HTTP response, which is in blue on the

00:08:31.450 --> 00:08:36.630
right‑hand side. For the request, you'll observe that there are very few headers.

00:08:36.890 --> 00:08:40.090
This is often an indication of some sort of a scripting

00:08:40.090 --> 00:08:42.559
language that made the HTTP request.

00:08:43.059 --> 00:08:46.270
That is, they used very minimal amount of HTTP headers.

00:08:46.640 --> 00:08:48.830
This is in contrast to our browsers.

00:08:49.060 --> 00:08:52.670
Browsers tend to use a lot of headers when making HTTP requests.

00:08:53.540 --> 00:08:57.130
So this is something that we can use in order to try to identify that

00:08:57.130 --> 00:09:01.120
anomalous or potentially malicious traffic we can actually use this header

00:09:01.120 --> 00:09:04.070
count in order to identify these particular sessions.

00:09:04.070 --> 00:09:05.760
And we'll do that in the next demonstration.

00:09:07.040 --> 00:09:11.540
The response is also quite odd in that while it looks like a PDF was

00:09:11.540 --> 00:09:15.370
requested, we can see that it was a PE file that was returned.

00:09:16.190 --> 00:09:18.440
There are a few ways in order to recognize this,

00:09:18.660 --> 00:09:21.190
such as the first two bytes, which are the magic

00:09:21.190 --> 00:09:24.080
numbers for a PE file; the DOS stub,

00:09:24.090 --> 00:09:27.840
which is typically this program cannot be run a DOS mode; and then

00:09:27.840 --> 00:09:30.360
there's some other elements of the file format itself.

00:09:31.240 --> 00:09:33.840
So what would be the next logical step if we had identified

00:09:33.840 --> 00:09:35.780
this type of traffic in our own environments?

00:09:36.240 --> 00:09:39.060
Well, we'd likely want to investigate this PE file.

00:09:39.540 --> 00:09:42.270
One of the quickest and usually easiest things to do is to

00:09:42.270 --> 00:09:44.760
try to generate a hash of the file itself.

00:09:45.240 --> 00:09:49.870
Since we can clearly see the evidence of the PE file in this HTTP response,

00:09:49.880 --> 00:09:52.470
we don't need to suspect that there is obfuscation.

00:09:53.340 --> 00:09:57.120
This means that we can use the body MD5 that was generated

00:09:57.130 --> 00:10:00.540
by Arkime in order to search on other threat intelligence

00:10:00.540 --> 00:10:02.160
platforms, such as VirusTotal.

00:10:02.740 --> 00:10:05.340
What if we wanted to extract the file ourselves and

00:10:05.340 --> 00:10:08.730
perform different analysis on it, such as additional static analysis,

00:10:08.730 --> 00:10:11.260
or maybe uploading it to a sandbox on our own?

00:10:11.840 --> 00:10:12.140
Well,

00:10:12.140 --> 00:10:14.650
here we can use the viewer in order to extract that

00:10:14.650 --> 00:10:16.370
file from this network traffic.

00:10:16.840 --> 00:10:20.650
If you click on the show images and files, that will change the interface.

00:10:21.640 --> 00:10:26.090
And instead of providing you with the content of the HTTP response,

00:10:26.260 --> 00:10:30.020
it'll identify that as a file and turn it into a hyperlink in which you can

00:10:30.020 --> 00:10:35.200
click on and then save that file to your file system. In our next

00:10:35.200 --> 00:10:38.430
demonstration, we'll go ahead and we'll not only use some of these same

00:10:38.430 --> 00:10:41.300
techniques in order to identify some malicious traffic,

00:10:41.340 --> 00:10:45.550
but then we'll also begin to explore patterns in C2, or

00:10:45.550 --> 00:10:47.060
command and control communications.
