WEBVTT

00:00:01.640 --> 00:00:03.090
In this demonstration,

00:00:03.090 --> 00:00:07.120
we're going to build upon the techniques that we've discussed in the previous

00:00:07.120 --> 00:00:12.020
content and now apply that in order to learn how to investigate different

00:00:12.020 --> 00:00:15.230
methods of identifying data exfiltration activity.

00:00:15.230 --> 00:00:20.360
We're also going to explore commonly used protocols for data exfiltration,

00:00:20.740 --> 00:00:26.850
as well as look into how you can utilize the hunt feature of Arkime in order to

00:00:26.850 --> 00:00:30.180
perform searches to identify evidence of data exfiltration,

00:00:30.180 --> 00:00:33.510
as well as just simply to search for different patterns

00:00:33.510 --> 00:00:35.350
that you want to identify in your traffic.

00:00:36.040 --> 00:00:37.590
Let's get started.

00:00:37.590 --> 00:00:39.410
For our first pcap,

00:00:39.410 --> 00:00:42.380
we're going to analyze some traffic that utilizes data

00:00:42.380 --> 00:00:45.490
exfiltration over a relatively non‑standard protocol,

00:00:45.490 --> 00:00:47.760
at least in terms of data exfiltration.

00:00:48.140 --> 00:00:51.060
Now, when it comes to analyzing network traffic,

00:00:51.070 --> 00:00:54.820
these demonstrations are designed to just give you some ideas on how you

00:00:54.820 --> 00:00:57.860
can utilize Arkime in order to look for these anomalies.

00:00:58.240 --> 00:01:01.750
Now, for this particular sample, we will start with the SPI view,

00:01:02.140 --> 00:01:04.400
and what we're going to look for is just any

00:01:04.400 --> 00:01:07.060
anomalous behavior in the traffic itself.

00:01:07.540 --> 00:01:10.290
Now, with these pcaps, this gets to be a little bit easier,

00:01:10.300 --> 00:01:12.940
because we don't have to look at an enormous amount of

00:01:12.940 --> 00:01:14.770
traffic from a production environment.

00:01:15.140 --> 00:01:18.660
So always keep in mind that you can use the filters to help

00:01:18.660 --> 00:01:21.090
eliminate the traffic that you know is good.

00:01:21.390 --> 00:01:24.220
In this case, we can see that there is some email activity.

00:01:24.640 --> 00:01:25.640
Let's say, for example,

00:01:25.640 --> 00:01:28.700
that the environment that we're defending doesn't use any internal

00:01:28.710 --> 00:01:31.210
email servers; all of it's hosted in the cloud.

00:01:31.640 --> 00:01:34.570
This certainly then would be something that we would want to investigate.

00:01:35.040 --> 00:01:37.990
And we can expand that section and click Load All.

00:01:39.140 --> 00:01:42.000
As we begin to review this data, certain things will stand out.

00:01:42.270 --> 00:01:44.700
First, is the body magic of the email itself.

00:01:44.710 --> 00:01:47.050
It was a jpeg, or at least it appears to be a jpeg,

00:01:47.050 --> 00:01:48.350
that was sent out of the environment.

00:01:49.440 --> 00:01:53.070
As we continue to scroll down, things become quite a bit more concerning,

00:01:53.440 --> 00:01:56.680
particularly when we see the sender and the receiver,

00:01:56.920 --> 00:01:59.590
not to mention the subject title of this email,

00:01:59.590 --> 00:02:01.750
which appears to be the name of one of our PCs.

00:02:02.640 --> 00:02:05.210
If we scroll back to the top, under the general section,

00:02:05.220 --> 00:02:09.090
we can expand the menu from the SMTP protocols list

00:02:09.180 --> 00:02:10.650
and then add that as a filter.

00:02:11.039 --> 00:02:13.440
Now we can navigate back to the Sessions tab,

00:02:13.500 --> 00:02:16.580
and what we'll be able to do is expand the session to see

00:02:16.580 --> 00:02:19.350
exactly what took place in this communication.

00:02:19.840 --> 00:02:23.570
So here we can see the information that is in fact loaded from the pcaps.

00:02:24.440 --> 00:02:27.700
We have an authentication event to the SMTP server.

00:02:27.710 --> 00:02:29.480
You'll notice there are credentials there,

00:02:29.480 --> 00:02:30.610
and you'll want to be very careful,

00:02:30.610 --> 00:02:34.140
because you can find yourself in legal trouble if you attempt to access

00:02:34.140 --> 00:02:36.190
a system for which you do not have authorization.

00:02:36.190 --> 00:02:38.420
As we scroll down a little bit further,

00:02:38.420 --> 00:02:40.850
we'll get to the body of the email itself,

00:02:40.850 --> 00:02:42.870
and much like HTTP,

00:02:42.870 --> 00:02:45.370
there are several headers that will help us to understand

00:02:45.380 --> 00:02:47.400
what content we're actually looking at.

00:02:47.520 --> 00:02:49.760
In this case, the content type indicates the image/jpg,

00:02:50.220 --> 00:02:54.350
as we've already noted, and the transfer encoding is Base64.

