WEBVTT

00:00:00.340 --> 00:00:02.170
For our next hands‑on demonstration,

00:00:02.180 --> 00:00:05.950
we're going to look at traffic from a couple of prevalent threat families

00:00:06.220 --> 00:00:10.250
and use this traffic to discuss command and control patterns associated with

00:00:10.250 --> 00:00:15.060
these threat actors to explore the use of HTTP protocol for post infection

00:00:15.060 --> 00:00:19.740
activity and then to analyze C2 patterns so that you can better detect this

00:00:19.740 --> 00:00:21.450
activity from other malware.

00:00:22.240 --> 00:00:25.930
For the first pcap that we'll analyze, this is traffic that comes from emotet,

00:00:25.930 --> 00:00:29.670
and this traffic covers not only the dropping of the

00:00:29.670 --> 00:00:31.790
trojan from the malicious office document,

00:00:31.930 --> 00:00:34.340
but then the post infection beaconing so we're

00:00:34.340 --> 00:00:36.070
going to analyze both aspects here.

00:00:37.440 --> 00:00:40.470
So for this example, let's start by looking at the databytes.

00:00:40.480 --> 00:00:44.910
While we could select any data from that column and apply that as a filter,

00:00:44.920 --> 00:00:46.260
we can also sort it.

00:00:46.420 --> 00:00:48.750
So we can click on the arrow in the column header.

00:00:49.240 --> 00:00:51.990
Clicking on it once will sort from lowest to highest,

00:00:52.000 --> 00:00:54.970
clicking on it again will sort from highest to lowest.

00:00:55.840 --> 00:00:59.510
And here, we can see that we have a fairly large request and response.

00:01:01.040 --> 00:01:04.019
If we expand that session and scroll down so that we can

00:01:04.019 --> 00:01:06.480
investigate the HTTP response body,

00:01:06.530 --> 00:01:09.910
we'll see pretty clear evidence of our PE file as we

00:01:09.910 --> 00:01:11.360
did in the previous demonstration.

00:01:11.450 --> 00:01:14.190
We could now extract this file and do some analysis,

00:01:14.190 --> 00:01:16.460
do some further research to try to identify the

00:01:16.460 --> 00:01:18.530
family that this malware belongs to.

00:01:18.690 --> 00:01:21.980
That is oftentimes the first step when performing this type of investigation.

00:01:23.140 --> 00:01:24.480
So what could our next steps be?

00:01:24.490 --> 00:01:27.580
Well, we have a start and stop time for this particular session,

00:01:27.580 --> 00:01:32.160
so it stands to reason that post infection traffic will likely occur

00:01:32.270 --> 00:01:35.010
sometime around when this trojan was downloaded.

00:01:35.200 --> 00:01:38.450
Of course, that's not a guarantee, but it's a good place to start.

00:01:38.640 --> 00:01:41.770
So now we can click on both the start and the stop time,

00:01:42.240 --> 00:01:45.110
and what that will do is that will apply those time

00:01:45.110 --> 00:01:47.830
values to our time and date range filters.

00:01:48.080 --> 00:01:51.740
Of course, this is just the start and stop time for this particular session.

00:01:51.740 --> 00:01:54.440
So what we'll want to do is expand that timeframe,

00:01:54.580 --> 00:01:57.080
so let's increase the end time by 5 minutes.

00:01:57.540 --> 00:01:58.750
After we make that adjustment,

00:01:58.760 --> 00:02:01.990
we'll want to click search and you'll notice that we have increased

00:02:01.990 --> 00:02:03.950
the number of entries that we wanted to view.

00:02:04.940 --> 00:02:08.570
Now what we can do is we can sort based off of the start and end time.

00:02:09.539 --> 00:02:11.840
I'm going to set the sorting so that the most recent

00:02:11.840 --> 00:02:13.830
time from this traffic is at the top.

00:02:14.020 --> 00:02:16.870
The third session down we can see the request for our trojan.

00:02:17.070 --> 00:02:19.960
Then we have two sessions that come after that and

00:02:19.960 --> 00:02:21.660
this is our post infection traffic.

00:02:22.140 --> 00:02:25.350
We've already uncovered some pretty important IOCs and that we

00:02:25.350 --> 00:02:28.470
have a destination IP for both of these hosts.

00:02:29.040 --> 00:02:32.760
You'll also notice that the command and controls infrastructure has changed.

00:02:33.140 --> 00:02:36.870
Trojan was initially downloaded from some compromised infrastructure,

00:02:37.130 --> 00:02:40.630
likely a legitimate website that has been compromised to host the malware.

00:02:40.770 --> 00:02:42.970
Now that the malware has infected that system,

00:02:42.980 --> 00:02:45.480
it's using a different set of IP addresses,

00:02:45.570 --> 00:02:47.220
it's not using compromised host,

00:02:47.230 --> 00:02:50.690
and it's checking in information about that victim and gathering

00:02:50.690 --> 00:02:53.760
further command information from that different network.

00:02:54.640 --> 00:02:56.260
So our next step is to investigate.

00:02:56.640 --> 00:02:59.090
What did the trojan communicate from our victim,

00:02:59.100 --> 00:03:01.860
our internal host, to these command and control nodes.

00:03:02.440 --> 00:03:06.460
We can expand the session and begin to analyze the information that it contains.

00:03:07.640 --> 00:03:09.040
If we continue to scroll down,

00:03:09.050 --> 00:03:12.080
we'll be able to investigate the full HTTP request,

00:03:12.220 --> 00:03:15.770
the data that was sent from our victim to that command and control network.

00:03:16.140 --> 00:03:18.010
In terms of the HTTP headers,

00:03:18.020 --> 00:03:21.690
this one looks a little bit more proper and that we have a number of

00:03:21.700 --> 00:03:24.370
normal HTTP headers that we would expect to see,

00:03:24.410 --> 00:03:27.980
particularly from HTTP traffic generated by our browsers.

00:03:27.990 --> 00:03:30.880
We also have some of the key headers, such as the referrer.

00:03:31.040 --> 00:03:32.320
In fact, there are IDS,

00:03:32.320 --> 00:03:36.170
intrusion detection system alerts that will generate just on HTTP

00:03:36.170 --> 00:03:38.370
traffic that is missing the referrer header.

00:03:38.940 --> 00:03:42.750
Scrolling down a bit further, we can see the body of this HTTP request.

00:03:43.640 --> 00:03:43.810
Here,

00:03:43.810 --> 00:03:47.400
we can see a small amount of data and we can determine that this

00:03:47.400 --> 00:03:49.740
a small just by simply looking at the size,

00:03:49.960 --> 00:03:53.120
each character represents a byte and there is a relatively small

00:03:53.120 --> 00:03:56.150
number of bytes that were sent back to that C2 node.

00:03:57.140 --> 00:03:58.950
Now, unfortunately, we can't understand,

00:03:58.950 --> 00:04:01.030
we can't see what these bytes represent,

00:04:01.040 --> 00:04:04.430
and that's because emotet uses encryption in order to protect that data.

00:04:04.640 --> 00:04:07.530
So even though it's not using a TLS connection,

00:04:07.540 --> 00:04:11.150
a secure connection to communicate over its command and control network,

00:04:11.230 --> 00:04:13.160
it is encrypting the content that it's sending.

00:04:13.640 --> 00:04:16.010
One thing we know for sure that we haven't seen a

00:04:16.010 --> 00:04:18.079
significant amount of data leave the network,

00:04:18.100 --> 00:04:18.850
and likely.

00:04:18.850 --> 00:04:21.740
this is rather minimal information about this new victim

00:04:21.750 --> 00:04:23.960
that is reporting in to its C2 network.

00:04:24.540 --> 00:04:27.410
Let's briefly look at another pcap in which the emotet

00:04:27.410 --> 00:04:29.760
infrastructure responds just a little bit differently.

00:04:30.340 --> 00:04:33.630
With this pcap, we can, again, sort by the databytes,

00:04:33.740 --> 00:04:37.030
and what you'll receive is that the session that comes to the top,

00:04:37.040 --> 00:04:41.120
that is that has the largest bytes in the request response, is

00:04:41.120 --> 00:04:42.730
the one that we're the most interested in.

00:04:42.940 --> 00:04:47.590
If we expand the session and scroll down to the HTTP request response,

00:04:47.840 --> 00:04:50.750
you'll notice that the request itself is a little bit

00:04:50.750 --> 00:04:53.360
different than what we were previously analyzing and that's

00:04:53.360 --> 00:04:55.220
because this pcap is a little bit older.

00:04:55.510 --> 00:04:57.810
As with a lot of prevalent malware families,

00:04:57.810 --> 00:04:58.780
they tend to evolve,

00:04:58.790 --> 00:05:01.440
they change the patterns, the way in which they check into their

00:05:01.440 --> 00:05:04.750
command and control networks over time and emotet certainly has been

00:05:04.750 --> 00:05:07.350
one that has been very consistent in doing that.

00:05:07.840 --> 00:05:10.450
However, what we want to focus on here is the response.

00:05:11.240 --> 00:05:15.570
Part of the reason why this had such a large amount of data is