00:02:55.340 --> 00:02:57.930
So how could we get this information out to see

00:02:57.930 --> 00:02:59.810
actually what data was exfiltrated?

00:02:59.810 --> 00:03:00.620
Well,

00:03:00.620 --> 00:03:03.610
your first reaction may be to simply use the Show

00:03:03.610 --> 00:03:05.950
Image & Files option inside of Arkime.

00:03:05.950 --> 00:03:09.640
However, as you'll see, because that was Base64 encoded,

00:03:09.890 --> 00:03:13.200
it's not able to understand how to decode that content.

00:03:13.200 --> 00:03:16.380
So it's not providing us with the ability to download that file.

00:03:17.140 --> 00:03:19.980
While I'm sure you can think of many ways to decode this content,

00:03:19.990 --> 00:03:23.880
all I'm going to do is to save it in a file and use the Base64

00:03:23.890 --> 00:03:25.870
command line utility in order to decode it.

00:03:27.940 --> 00:03:29.180
After creating a file.

00:03:29.190 --> 00:03:34.420
I just called it image.b64 for Base64, and saving that content to the file,

00:03:34.420 --> 00:03:36.650
we can now use the following commands in order to

00:03:36.650 --> 00:03:37.960
decode it from the command line.

00:03:38.340 --> 00:03:40.530
We'll cat the image in order to get the content,

00:03:40.540 --> 00:03:43.600
and using the redirection operator, the vertical bar,

00:03:43.630 --> 00:03:46.040
direct that to the Base64 utility.

00:03:46.040 --> 00:03:51.230
With the ‑d option, that will take the input from our cat command and decode it.

00:03:51.230 --> 00:03:54.960
We'll finally use the greater‑than operator in order to redirect the output

00:03:54.960 --> 00:03:58.330
from Base64 into a new file that I'll just call image.jpg.

00:03:59.340 --> 00:04:01.720
What this should provide now is the decoded image.

00:04:01.730 --> 00:04:05.550
So we can go to our desktop and open that image file to see what is there.

00:04:06.340 --> 00:04:08.410
It looks like maybe some initial reconnaissance,

00:04:08.410 --> 00:04:10.820
as there was no other content in the email sent,

00:04:10.820 --> 00:04:13.230
nor was there any other follow‑on activity from our

00:04:13.230 --> 00:04:15.770
infected system in this particular pcap.

00:04:15.770 --> 00:04:17.459
Let's move on to our next one.

00:04:18.140 --> 00:04:19.120
With this pcap,

00:04:19.130 --> 00:04:21.339
we're going to be looking at some exfil activity from

00:04:21.339 --> 00:04:23.370
the Raccoon Stealer family of malware,

00:04:23.560 --> 00:04:27.770
which uses zip files in order to steal data from the infected system.

00:04:28.340 --> 00:04:31.320
In order to do this, we're going to use the hunt feature of Arkime.

00:04:31.320 --> 00:04:33.770
In order to get the Hunt tab to show up,

00:04:33.780 --> 00:04:38.070
we first have to go to the Users tab, and from the users that you have created,

00:04:38.160 --> 00:04:41.530
you'll have done at least one of these users during the setup process,

00:04:41.530 --> 00:04:44.750
and we have to check the Can Create Hunts checkbox.

00:04:45.140 --> 00:04:46.650
After that, we can save the options,

00:04:46.650 --> 00:04:49.160
and now the Hunt tab is available in the interface.

00:04:49.640 --> 00:04:53.500
What the Hunt tab allows you to do is to create queries that you can use

00:04:53.500 --> 00:04:56.660
to search across the traffic based off of the filters.

00:04:57.040 --> 00:05:00.370
So I still have the protocols filter from the previous pcap.

00:05:00.940 --> 00:05:04.400
Unless I only want to search under the SMTP protocol,

00:05:04.410 --> 00:05:07.890
I want to make sure to remove that before proceeding. To give

00:05:07.890 --> 00:05:12.210
you a heads up on how large your search is going to be, Arkime

00:05:12.210 --> 00:05:15.100
provides you with an informational box that tells you how many

00:05:15.100 --> 00:05:16.270
sessions will be searched.

00:05:16.560 --> 00:05:20.540
So again, for performance reasons, it's just something to keep in mind. Now,

00:05:20.540 --> 00:05:23.840
in order to get started, we'll want to click on the Create a packet search

00:05:23.840 --> 00:05:26.820
job button on the upper right‑hand part of the interface.

00:05:27.540 --> 00:05:30.020
Doing so will bring up all of the different options for

00:05:30.020 --> 00:05:31.560
the search that you want to perform.

00:05:32.040 --> 00:05:36.520
We can define a name, the number of packets to examine per session,

00:05:36.760 --> 00:05:40.720
if you want to be notified. Probably one of the more important parts

00:05:40.720 --> 00:05:42.520
of this is the actual search itself.

00:05:42.630 --> 00:05:46.130
So we define the content that we want to search for, and

00:05:46.130 --> 00:05:48.220
right below that, what is that content?

00:05:48.230 --> 00:05:50.680
Is it ASCII? Is it ASCII case sensitive?