00:05:15.570 --> 00:05:18.500
because the response that we got from the command and control

00:05:18.500 --> 00:05:20.360
network is considerably large.

00:05:20.840 --> 00:05:24.770
You'll notice, though, that unlike previous payloads that we have discussed,

00:05:25.140 --> 00:05:28.210
this one is not clearly identifiable as a PE file.

00:05:28.490 --> 00:05:32.420
It's a common technique to see prevalent trojans used to not

00:05:32.420 --> 00:05:34.620
only infect the system and steal data,

00:05:34.620 --> 00:05:37.720
as well as provide other remote access capabilities,

00:05:37.720 --> 00:05:39.660
but also to drop other malware.

00:05:40.040 --> 00:05:43.620
Unfortunately, we can't identify this with the traffic that we see,

00:05:43.800 --> 00:05:46.080
but based off of the size of this alone,

00:05:46.080 --> 00:05:47.490
I would be very suspicious.

00:05:47.720 --> 00:05:49.830
While, not present in this traffic sample,

00:05:49.840 --> 00:05:53.370
we may also see evidence of additional beacon ing from other malware

00:05:53.370 --> 00:05:56.510
families and now we can use the same approach to investigate that

00:05:56.510 --> 00:05:59.520
traffic as well to help us identify the type of malware that may

00:05:59.520 --> 00:06:01.150
additionally have been dropped here.

00:06:02.140 --> 00:06:03.850
Okay, let's look at one more pcap.

00:06:04.940 --> 00:06:05.940
With this pcap,

00:06:05.950 --> 00:06:10.280
we're going to switch to a different view and spend some time using SPI view.

00:06:10.320 --> 00:06:12.630
Now the first thing you'll likely notice if you're using

00:06:12.630 --> 00:06:15.640
the all timeframe is that the all date range is not

00:06:15.640 --> 00:06:17.150
allowed for this particular view.

00:06:17.540 --> 00:06:18.910
That's an easy thing to fix.

00:06:18.920 --> 00:06:22.240
You can either adjust the timeframe based off of the drop‑down,

00:06:22.250 --> 00:06:25.250
or you can simply add a second to the start time.

00:06:25.940 --> 00:06:26.750
In either case,

00:06:26.750 --> 00:06:29.450
this will avoid the error message that you're receiving and

00:06:29.450 --> 00:06:32.450
allow you to analyze all of the traffic that is currently

00:06:32.590 --> 00:06:34.550
present in your elastic cluster.

00:06:35.140 --> 00:06:39.170
The SPI view, or session profile information view, is a great

00:06:39.170 --> 00:06:42.780
view in that it takes all of the metadata about the traffic

00:06:42.790 --> 00:06:46.760
that is within your Arkime cluster and provides it in terms of

00:06:46.760 --> 00:06:48.760
counts and with categories.

00:06:49.140 --> 00:06:52.560
As you can see in this tab, we have general information about our traffic.

00:06:52.590 --> 00:06:58.190
We have a number of session counts based off of protocol such as UDP, TCP, ICMP.

00:06:58.200 --> 00:07:01.570
We can dig deeper into that General tab and we'll see information,

00:07:01.570 --> 00:07:05.530
such as the actual hosts, destination IPs, and source IPs.

00:07:06.040 --> 00:07:08.680
We can use this to not only identify counts,

00:07:08.690 --> 00:07:12.480
how much are we seeing any particular piece of data show up in our traffic,

00:07:12.490 --> 00:07:16.960
but then also as another way to explore the different filters that we can apply.

00:07:17.440 --> 00:07:19.490
Keep in mind when using the different views,

00:07:19.580 --> 00:07:22.940
any filter that you build from any other tab is applied

00:07:23.080 --> 00:07:24.470
to the current tab that you're on.

00:07:24.730 --> 00:07:27.240
So if we had left some filters from our session tabs,

00:07:27.360 --> 00:07:30.310
those would be applied to the traffic under the SPI view.

00:07:30.520 --> 00:07:34.270
For performance reasons, not all the data is loaded when you go to this page.

00:07:34.740 --> 00:07:37.250
An example of this behavior is with DNS,

00:07:37.530 --> 00:07:38.520
it is not loaded,

00:07:38.530 --> 00:07:42.960
but it is indicating to us that DNS has 10 entries that we could then

00:07:43.340 --> 00:07:46.370
click on the Load All tab and then view that information.

00:07:47.410 --> 00:07:48.310
As we scroll down,

00:07:48.320 --> 00:07:51.350
we're going to actually use the user agent in order to

00:07:51.350 --> 00:07:53.070
try to investigate this traffic.