00:05:50.760 --> 00:05:53.630
Maybe it's hex, maybe it's a regular expression.

00:05:53.740 --> 00:05:56.190
Once you've defined the content that you want to search,

00:05:56.200 --> 00:06:01.240
you can also further define or refine how you want the search to be performed.

00:06:01.470 --> 00:06:04.620
Do you want to search just source packets, just destination packets, or

00:06:04.620 --> 00:06:07.340
both? Do you want raw packets or reassembled packets?

00:06:07.570 --> 00:06:10.860
Once you've defined all of this information, you click the Create button.

00:06:11.430 --> 00:06:12.550
Now, as I mentioned,

00:06:12.560 --> 00:06:17.250
this particular malware oftentimes uses zip files in order to exfiltrate data.

00:06:17.640 --> 00:06:21.830
And one of the benefits that we have with those zip files is that we can see

00:06:21.830 --> 00:06:25.140
at least the content of the file names within the zip.

00:06:25.160 --> 00:06:26.090
It's common then,

00:06:26.090 --> 00:06:31.170
to have very meaningful names in those zip files, passwords, system info,

00:06:31.230 --> 00:06:33.200
cookie values, just to name a few.

00:06:33.350 --> 00:06:36.780
So I'm going to use the string, system info, expecting there to be

00:06:36.780 --> 00:06:39.460
information about the system that has left the environment.

00:06:40.340 --> 00:06:43.620
Since I also anticipate to only find this content in

00:06:43.630 --> 00:06:45.430
traffic leaving the environment,

00:06:45.440 --> 00:06:48.240
I'm going to disable the search destination packets.

00:06:48.250 --> 00:06:50.750
I'm not interested right now in the response.

00:06:51.240 --> 00:06:52.520
Alright, I think we're ready.

00:06:52.530 --> 00:06:54.060
Let's start the search and see what we get.

00:06:55.040 --> 00:06:58.910
Excellent! We can see that we have 100% status, our search is now complete,

00:06:59.030 --> 00:07:03.350
and we have one match, which is indicated to us in the second column.

00:07:04.140 --> 00:07:08.100
We also have information about our search, when it was created, and an ID,

00:07:08.100 --> 00:07:12.900
and this ID is is actually important, because this ID will allow us to use

00:07:12.910 --> 00:07:16.700
this search to filter results in the other interface elements within

00:07:16.710 --> 00:07:21.680
Arkime. So next we can click on the open folder icon in order to open these

00:07:21.680 --> 00:07:23.670
results in a new Sessions tab.

00:07:24.430 --> 00:07:26.880
The first thing I want to point out in this new tab is

00:07:26.880 --> 00:07:30.540
that in the filter box, you have a hunt ID equivalent to

00:07:30.540 --> 00:07:32.170
the ID value that we just saw.

00:07:32.840 --> 00:07:35.450
Now we have the particular session that matched on our search

00:07:35.450 --> 00:07:38.930
results, so we can go ahead and expand the session in order to see

00:07:38.940 --> 00:07:41.750
what type of data was actually exfiltrated.

00:07:42.200 --> 00:07:43.250
As we scroll down,

00:07:43.250 --> 00:07:45.560
you'll see some of the back and forth from this HTTP

00:07:45.560 --> 00:07:49.970
request response, before finally, you'll see that suspicious post.

00:07:50.540 --> 00:07:52.270
Fortunately, for this example,

00:07:52.270 --> 00:07:56.630
we can enable the Show Image & FIles option in Arkime, and that will allow

00:07:56.630 --> 00:08:00.050
us then, via this hyperlink, to download that zip file.

00:08:00.740 --> 00:08:01.940
Once we've downloaded it,

00:08:01.950 --> 00:08:06.430
it will download as a .pellet. We can rename that with a .zip extension,

00:08:06.440 --> 00:08:09.770
and use the default system utility to unzip the file.

00:08:10.240 --> 00:08:12.940
I went ahead and moved that file to another folder on my

00:08:12.940 --> 00:08:15.270
desktop just to keep things organized.

00:08:15.600 --> 00:08:18.260
As you can see, I've already given it the .zip extension,

00:08:18.440 --> 00:08:20.950
which allows me to simply double‑click on the file.

00:08:21.440 --> 00:08:25.470
And now we can extract that content to the current directory and then finally,

00:08:25.470 --> 00:08:28.630
we can explore the content that was sent within that zip.

00:08:28.740 --> 00:08:32.679
At this point, you can continue to explore the content that is in this zip,

00:08:32.690 --> 00:08:36.200
and sometimes you'll find even more revealing information about

00:08:36.200 --> 00:08:38.150
the malware that you've just encountered.

00:08:38.640 --> 00:08:39.500
In any case,

00:08:39.500 --> 00:08:43.330
you now have a better understanding on how to use the hunt feature in order to

00:08:43.330 --> 00:08:45.970
explore and search for different patterns in your traffic,

00:08:46.190 --> 00:08:48.960
as well as how we can use different views, such as the SPI

00:08:48.960 --> 00:08:52.540
view, in order to detect anomalous behaviors. We're now ready

00:08:52.540 --> 00:08:54.050
to move on to our next demonstration.