00:07:53.440 --> 00:07:56.430
Sometimes the user agent can be a very distinct piece of

00:07:56.430 --> 00:08:00.040
information that we can use to simply pivot and explore on

00:08:00.040 --> 00:08:01.360
what's going on in our networks.

00:08:01.740 --> 00:08:03.280
This is a LokiBot example,

00:08:03.290 --> 00:08:07.560
and LokiBot has historically used a very prevalent user agent name.

00:08:08.540 --> 00:08:11.660
Let's add this as a query value and go back to our Sessions tab.

00:08:13.340 --> 00:08:17.200
LokiBot is the type of malware that uses a panel, it's what the

00:08:17.200 --> 00:08:21.300
administrators of that particular malware family logs into in order to see

00:08:21.440 --> 00:08:23.870
the victims that it's acquired during their campaigns,

00:08:24.130 --> 00:08:26.840
as well as to communicate with the infected systems.

00:08:27.240 --> 00:08:29.180
So with a LokiBot infection,

00:08:29.180 --> 00:08:31.570
one of the first things that it does is it checks into its

00:08:31.570 --> 00:08:36.140
panel. We can see evidence of this with the URI.

00:08:36.150 --> 00:08:38.400
Pin.php is the page that it's been configured to

00:08:38.400 --> 00:08:40.370
check into for this particular panel.

00:08:41.340 --> 00:08:44.600
We can expand the first check‑in. If we focus on just the

00:08:44.600 --> 00:08:47.730
content that was sent with this HTTP Post request,

00:08:47.830 --> 00:08:51.280
we'll see some pretty important information, although, not a lot of

00:08:51.280 --> 00:08:55.500
data. We'll notice that our username likely has been sent to this

00:08:55.500 --> 00:08:58.060
panel, as well as likely the name of our PC.

00:08:59.040 --> 00:09:02.290
The response is also quite telling in that the panel is

00:09:02.290 --> 00:09:06.170
configured to provide a legitimate HTTP 404 not found.

00:09:06.430 --> 00:09:10.260
It also includes in the HTTP response body file not found.

00:09:10.640 --> 00:09:14.880
So this is meant to mislead the analyst in thinking that even

00:09:14.880 --> 00:09:16.870
though there was an infection in the environment,

00:09:16.880 --> 00:09:18.560
it wasn't able to actually check in.

00:09:19.040 --> 00:09:20.310
If we weren't sure about that,

00:09:20.310 --> 00:09:23.150
we could continue to analyze the additional check‑ins that we have.

00:09:23.540 --> 00:09:25.670
So let's collapse this and move on to the next one.

00:09:26.440 --> 00:09:29.220
This traffic is a bit more revealing, and while we can see

00:09:29.220 --> 00:09:31.270
patterns from our previous check‑in,

00:09:31.740 --> 00:09:35.250
we also see a lot more data that was sent back to that panel.

00:09:36.340 --> 00:09:39.560
Much like our emotet traffic, we can see a substantial amount

00:09:39.560 --> 00:09:41.600
of content now has left the environment,

00:09:41.910 --> 00:09:44.510
but it's in a form that we can't easily recognize.

00:09:45.040 --> 00:09:48.180
So while we can most certainly be suspicious that a more substantial

00:09:48.180 --> 00:09:50.360
amount of information has left from that host,

00:09:50.450 --> 00:09:52.150
we don't know exactly what it is.

00:09:52.940 --> 00:09:53.690
On occasion,

00:09:53.690 --> 00:09:56.580
researchers will publish information about how to decrypt the

00:09:56.580 --> 00:09:59.890
command and control traffic from certain malware families and

00:09:59.890 --> 00:10:02.680
that's always a next step that I would recommend looking to see

00:10:02.680 --> 00:10:04.100
if there is any published work,

00:10:04.110 --> 00:10:07.210
scripts, or other help in trying to identify what this

00:10:07.210 --> 00:10:09.860
traffic may be, but it's not always the case,

00:10:10.040 --> 00:10:14.360
and the only option we have is to create a hypothesis based off of our analysis.

00:10:16.340 --> 00:10:17.870
Alright, excellent work everyone.

00:10:17.880 --> 00:10:21.450
You now have a better understanding of how C2 traffic looks, ways in

00:10:21.450 --> 00:10:25.040
which we can leverage Arkime to analyze that, as well as we did a

00:10:25.040 --> 00:10:29.290
recap on how we can identify those payloads, executables, and extract

00:10:29.290 --> 00:10:30.560
those for additional analysis.

00:10:30.940 --> 00:10:33.160
We're now ready to move on to our next demonstration.
