WEBVTT

00:00:00.640 --> 00:00:03.920
So we've talked about what we can do to prevent a business email

00:00:03.920 --> 00:00:05.900
compromise or some of the things that we can do,

00:00:05.900 --> 00:00:10.070
but there are companies that are probably being affected by this right now.

00:00:10.080 --> 00:00:13.450
So let's talk a little bit about business email compromise detection,

00:00:13.450 --> 00:00:16.490
what we can do in order to detect an active compromise.

00:00:16.500 --> 00:00:17.650
But before we do that, Aaron,

00:00:17.650 --> 00:00:19.330
do you want to talk about what we've done here to

00:00:19.330 --> 00:00:20.560
kind of demonstrate some of this?

00:00:20.540 --> 00:00:21.550
‑Yeah, absolutely.

00:00:21.550 --> 00:00:23.220
So let me let me talk for a second about it then we'll

00:00:23.220 --> 00:00:24.800
probably just jump in and I'll show everybody.

00:00:24.800 --> 00:00:27.910
But I think the important thing is that we wanted to

00:00:27.910 --> 00:00:29.390
have something to show everyone.

00:00:29.400 --> 00:00:30.340
But at the same time,

00:00:30.340 --> 00:00:33.220
you can imagine having an entire in Office 365 enterprise that

00:00:33.220 --> 00:00:36.480
looks realistic is probably pretty difficult. So there are options

00:00:36.480 --> 00:00:39.560
to be able to do it for a free trial, and that's what we used.

00:00:39.560 --> 00:00:43.930
We built a free trial environment on an E5 premium license for Office 365,

00:00:43.930 --> 00:00:47.350
and we also have the Active Directory Premium 2 license,

00:00:47.440 --> 00:00:50.190
and that's part of kind of the free trial ecosystem you can do

00:00:50.190 --> 00:00:52.070
for 30 days to set it up and practice it.

00:00:52.070 --> 00:00:54.530
So you absolutely can do that at home. If you want it yourself,

00:00:54.530 --> 00:00:56.860
we'll include that link and some of the resources.

00:00:56.860 --> 00:00:57.970
I think that'd be a good idea.

00:00:58.640 --> 00:01:00.260
So if you want to set this up and test it,

00:01:00.260 --> 00:01:02.950
you can make users and just let me show what it looks

00:01:02.950 --> 00:01:04.390
like real quick when we do that.

00:01:04.390 --> 00:01:06.840
When you first make this environment,

00:01:06.840 --> 00:01:09.580
you're going to use another Outlook account and then

00:01:09.580 --> 00:01:10.840
you have to make an admin account.

00:01:10.840 --> 00:01:13.890
So it's very much tied to Active Directory and Azure,

00:01:13.890 --> 00:01:15.120
just like everything else is.

00:01:15.120 --> 00:01:18.350
So Office 365 still has that back end for authentication.

00:01:18.640 --> 00:01:22.600
And when you get in here, this is my landing page for arosenmund@,

00:01:22.610 --> 00:01:25.200
our domain that we created for Globomantics,

00:01:25.200 --> 00:01:26.470
our fake company.

00:01:26.440 --> 00:01:28.710
What you want to do is go to the admin portal,

00:01:28.720 --> 00:01:30.190
and when that loads up,

00:01:30.200 --> 00:01:34.550
you get a bunch of different things that you can use to set up security.

00:01:34.550 --> 00:01:37.360
One that we'll talk about, you see that it just went away.

00:01:37.360 --> 00:01:38.610
It's because it's already set up.

00:01:38.620 --> 00:01:41.520
So a little bit later, when we get into the end of this,

00:01:41.520 --> 00:01:44.460
I'm going to show some slides about different things I had to do as I built

00:01:44.460 --> 00:01:47.190
this that you're not going to be able to see right now.

00:01:47.200 --> 00:01:51.470
But it's it's checkboxes and turn this on and turn that on that allow,

00:01:51.470 --> 00:01:54.590
if you have the correct license, for you to enable these protections.

00:01:54.590 --> 00:01:55.770
They're not on by default,

00:01:55.770 --> 00:01:59.840
and I think that's a common thing we get with Microsoft stuff.

00:01:59.840 --> 00:02:02.130
Like, oh, yeah, you could defend yourself against this,

00:02:02.130 --> 00:02:04.170
but it's not on by default, so you've got to turn it on.

00:02:04.170 --> 00:02:05.920
That's something we have there as well.

00:02:05.930 --> 00:02:09.050
You see how little actual user activity we have.

00:02:09.060 --> 00:02:13.180
But this is a least one way to look at what users are logging in and out.

00:02:13.190 --> 00:02:15.640
I did want to look at this user management,

00:02:15.640 --> 00:02:17.170
so we can look at edit user,

00:02:17.640 --> 00:02:21.870
and I can show we do have about five or six users that we've created and

00:02:21.870 --> 00:02:24.980
sent some emails around just so there's a little bit of a realistic

00:02:24.980 --> 00:02:28.570
environment and logins that we can use an example.

00:02:28.570 --> 00:02:32.210
So that's really where we're starting from,

00:02:32.220 --> 00:02:35.900
and if we look at this Show all piece here,

00:02:35.900 --> 00:02:38.680
we can go and see that there's a security component,

00:02:38.680 --> 00:02:39.960
there's an Exchange component.

00:02:39.960 --> 00:02:43.390
There's admin panels for every single component of Office 365,

00:02:43.390 --> 00:02:45.400
and that's something important to know too.

00:02:45.400 --> 00:02:47.020
Before we jump into detections,

00:02:47.020 --> 00:02:49.260
I wanted to just show that real quick so everybody can see

00:02:49.260 --> 00:02:50.580
the environment that we're working with.

00:02:50.580 --> 00:02:53.600
And it's a real live Office 365 environment,

00:02:53.600 --> 00:02:55.230
a real boy, so to speak,

00:02:55.230 --> 00:02:59.120
and something we'll be able to‑‑‑if you go to it as a

00:02:59.120 --> 00:03:01.080
user in your enterprise environment,

00:03:01.080 --> 00:03:03.460
this GUI will look pretty much exactly the same.

00:03:03.840 --> 00:03:05.890
‑Yeah, and that's a great point too.

00:03:05.890 --> 00:03:07.610
You want to get familiar with this environment,

00:03:07.610 --> 00:03:07.810
too,

00:03:07.810 --> 00:03:11.980
because as we've seen in doing this over the last couple of weeks or

00:03:11.980 --> 00:03:14.980
so and in all the investigations that I've done,

00:03:14.980 --> 00:03:17.290
Microsoft likes to hide a lot of things,

00:03:17.290 --> 00:03:22.050
and so there's like 3 or 4 different interfaces into all the Azure

00:03:22.050 --> 00:03:25.240
and Microsoft 365 and Office 365 components,

00:03:25.250 --> 00:03:27.890
some of which show you some of the information and some of which don't.

00:03:27.890 --> 00:03:29.450
Ao absolutely get in there,

00:03:29.450 --> 00:03:31.770
get familiar with where these things are so you can

00:03:31.770 --> 00:03:33.820
jump  into it when you need to.

00:03:33.820 --> 00:03:37.410
So we we talked about the lifecycle of the business email compromise,

00:03:37.410 --> 00:03:41.400
that the initial attack is going to be through phishing.

00:03:41.410 --> 00:03:45.940
So what would you use in this to detect a successful

00:03:45.940 --> 00:03:47.730
phishing attack against one of your users?

00:03:47.740 --> 00:03:48.550
Yeah, perfect.

00:03:48.550 --> 00:03:51.500
And that was a bit of a learning curve for me with the enterprise environment,

00:03:51.500 --> 00:03:51.690
too.

00:03:51.690 --> 00:03:54.760
But what's interesting is, if you think about the logic of phishing,

00:03:54.760 --> 00:03:57.030
again, that's the component of it that we're all very used to.

00:03:57.030 --> 00:03:58.070
It's not different.

00:03:58.070 --> 00:04:01.620
What happens after your users are phished?

00:04:01.630 --> 00:04:04.370
They give their email accounts and their passwords out.

00:04:04.380 --> 00:04:06.740
And like you said, sometimes you've seen a 4‑second difference,

00:04:06.740 --> 00:04:10.730
and then that attacker then takes that email account and logs into the domain.

00:04:10.740 --> 00:04:13.740
Now, there's standard stuff we can use to try to detect that.

00:04:13.740 --> 00:04:16.100
Though it's a bit of a different environment in which we do it,

00:04:16.100 --> 00:04:17.620
it's the same idea.

00:04:17.620 --> 00:04:20.959
This user logged in over here, and 4 seconds later they logged in over here,

00:04:20.959 --> 00:04:21.829
and that's weird.

00:04:21.829 --> 00:04:23.450
So that's one of those,

00:04:23.450 --> 00:04:27.230
the geolocation or the geofencing or just kind of anomalous

00:04:27.230 --> 00:04:30.490
logins from different locations, either in the same country

00:04:30.490 --> 00:04:33.250
or in different countries, it's something that you can use.

00:04:33.250 --> 00:04:37.640
Now, I know that the ability to pop that alert comes in a couple different place.

00:04:37.640 --> 00:04:40.870
And as I‑‑‑feel free interrupt me, Tyler, as I look through this.

00:04:40.870 --> 00:04:45.240
You generated some traffic that allowed us to be able

00:04:45.240 --> 00:04:47.840
to detect that post compromise.

00:04:47.840 --> 00:04:50.720
So phishing's already occurred as we're coming into this environment,

00:04:50.720 --> 00:04:52.640
and we want to look at detections.

00:04:52.640 --> 00:04:57.480
So that initial event and the login from a bad actor has already happened.

00:04:57.490 --> 00:05:01.440
They've probably also set up some stuff that we'll look at it a little bit too.

00:05:01.450 --> 00:05:05.020
But we want to go ahead and look and see what can we

00:05:05.020 --> 00:05:07.080
do to detect it visually here.

00:05:07.080 --> 00:05:09.260
And we'll have some other stuff for some tooling to

00:05:09.260 --> 00:05:11.020
be able to do it too in a bit.

00:05:11.020 --> 00:05:13.880
But first place it makes sense to goes security.

00:05:13.880 --> 00:05:15.490
So want to look here in security.

00:05:15.490 --> 00:05:19.680
This isn't where we're going to find those additional login logs

00:05:19.680 --> 00:05:21.460
because it's through Azure Active Directory,

00:05:21.460 --> 00:05:22.090
actually.

00:05:22.090 --> 00:05:26.670
But, and this is the main point here is, I want to see what we don't see.

00:05:26.680 --> 00:05:30.450
I've already looked at this, obviously in prep before we got into this.

00:05:30.450 --> 00:05:32.470
We do see some alerts here.

00:05:32.470 --> 00:05:35.260
I don't know if you want to talk through what this alert probably is here.

00:05:35.340 --> 00:05:38.280
‑We'll definitely get into that in a little bit.

00:05:38.280 --> 00:05:39.420
‑We do see some alerts,

00:05:39.420 --> 00:05:42.370
but what we don't see is any alert that has anything to do with a

00:05:42.380 --> 00:05:46.170
successful login or that geolocation login change.

00:05:46.170 --> 00:05:49.160
I think that's that's kind of what I wanted to point out is,

00:05:49.160 --> 00:05:52.110
you can get in here and see that that's not there.

00:05:52.110 --> 00:05:53.660
We can get into threat management.

00:05:53.670 --> 00:05:56.530
A really good learning point, just kind of a gotcha here is,

00:05:56.530 --> 00:05:59.520
there was malware here because I threw malware through this ahead of time.

00:05:59.530 --> 00:06:02.290
It's not there anymore because it only goes back a week.

00:06:02.290 --> 00:06:03.990
And so I went back,

00:06:03.990 --> 00:06:05.670
I kind of struggled with that a little bit last night

00:06:05.670 --> 00:06:06.630
trying to make sure this worked.

00:06:06.630 --> 00:06:07.470
And sure enough,

00:06:07.470 --> 00:06:11.580
it only has that week of data that it will represent to you at any given time.

00:06:11.590 --> 00:06:14.130
And again, what's missing here is,

00:06:14.130 --> 00:06:18.990
there's no alert on odd logins or risky logins.

00:06:19.000 --> 00:06:19.450
Now,

00:06:19.740 --> 00:06:22.980
that phrase I used you can find somewhere else, but these are

00:06:22.980 --> 00:06:25.230
really the places that I would hope they'd pop up.

00:06:25.230 --> 00:06:26.530
It's kind of like the logical, oh,

00:06:26.530 --> 00:06:28.230
if I click Security and go to Threat management,

00:06:28.230 --> 00:06:29.460
maybe there's the threat there.

00:06:29.740 --> 00:06:30.610
It's not there.

00:06:30.620 --> 00:06:33.070
So let me get back out of this.

00:06:34.140 --> 00:06:40.250
I'm going to go back to this admin console so I can see the other locations.

00:06:41.240 --> 00:06:43.980
And like I said, this is running on Active Directory.

00:06:44.460 --> 00:06:48.500
So when we look inside Active Directory as the admin panel instead,

00:06:48.510 --> 00:06:50.380
we get a bunch of other stuff.

00:06:50.380 --> 00:06:53.660
And, again, no alerts here, but you can see kind of sign‑ins over time.

00:06:53.660 --> 00:06:54.300
We're getting closer.

00:06:54.300 --> 00:06:56.530
This is us getting warmer on where we're trying to

00:06:56.540 --> 00:06:58.130
actually look for what we want.

00:06:58.130 --> 00:07:01.770
But other than that, there's no specific security stuff straight on this portal.

00:07:02.140 --> 00:07:03.130
You can, by the way,

00:07:03.130 --> 00:07:06.020
just click on this and it takes you straight to the place I'm about to take you,

00:07:06.040 --> 00:07:07.610
but this card's not always up.

00:07:07.620 --> 00:07:10.130
So you can add cards to and from this location.

00:07:10.390 --> 00:07:11.630
I kind of figured that piece out.

00:07:11.630 --> 00:07:12.890
But on the left here,

00:07:12.890 --> 00:07:15.220
and this is what Tyler showed me the other day, if you go

00:07:15.220 --> 00:07:20.550
here and look down under Monitoring, you can see Sign‑ins and Audit logs.

00:07:20.550 --> 00:07:22.340
Audit logs, I'll let, probably,

00:07:22.340 --> 00:07:24.960
Tyler talk about that a little bit after we go through sign‑ins.

00:07:24.960 --> 00:07:26.160
But audit logs are where we can see some of the

00:07:26.160 --> 00:07:27.760
different activity that's been taken.

00:07:27.840 --> 00:07:30.480
Sign‑ins is what we're looking for.

00:07:30.490 --> 00:07:31.930
So we click Sign‑ins.

00:07:31.940 --> 00:07:35.830
That card is the representation of these sign‑ins that we see here.

00:07:35.840 --> 00:07:39.560
‑Yeah, and while that pulls up, we're basically,

00:07:39.560 --> 00:07:40.230
once that comes in,

00:07:40.230 --> 00:07:42.730
we're going to be looking for places that the user

00:07:42.730 --> 00:07:46.950
wouldn't normally log in from, so like you mentioned,

00:07:47.040 --> 00:07:48.750
different geographic locations.

00:07:48.750 --> 00:07:53.870
So if I'm based in the US, I shouldn't see logins from around the world.

00:07:54.240 --> 00:07:55.410
‑Yeah, absolutely.

00:07:55.420 --> 00:07:58.560
And even, it's probably also okay,

00:07:58.570 --> 00:08:00.420
and and we'll get into this in a little bit when we

00:08:00.420 --> 00:08:01.870
talk more about specific detections.

00:08:01.870 --> 00:08:06.410
This'll kind of go from more, oh, they logged in from different locations,

00:08:06.410 --> 00:08:09.100
to more of the behavioral science of it.

00:08:09.100 --> 00:08:14.290
But it's even okay if you log in from different places in the world if you

00:08:14.290 --> 00:08:16.780
have customers that are in different places in the world.

00:08:16.780 --> 00:08:21.730
What's not okay is if they log in in one place and then travel

00:08:21.730 --> 00:08:24.280
faster than the speed of light to another place.

00:08:24.610 --> 00:08:25.970
So they're not only breaking physics,

00:08:25.970 --> 00:08:29.260
they're also breaking the fact that it could actually be them.

00:08:29.270 --> 00:08:30.140
‑Exactly.

00:08:30.140 --> 00:08:32.429
Here is where we can see all these logs.

00:08:32.429 --> 00:08:35.150
So I just know them because we've already communicated this,

00:08:35.150 --> 00:08:38.679
but the impossible login that were concerned about has happened previous.

00:08:38.679 --> 00:08:43.659
‑Yeah, so if you go up to the top and you filter by user,

00:08:44.039 --> 00:08:48.410
if you add a filter and, let's let's look at the user,

00:08:48.410 --> 00:08:49.850
I think it's Kim.

00:08:49.860 --> 00:08:54.010
Kim is the one who in our situation here has gotten compromised,

00:08:54.010 --> 00:08:55.470
or at least one of the users.

00:08:55.480 --> 00:08:56.650
‑Here's one way of doing it.

00:08:56.650 --> 00:08:59.240
You can also, and want to talk about it first,

00:08:59.240 --> 00:09:01.160
we're going to kind of like easy button it for you.

00:09:01.170 --> 00:09:02.200
We know it was Kim.

00:09:02.210 --> 00:09:03.410
Here's Kim doing it.

00:09:03.410 --> 00:09:07.040
On an enterprise, obviously you have all of the users logging in,

00:09:07.040 --> 00:09:08.720
and you'll want to pull all that information,

00:09:08.720 --> 00:09:10.340
so we'll show that in a bit too.

00:09:10.340 --> 00:09:13.780
‑So in our case, Kim normally logs in from New York City.

00:09:13.790 --> 00:09:18.770
So the ones that we're seeing here are definitely something that's normal.

00:09:18.770 --> 00:09:21.810
And then all of a sudden, we see her logging in from Vietnam.

00:09:21.820 --> 00:09:23.640
That's a little bit odd.

00:09:23.640 --> 00:09:27.810
And if you look at the date and time, just like what you were talking about,

00:09:27.820 --> 00:09:30.640
there is really no way that she could physically travel from

00:09:30.640 --> 00:09:33.490
New York City to Vietnam in 7 minutes.

00:09:33.500 --> 00:09:36.680
If she does, I want that plane or car.

00:09:36.690 --> 00:09:40.560
But in this case, this is definitely,

00:09:40.570 --> 00:09:43.390
should be hanging high on the red flag meter.

00:09:43.400 --> 00:09:44.480
‑Yeah, absolutely.

00:09:44.480 --> 00:09:47.110
So this is where, unless this is specifically set up,

00:09:47.110 --> 00:09:49.530
that threat's not going to pop up anywhere for you.

00:09:49.530 --> 00:09:52.370
And again, even if it is specifically set up,

00:09:52.370 --> 00:09:54.690
we have the E5 license, and a lot of customers don't.

00:09:54.700 --> 00:09:55.290
So yeah,

00:09:55.290 --> 00:09:59.150
I can for sure go to advanced threat protection and configure

00:09:59.240 --> 00:10:01.750
the rule to make sure that this pops out.

00:10:01.750 --> 00:10:04.600
It may be now, the fact that we didn't see it,

00:10:04.600 --> 00:10:06.250
may be that it's actually already enabled.

00:10:06.250 --> 00:10:09.050
It just has to happen four or five times or something.

00:10:09.050 --> 00:10:12.900
Probably some rule like that, that before it shows up as an alert,

00:10:12.900 --> 00:10:14.150
just to get rid of your noise.

00:10:14.150 --> 00:10:16.530
If you think about an organization that has 300,000 employees,

00:10:16.530 --> 00:10:18.240
that it's going to get kind of noisy.

00:10:18.240 --> 00:10:22.240
‑And so when I'm going in and I'm doing in a BEC investigation,

00:10:22.240 --> 00:10:24.000
this is the first place that I look.

00:10:24.010 --> 00:10:26.870
I want to see who's logging in and where are they logging in from.

00:10:26.870 --> 00:10:29.280
Something like this is going to pop out immediately.

00:10:29.290 --> 00:10:32.040
And this is absolutely something that you can do,

00:10:32.040 --> 00:10:36.710
or anybody who has Office 365 or Azure administrative privileges,

00:10:36.710 --> 00:10:39.270
they can look to see where their users are logging and from.

00:10:39.740 --> 00:10:44.750
The thing to keep in mind, attackers, again, these attackers are smart.

00:10:44.760 --> 00:10:46.460
They know where you're based out of.

00:10:46.470 --> 00:10:49.550
So we have seen attackers that will do things like,

00:10:49.550 --> 00:10:51.990
they'll initially log in from a foreign country,

00:10:51.990 --> 00:10:54.380
and then once they see that that login works,

00:10:54.390 --> 00:10:59.600
they immediately switch and go through probably Tor or a third‑party VPN or

00:10:59.600 --> 00:11:03.970
something like that to come from another location in the US.

00:11:04.240 --> 00:11:07.680
But you still need to go back to your user at that point and say,

00:11:07.680 --> 00:11:08.090
all right,

00:11:08.100 --> 00:11:12.830
here is a list of all the places that you logged in from into your email.

00:11:12.840 --> 00:11:14.440
Which of these are correct?

00:11:14.440 --> 00:11:17.030
Which of these areas have you been around and have you not?

00:11:17.040 --> 00:11:21.070
And so Kim here, she logs in from New York.

00:11:21.140 --> 00:11:21.490
Well,

00:11:21.490 --> 00:11:23.470
the attacker could switch and start logging in from a

00:11:23.470 --> 00:11:25.550
VPN whose endpoint is in Pennsylvania.

00:11:25.940 --> 00:11:31.490
So at that point, those Pennsylvanian logins tend to be suspicious as well.

00:11:31.490 --> 00:11:33.470
The one thing that I'll throw out too is,

00:11:34.240 --> 00:11:36.570
you have to do a little bit more research too.

00:11:36.580 --> 00:11:40.720
GeoIP locations, like we're seeing here, is not an exact science.

00:11:40.730 --> 00:11:43.670
So just because something,

00:11:43.680 --> 00:11:46.730
just because Microsoft is telling us that this IP address is in New

00:11:46.730 --> 00:11:49.780
York doesn't necessarily mean it actually is.

00:11:49.780 --> 00:11:52.990
Run it through some other geoIP services just to verify.

00:11:53.000 --> 00:12:00.230
See who the ISP is because if it's a cell phone network it's also possible

00:12:00.230 --> 00:12:03.610
that Kim jumped onto her cell phone to check her email,

00:12:03.610 --> 00:12:06.090
and for whatever reason the cell phone company was routing

00:12:06.090 --> 00:12:07.760
it through Pennsylvania at that time.

00:12:07.740 --> 00:12:10.050
So keep those things in mind as well.

00:12:10.640 --> 00:12:12.130
That brings up another good point,

00:12:12.130 --> 00:12:13.820
especially as we have a lot of people that are more

00:12:13.820 --> 00:12:17.590
remote and VPNs are becoming a thing, where they try extend the boundary saying,

00:12:17.590 --> 00:12:20.770
hey, you can only do business work while you're on a VPN.

00:12:20.770 --> 00:12:22.900
I know there's a ton of companies that are doing that now.

00:12:22.910 --> 00:12:25.530
What's interesting is the VPN will also change this.

00:12:25.530 --> 00:12:29.070
So what if you are traveling somewhere else and,

00:12:29.080 --> 00:12:31.520
I guess, imagine the situation as an administrator for this.

00:12:31.520 --> 00:12:35.120
You see a log in from New York, and then you see it from Pennsylvania,

00:12:35.120 --> 00:12:38.150
so your company's supposed to be in Pennsylvania.

00:12:38.150 --> 00:12:43.210
Well, clearly they logged in, forgot they were supposed to go through the VPN,

00:12:43.220 --> 00:12:45.720
logged out, and then logged back in through the VPN.

00:12:45.720 --> 00:12:50.050
So even if that's a policy thing, that can be used as a policy enforcement for,

00:12:50.050 --> 00:12:52.160
I see you operating not on our VPN.

00:12:52.840 --> 00:12:54.340
That's probably something you shouldn't do,

00:12:54.340 --> 00:12:56.790
which almost makes this more monolithic.

00:12:56.790 --> 00:12:59.620
If everything's coming from the exact same location,

00:12:59.620 --> 00:13:01.270
that means everybody is in your VPN.

00:13:01.280 --> 00:13:04.620
I can now alert from anywhere else means they're not using the VPN,

00:13:04.630 --> 00:13:06.360
which is an interesting thing I didn't think of

00:13:06.360 --> 00:13:07.660
until we just talked about it now.

00:13:08.040 --> 00:13:10.780
‑Yeah, and it really goes back to‑‑‑also,

00:13:10.790 --> 00:13:13.800
you need to talk to the use when you're doing these types of investigations.

00:13:13.800 --> 00:13:15.550
You need to have those conversations.

00:13:15.550 --> 00:13:17.850
And I know we're computer people.

00:13:17.860 --> 00:13:21.490
We don't like to talk to other people, but in this type of case,

00:13:21.490 --> 00:13:23.220
we absolutely need to do that.

00:13:23.220 --> 00:13:25.470
Because if I was working this investigation,

00:13:25.640 --> 00:13:27.560
I would basically pull out all these IP addresses,

00:13:27.560 --> 00:13:29.560
put them in a spreadsheet and send them to Kim and say,

00:13:29.560 --> 00:13:33.020
hey, obviously, Vietnam, you weren't in there.

00:13:33.020 --> 00:13:35.800
But were you in New York?

00:13:35.800 --> 00:13:39.610
I would try to get a better geoIP location as to just New York, New York.

00:13:39.610 --> 00:13:42.250
I'd want to know a little bit more specific than that,

00:13:42.250 --> 00:13:43.970
and there are tools to do that.

00:13:43.970 --> 00:13:47.180
I would ask her, were you around this area at this time?

00:13:47.180 --> 00:13:49.920
And I've done that investigation, and I've had people say,

00:13:49.920 --> 00:13:53.180
oh, yeah, my boyfriend's house is in that city or right next to it.

00:13:53.180 --> 00:13:55.370
So she had, in that case,

00:13:55.370 --> 00:13:57.950
she had just gone to her boyfriend's house and checked her email there.

00:13:57.960 --> 00:14:00.030
So you can mark that off as legitimate.

00:14:00.030 --> 00:14:04.820
And slowly you're starting to whittle down where the attacker logged in from.

00:14:04.830 --> 00:14:08.500
And the reason that's important is because not only are you

00:14:08.500 --> 00:14:13.090
showing which authentications were malicious or related to the

00:14:13.090 --> 00:14:15.680
attacker; you're also now getting the time frame from which they

00:14:15.680 --> 00:14:19.600
were actively accessing the email, which can be important as well.

00:14:19.610 --> 00:14:21.150
‑Yeah so that ties to a bunch of stuff,

00:14:21.150 --> 00:14:23.350
especially once we get into the response here in a bit.

00:14:23.900 --> 00:14:28.510
This is a, if this becomes interesting, this is the IP that you want to record,

00:14:28.510 --> 00:14:31.130
and then we can use that as part of the rest of the response.

00:14:31.130 --> 00:14:33.080
But also, like you said about the time,

00:14:33.090 --> 00:14:36.000
that then goes all the way back to what did they have access to?

00:14:36.010 --> 00:14:37.540
Well, that really depends.

00:14:37.540 --> 00:14:39.090
If we don't have the fidelity,

00:14:39.090 --> 00:14:41.610
then they had access to everything that this user had

00:14:41.610 --> 00:14:43.200
access to during this time period,

00:14:43.200 --> 00:14:45.930
so time period becomes really important for that as well.

00:14:45.940 --> 00:14:48.150
‑Good point ‑Exactly.

00:14:48.160 --> 00:14:52.640
And you can show, if you export these logs or if you were to export these logs,

00:14:52.650 --> 00:14:54.550
you actually get a lot more information than what

00:14:54.550 --> 00:14:55.870
we're seeing on the screen here.

00:14:55.870 --> 00:15:01.320
You get things like user agents, as well as for the program that was logging in,

00:15:01.330 --> 00:15:04.690
and sometimes you can use those to find those malicious logins as well.

00:15:04.690 --> 00:15:09.720
So, for example, if Kim always used Chrome on a Windows PC,

00:15:09.720 --> 00:15:14.790
and then all of a sudden you start seeing user agents for Firefox on a Mac,

00:15:14.800 --> 00:15:17.920
then that's another one of those indicators that you can

00:15:17.920 --> 00:15:21.060
use to kind of pull out the malicious, or at least suspicious logons.

00:15:21.840 --> 00:15:23.360
‑Yeah, that's a really good point,

00:15:23.360 --> 00:15:25.740
and I'm glad that you brought up exporting these logs,

00:15:25.740 --> 00:15:28.300
because, so just like last, I don't know if you remember last time,

00:15:28.300 --> 00:15:30.590
so people who are watching these back to back it'll be a

00:15:30.590 --> 00:15:31.700
little easier for them to figure it out.

00:15:31.700 --> 00:15:34.320
But just like last time, I'm always trying to impress you.

00:15:34.320 --> 00:15:35.570
I don't know what the deal is, but I'm like,

00:15:35.570 --> 00:15:38.530
all right , I'm going to go meet Tyler, I'm going to bring something out.

00:15:38.530 --> 00:15:42.770
But you have this poker face, and I'm like, oh, I thought it was cool.

00:15:42.770 --> 00:15:44.750
We'll see whether you think this is cool or not.

00:15:44.760 --> 00:15:45.660
So we'll see.

00:15:45.640 --> 00:15:47.060
What we didn't have is an alert.

00:15:47.060 --> 00:15:48.830
And even with the E5 premium license,

00:15:48.830 --> 00:15:50.660
I'm sure there's some setup I'm missing or whatever.

00:15:50.660 --> 00:15:53.820
But if if you don't have an E5 premium license like many don't,

00:15:53.830 --> 00:15:55.220
you at least do have this Azure,

00:15:55.220 --> 00:15:59.010
you have some sort of premium version of Azure that will give you this log in.

00:15:59.020 --> 00:15:59.310
‑Yeah,

00:15:59.310 --> 00:16:01.720
and we'll talk about the license levels and what you can

00:16:01.720 --> 00:16:04.110
and can't get with those later on.

00:16:04.110 --> 00:16:07.460
But with, at least in my experience so far,

00:16:07.460 --> 00:16:08.660
and from what I can tell,

00:16:08.670 --> 00:16:12.090
all license levels will at least give you these sign‑ins.

00:16:12.090 --> 00:16:14.820
That will always be there,

00:16:14.820 --> 00:16:17.760
so you can at least go in and determine this information.

00:16:18.240 --> 00:16:18.910
‑Awesome.

00:16:18.920 --> 00:16:21.560
Well, so I looked at this knowing that and said,

00:16:21.570 --> 00:16:23.730
hey, what this really looks like, I don't know it's Kim.

00:16:23.730 --> 00:16:26.270
When you when you did it, I don't know whether it's Kim or not.

00:16:26.270 --> 00:16:27.990
I'm just looking at all of the logs.

00:16:27.990 --> 00:16:32.720
And this is only five users that two people logged in as,

00:16:32.720 --> 00:16:34.380
and that's that's a ton of logs.

00:16:34.380 --> 00:16:38.470
And so what's interesting is if you have 100,000 people that are logging in,

00:16:38.470 --> 00:16:40.640
that's even more stuff to worry about.

00:16:40.640 --> 00:16:44.110
There's no way you're going to scroll through and say, oh, that's weird.

00:16:44.120 --> 00:16:45.520
They've logged in here and then here.

00:16:45.520 --> 00:16:48.970
If you found that, that'd be pure luck.

00:16:49.440 --> 00:16:51.590
I'm sure there's a ton of other tools to do this,

00:16:51.590 --> 00:16:54.080
but I always default back to PowerShell,

00:16:54.090 --> 00:16:56.140
and I did notice that there's a way, like you said,

00:16:56.140 --> 00:16:57.400
to export this information.

00:16:57.400 --> 00:17:00.490
So up here in Download, I just picked Download.

00:17:00.490 --> 00:17:02.160
Now, something I did find,

00:17:02.160 --> 00:17:04.230
and maybe we'll make a note of this somewhere else too,

00:17:04.230 --> 00:17:11.010
is that Azure AD preview module for PowerShell actually has a function that is,

00:17:11.020 --> 00:17:13.869
Get‑AzureAuditADSignIinLogs.

00:17:13.869 --> 00:17:15.970
It's not quite working yet,

00:17:15.970 --> 00:17:19.160
and last night some of Azure wasn't working very well either.

00:17:19.170 --> 00:17:20.869
And so that didn't happen.

00:17:20.880 --> 00:17:23.599
But either way, the stopgap is, or the idea is,

00:17:23.599 --> 00:17:27.060
you can download these things periodically and then run something to check it.

00:17:27.060 --> 00:17:31.330
So I downloaded the CSV within the window that I knew we had logins,

00:17:31.330 --> 00:17:33.690
and then let's see if I can switch this screen.

00:17:33.690 --> 00:17:34.160
Good.

00:17:34.170 --> 00:17:35.950
And then I wrote this PowerShell script.

00:17:35.950 --> 00:17:38.770
And you talked about it having more information,

00:17:38.770 --> 00:17:42.990
so I wrote this component to just kind of pull it in and then sort that object.

00:17:42.990 --> 00:17:46.990
So now there's going to be people watching that are really,

00:17:46.990 --> 00:17:51.270
really good programmers and devs and way better at this than I am.

00:17:51.270 --> 00:17:54.370
But I default back to this just to kind of whip something together.

00:17:54.440 --> 00:17:58.780
Part of the point of me doing this when I do it is that I woke up this morning,

00:17:58.780 --> 00:18:02.420
felt like I wanted to do it, and had it done in about 30 minutes.

00:18:02.420 --> 00:18:05.610
And the fact is that if I can do that in 30 minutes,

00:18:05.610 --> 00:18:08.900
if you take some effort with your weeklong job,

00:18:08.900 --> 00:18:11.780
you can start creating detections that don't require

00:18:11.780 --> 00:18:13.050
you to have some tool to do so.

00:18:13.060 --> 00:18:17.180
So that's part of my soapbox for why I do this sometimes too.

00:18:17.180 --> 00:18:20.540
Anyway, so the point here is that we pull that information in.

00:18:20.540 --> 00:18:23.350
So let me see if I can granularly run this.

00:18:25.040 --> 00:18:26.080
Yeah, so that runs.

00:18:26.080 --> 00:18:31.410
And then I want, like you said, let's look at what those sign‑ins give us.

00:18:31.420 --> 00:18:33.320
And it's going to give us all kinds of stuff.

00:18:33.330 --> 00:18:34.610
Oh, I had already sorted that.

00:18:34.620 --> 00:18:36.060
Let's look at just sign‑ins.

00:18:37.640 --> 00:18:38.900
Signins, there we go.

00:18:38.910 --> 00:18:43.900
Okay, so a ton of stuff, but I wanted to kind of point out what you had said is,

00:18:43.910 --> 00:18:46.880
here there's much more than what we saw in the logs originally.

00:18:46.890 --> 00:18:50.590
And then there's the operating system, as well as the browser.

00:18:50.590 --> 00:18:54.020
And so that's exactly what you were talking about before.

00:18:54.020 --> 00:18:55.700
I just wanted to point that out for everybody.

00:18:55.710 --> 00:18:57.350
‑Yeah, and remember too,

00:18:57.350 --> 00:18:59.810
I think people should keep in mind that this is the user agent

00:18:59.810 --> 00:19:01.970
string that's being sent by the attacker,

00:19:01.980 --> 00:19:04.220
so that can easily be spoofed.

00:19:04.230 --> 00:19:05.740
That can easily be changed.

00:19:05.740 --> 00:19:06.540
However,

00:19:06.550 --> 00:19:11.390
the likelihood of the attacker actually figuring out the exact user

00:19:11.390 --> 00:19:14.450
agent string that the user is using is pretty low.

00:19:14.460 --> 00:19:19.530
There's a low probability of that unless they have compromised the user system,

00:19:19.530 --> 00:19:21.070
which does happen.

00:19:21.070 --> 00:19:23.560
It's rare, but it does happen.

00:19:23.560 --> 00:19:28.090
But I would say 99% of the time user agent strings in these

00:19:28.090 --> 00:19:29.670
attacks so far have not been spoofed.

00:19:29.670 --> 00:19:32.350
Or if they are, they're at least different enough that you can tell.

00:19:33.140 --> 00:19:33.930
‑Yeah, absolutely.

00:19:33.930 --> 00:19:35.110
And again, we're talking about,

00:19:35.110 --> 00:19:38.840
and this is something as we get more and more into detections,

00:19:38.840 --> 00:19:41.460
the first step of detection is, oh,

00:19:41.460 --> 00:19:44.730
it's pretty suspicious that we have logins happening really close to each other.

00:19:44.730 --> 00:19:49.120
Now it's triple suspicious because that happened and it's different user agents.

00:19:49.120 --> 00:19:52.890
And you just kind of keep narrowing down the probability

00:19:52.890 --> 00:19:54.490
that this is something actually malicious.

00:19:54.500 --> 00:19:57.540
So each one of those things is just a good indicator.

00:19:57.540 --> 00:20:02.660
So, speaking about that, what I did want to do is be able to look at something,

00:20:02.670 --> 00:20:04.740
and we don't have to go through every piece of this,

00:20:04.740 --> 00:20:06.440
but I basically split out the city, state,

00:20:06.440 --> 00:20:08.370
and country from that location.

00:20:08.380 --> 00:20:10.360
And then I said, hey, if you're traveling,

00:20:10.360 --> 00:20:13.560
I just did state, and I wanted to show the example for just state.

00:20:13.570 --> 00:20:14.420
I just did state.

00:20:14.420 --> 00:20:17.460
If you change states within 30 minutes of your last

00:20:17.460 --> 00:20:18.860
login and it does it by user.

00:20:18.860 --> 00:20:21.960
So it looks at every user and then sorts all their logins by the date and

00:20:21.960 --> 00:20:25.000
then loads that last login and then checks the next one.

00:20:25.010 --> 00:20:26.560
That's essentially how this is working.

00:20:26.560 --> 00:20:28.850
And then it says if the difference between those times is 30

00:20:28.850 --> 00:20:31.060
minutes or less and the state is different,

00:20:31.060 --> 00:20:32.290
that's an alert.

00:20:32.290 --> 00:20:34.390
So that that's what this is doing.

00:20:34.400 --> 00:20:37.970
Imagine you can do that for country, you can can do it for state,

00:20:37.970 --> 00:20:39.070
you can do it for city.

00:20:39.080 --> 00:20:41.120
And you can just change, right here you can just change,

00:20:41.120 --> 00:20:45.720
oh well, if they traveled and it's less than 2 days or it's less than whatever,

00:20:45.720 --> 00:20:47.860
you can change the amount of time that it's reasonable

00:20:47.860 --> 00:20:50.650
for someone to travel between cities, states,

00:20:50.650 --> 00:20:51.520
and countries.

00:20:51.520 --> 00:20:52.350
Now,

00:20:52.350 --> 00:20:56.940
this is obviously not as good as‑‑‑it took the geoIP and then did

00:20:56.940 --> 00:20:59.740
the Google API to figure out what the distance between them was and

00:20:59.740 --> 00:21:03.880
then calculated the time that it could be and then checked it

00:21:03.880 --> 00:21:06.550
against the time it would actually take to travel at fastest speed

00:21:06.550 --> 00:21:07.760
of a plane or something.

00:21:07.760 --> 00:21:09.100
That is doable.

00:21:09.100 --> 00:21:11.620
It's something that you can continue to develop,

00:21:11.620 --> 00:21:14.050
but this also kind of got us where we needed to be.

00:21:14.440 --> 00:21:18.260
So if I run this whole thing now, let me just run it all,

00:21:18.260 --> 00:21:22.020
it'll probably totally not work because it worked every other time,

00:21:22.020 --> 00:21:23.870
because that's how it always goes, but we'll see.

00:21:23.880 --> 00:21:24.640
There we go.

00:21:24.650 --> 00:21:25.340
It worked fine.

00:21:25.350 --> 00:21:27.070
So when we run through this,

00:21:27.070 --> 00:21:30.820
I always give myself more verbose stuff than I need when I do outputs.

00:21:30.820 --> 00:21:32.340
But it says, hey, it's the same location,

00:21:32.340 --> 00:21:35.160
we don't need to worry about this, and it doesn't for every user.

00:21:35.340 --> 00:21:38.410
And then look at that. We can see Kimberly gets alerted

00:21:38.420 --> 00:21:40.380
because she's been doing some impossible travel,

00:21:40.390 --> 00:21:41.950
according to her last logins.

00:21:41.960 --> 00:21:44.520
So this is something, we'll provide this in the notes.

00:21:44.520 --> 00:21:46.900
This is something you can use whether or not you

00:21:46.900 --> 00:21:48.170
have advanced threat protection.

00:21:48.170 --> 00:21:49.930
You can pull these logs down and sort through them,

00:21:49.930 --> 00:21:51.890
and you can set this up to happen every day,

00:21:51.900 --> 00:21:53.230
and you can tune it to your environment.

00:21:53.240 --> 00:21:54.310
So there you go.

00:21:54.310 --> 00:21:56.090
That's my surprise to you.

00:21:56.100 --> 00:21:57.390
‑Yeah, that is very cool.

00:21:57.400 --> 00:21:59.650
Yeah, and I think that works great.

00:21:59.660 --> 00:22:03.440
And that's good to look at as well,

00:22:03.450 --> 00:22:06.870
because you're using PowerShell to kind of sort all

00:22:06.870 --> 00:22:09.370
these logs for us and and pull that out.

00:22:09.370 --> 00:22:10.970
In my experience,

00:22:10.980 --> 00:22:15.170
if one user is compromised in a business email compromise attack,

00:22:15.180 --> 00:22:16.290
there's another user,

00:22:16.290 --> 00:22:19.450
or there are multiple other users that have been compromised as well.

00:22:19.450 --> 00:22:23.520
And the attacker may have just logged in as them once and are saving those

00:22:23.520 --> 00:22:28.120
in case their access to the current one gets taken away.

00:22:28.120 --> 00:22:30.210
It's kind of like their secondary backdoor,

00:22:30.210 --> 00:22:33.560
their sleeper backdoor that they're going to use later on if they need to.

00:22:34.040 --> 00:22:34.880
‑Yeah, absolutely.

00:22:34.880 --> 00:22:35.850
That makes sense.

00:22:35.850 --> 00:22:38.810
And I think you have some pretty cool stuff to show about how

00:22:38.810 --> 00:22:40.870
to track down what else they have access to.

00:22:40.870 --> 00:22:43.100
Sometimes I see that stuff gets missed a lot is,

00:22:43.100 --> 00:22:45.540
we detected the one thing, it happened, let's do our incident response.

00:22:45.540 --> 00:22:46.780
And we're like, oh, no, no.

00:22:46.790 --> 00:22:50.030
You now go find out all the other stuff they had access to.

00:22:50.040 --> 00:22:51.270
‑Yah, absolutely.

00:22:51.280 --> 00:22:54.230
If we go back and start thinking about the way that

00:22:54.230 --> 00:22:57.790
business email compromises work, one of things that we mentioned that they do is,

00:22:57.790 --> 00:22:59.640
once the attackers get into the account,

00:22:59.650 --> 00:23:03.740
they are going to set up inbox forwarding rules to send emails out

00:23:03.740 --> 00:23:07.250
to themselves so they don't have to sit in the email all the time

00:23:07.250 --> 00:23:08.560
waiting for those emails to come in.

00:23:08.560 --> 00:23:11.680
They can just kind of sit there and wait for the emails to come to them.

00:23:11.690 --> 00:23:13.800
They don't need to be active with that.

00:23:13.800 --> 00:23:17.610
And there are a couple ways that you can go and find this information out.

00:23:17.610 --> 00:23:22.360
So right now I'm in the security and compliance portion of Office 365.

00:23:22.370 --> 00:23:26.750
If you want to access that directly, you can just go to protection.office.com,

00:23:26.760 --> 00:23:28.160
and it will show you this.

00:23:28.170 --> 00:23:32.070
You jumped into this when you were in the admin portion by clicking on security.

00:23:32.070 --> 00:23:34.070
So there are multiple ways to get into this.

00:23:34.070 --> 00:23:36.780
So the first thing that we can do is,

00:23:36.740 --> 00:23:39.410
Microsoft obviously is seeing a lot of this,

00:23:39.410 --> 00:23:42.810
and so they've started to generate alerts because of

00:23:42.810 --> 00:23:44.860
the forwarding rules being created.

00:23:44.860 --> 00:23:49.960
And we can see here, if we go into the alerts and click on them,

00:23:49.960 --> 00:23:53.430
we can see that there has been an alert created regarding the

00:23:53.440 --> 00:23:55.680
creation of a forwarding or redirect rule.

00:23:56.940 --> 00:23:59.590
And if we start looking into this, what it is,

00:23:59.590 --> 00:24:02.250
we can see that the alert was triggered,

00:24:02.250 --> 00:24:07.130
which means that email was forwarded out for our username klogan,

00:24:07.130 --> 00:24:07.970
Kim.

00:24:07.970 --> 00:24:12.060
So this is giving us an alert that something has happened

00:24:12.060 --> 00:24:15.920
that a suspicious forwarding rule was put into place, or

00:24:15.920 --> 00:24:19.450
created, in this user's email account.

00:24:19.460 --> 00:24:21.670
It could be legitimate, depending on your policy.

00:24:21.670 --> 00:24:25.460
And the interesting thing that we found out when we were setting all this up is,

00:24:25.470 --> 00:24:28.810
by default with new Office 365 installations,

00:24:28.820 --> 00:24:32.040
external email forwarding is actually turned off by default.

00:24:32.050 --> 00:24:36.560
You have to either go in and allow it per user or allow it globally.

00:24:36.640 --> 00:24:38.670
So this is something that's going to be turned off.

00:24:38.670 --> 00:24:43.880
So chances are, though, somebody has gone in and turned this on for most users.

00:24:43.890 --> 00:24:48.120
But this is one way that you can kind of detect this.

00:24:48.130 --> 00:24:52.280
So let's say this alert wasn't here, or you weren't sure,

00:24:52.280 --> 00:24:55.250
or you were coming into an investigation where they had either

00:24:55.250 --> 00:24:58.710
suppressed these alerts or they were just ignoring them.

00:24:58.710 --> 00:24:59.900
Where else can you go?

00:24:59.900 --> 00:25:00.740
The alert is great,

00:25:00.740 --> 00:25:03.260
but I want to see the raw data because that's what I'm going to look through.

00:25:03.640 --> 00:25:08.350
The way to do that within Office 365 is to go down to Search,

00:25:08.940 --> 00:25:12.840
and then go to Audit log search. And audit log search is

00:25:12.840 --> 00:25:16.400
going to allow you to run a search across all the audit

00:25:16.400 --> 00:25:20.090
logs that Office 365 is compiling.

00:25:20.100 --> 00:25:26.430
Now, again, what you get to see depends on a couple different things,

00:25:26.430 --> 00:25:29.260
mostly your license that you're using,

00:25:29.260 --> 00:25:31.930
and we'll talk about that when we talk about response.

00:25:31.940 --> 00:25:37.190
But I want to go in and I want to see what inbox rules were created.

00:25:37.200 --> 00:25:39.420
And so the way that I can do that is, first thing I'm going to do is,

00:25:39.420 --> 00:25:41.110
I'm going to set the start and the end date.

00:25:41.120 --> 00:25:43.360
I'm just going to leave those as the defaults here.

00:25:43.360 --> 00:25:46.470
And I can go ahead and click Search, and if I do that,

00:25:46.470 --> 00:25:49.230
it is going to go and just show me everything.

00:25:49.230 --> 00:25:54.560
It's going to show me all of the events that have taken place

00:25:54.560 --> 00:25:56.640
throughout all of the time that I was in,

00:25:56.650 --> 00:25:59.620
or that this Office 635 installation has been up,

00:25:59.630 --> 00:26:02.610
or at least the last 7 to 30 days, depending on your license.

00:26:02.610 --> 00:26:04.150
That's going to be a lot.

00:26:04.160 --> 00:26:06.390
We don't want to go through every single one.

00:26:06.390 --> 00:26:07.760
So what I'm going to do instead,

00:26:07.760 --> 00:26:11.420
because I'm just looking for suspicious inbox rules,

00:26:11.420 --> 00:26:15.540
or the creation of some, I'm going to go to the filter here.

00:26:15.540 --> 00:26:18.590
I'm going to‑‑‑so instead of doing the Show results for all activities,

00:26:18.590 --> 00:26:23.230
I'll go in here and search and type inbox, and here you

00:26:23.230 --> 00:26:26.890
can see there are three that come up, Newinbox rule,

00:26:26.890 --> 00:26:30.020
create rule, Set‑inboxRule, or Update‑InboxRule.

00:26:30.090 --> 00:26:31.950
So I'm just going to select all three of those.

00:26:34.040 --> 00:26:34.870
All three are selected.

00:26:34.870 --> 00:26:36.380
You can tell by the 3 here.

00:26:36.490 --> 00:26:38.080
And then I'll just click out.

00:26:38.090 --> 00:26:38.710
Oops, sorry.

00:26:38.710 --> 00:26:44.190
I'll just click out and then click Search again, and boom.

00:26:44.190 --> 00:26:48.890
We see that there were three inbox rules created for klogan,

00:26:48.890 --> 00:26:51.960
or at least three, I should more specifically say,

00:26:51.970 --> 00:26:55.310
there were three audit logs related to inbox rules

00:26:55.310 --> 00:26:57.420
either being created or modified for Kim.

00:26:57.430 --> 00:27:01.170
And so I can go in here, and I can open this one up,

00:27:01.740 --> 00:27:05.960
click on the detail, and scroll down.

00:27:05.970 --> 00:27:09.690
And first thing you should notice is it shows us the client IP address.

00:27:09.700 --> 00:27:12.870
This is the IP address of who set that up.

00:27:12.870 --> 00:27:16.110
And if I remember correctly, that should be our Vietnamese IP address,

00:27:16.110 --> 00:27:18.670
the logins from the attacker.

00:27:19.340 --> 00:27:22.710
But more importantly, if I scroll down here,

00:27:22.720 --> 00:27:25.040
I can see what the rule actually is.

00:27:25.050 --> 00:27:29.500
So here it's telling us, all right, we've got this Outlook rule,

00:27:29.500 --> 00:27:35.010
we have the ForwardTo name in the value of kimberly.l0gan,

00:27:35.010 --> 00:27:41.760
where the o is a 0, at protonmail.com, not her corporate account.

00:27:42.040 --> 00:27:48.330
The next value is Move all messages from the Customer Globomantics to Inbox.

00:27:48.330 --> 00:27:52.230
So in other words, as emails come in, they're going to be moved,

00:27:52.240 --> 00:27:57.790
or this rule will apply, and the action for this is BodyContainsWords.

00:27:57.790 --> 00:28:02.480
So in other words, if the body of an email contains any of these words,

00:28:02.480 --> 00:28:06.130
wire, wiring, fund, invoice, funding, bank,

00:28:06.140 --> 00:28:09.120
banking, payment, any of those,

00:28:09.130 --> 00:28:12.350
then that email gets forwarded out to this protonmail account.

00:28:13.040 --> 00:28:14.080
‑Yeah, that's amazing.

00:28:14.080 --> 00:28:18.850
So this is a really, really good way‑‑‑so first we started out with phishing,

00:28:18.850 --> 00:28:19.940
account was compromised.

00:28:19.940 --> 00:28:23.980
To kind of catchup on detection‑wise, we can detect malicious logins,

00:28:23.980 --> 00:28:27.410
if we do detect mint malicious logins, probably should go and see,

00:28:27.410 --> 00:28:29.470
or if we missed the malicious logins,

00:28:29.470 --> 00:28:32.070
because maybe they logged in from the US with a good account,

00:28:32.070 --> 00:28:36.010
whatever, if we missed that, here's the next thing we can use,

00:28:36.010 --> 00:28:36.430
detections.

00:28:36.430 --> 00:28:38.880
Let's go look through our inbox forwarding rules,

00:28:38.890 --> 00:28:40.830
and we start making alerts based on that too.

00:28:40.840 --> 00:28:42.130
That's that's so cool.

00:28:42.140 --> 00:28:45.830
‑Yes, and understand that the alerts that we saw here,

00:28:45.830 --> 00:28:47.360
or the audit logs that we saw here,

00:28:47.360 --> 00:28:52.350
these get generated when a new inbox rule is created.

00:28:52.440 --> 00:28:55.260
When we talk about response in the next clip,

00:28:55.240 --> 00:28:58.840
we'll show how to actually pull all of the inbox rules that are already

00:28:58.840 --> 00:29:02.040
existing so you can then go through them and look to see, well,

00:29:02.050 --> 00:29:04.390
which ones are forwarding to external email addresses,

00:29:04.390 --> 00:29:07.990
which ones are doing these kind of weird things looking for these

00:29:07.990 --> 00:29:12.160
specific words in an email to do something with them?

00:29:12.240 --> 00:29:15.590
‑Yeah, and even start doing some regex on that to look for,

00:29:15.590 --> 00:29:18.490
hey, does this match our domain or not, or that kind of stuff?

00:29:18.490 --> 00:29:19.470
That makes a lot of sense.

00:29:19.480 --> 00:29:20.350
‑Yeah, absolutely.

00:29:20.350 --> 00:29:20.870
Do that.

00:29:20.870 --> 00:29:21.880
Load it into Excel.

00:29:21.880 --> 00:29:23.110
Load it into an ELK stack.

00:29:23.110 --> 00:29:25.590
Do whatever you need to in order to manipulate that

00:29:25.590 --> 00:29:27.760
data in order to find what you need.

00:29:28.140 --> 00:29:31.030
And so this is just one of the rules.

00:29:31.040 --> 00:29:33.870
If I go out here, let me close this out,

00:29:34.240 --> 00:29:41.730
and I go to the next one, and we go down here,

00:29:41.730 --> 00:29:43.300
here we see something a little bit different.

00:29:43.300 --> 00:29:47.840
Again, this is in Kim's inbox for her emails.

00:29:47.850 --> 00:29:51.230
But in this case, we're not forwarding the emails out.

00:29:51.230 --> 00:29:52.780
What's happening instead is,

00:29:52.790 --> 00:29:56.500
any email that's coming from CustomerGlobomantics@mail.com,

00:29:56.500 --> 00:29:59.510
which is who our second victim in our scenario is,

00:29:59.520 --> 00:30:04.620
any email coming from that, it's getting moved to a folder called RSS.

00:30:04.630 --> 00:30:08.810
This is something that the attackers in a BEC compromise will often do.

00:30:08.820 --> 00:30:12.850
They'll set up another rule so that if any emails come in from the

00:30:12.850 --> 00:30:15.850
victim that they're emailing to the legitimate user,

00:30:15.860 --> 00:30:17.450
it gets hidden in another folder.

00:30:17.460 --> 00:30:22.320
‑So say, what's really great about this is if you're on your detection game,

00:30:22.320 --> 00:30:25.710
one, you can now see customers that are affected or who they plan on affecting,

00:30:25.710 --> 00:30:27.700
depending on what timing you found this in.

00:30:27.700 --> 00:30:30.010
So if you found this, they made the inbox,

00:30:30.010 --> 00:30:33.750
they're probably trying to attack this customer at that exact moment.

00:30:33.750 --> 00:30:38.370
And so now you can kind of maybe try to get ahead of that too, based on timing.

00:30:38.370 --> 00:30:41.920
And we have logs and timing here, but, yeah.

00:30:41.930 --> 00:30:43.240
‑Yeah, exactly.

00:30:43.250 --> 00:30:46.730
This is a great way to also, like you just said,

00:30:46.730 --> 00:30:50.620
kind of see the progression of the attacker and what they were doing.

00:30:50.620 --> 00:30:51.750
And not only that,

00:30:51.760 --> 00:30:56.260
you can now see what this folder is and go in and pull the

00:30:56.260 --> 00:30:59.780
emails from that folder and start doing analysis on that to

00:30:59.780 --> 00:31:04.390
see what emails were going in, when did the customer potentially detect this,

00:31:04.390 --> 00:31:08.670
and why wasn't this user getting the emails to kind of alert everybody else?

00:31:09.040 --> 00:31:10.980
‑Why wouldn't they just delete the emails?

00:31:10.990 --> 00:31:12.460
Why are they moving them over?

00:31:13.040 --> 00:31:14.670
‑That is a good question.

00:31:14.680 --> 00:31:17.050
I don't really have a good answer for that.

00:31:17.060 --> 00:31:20.220
I would expect them too to just delete the emails,

00:31:20.220 --> 00:31:22.780
as opposed to just moving them to another folder.

00:31:22.790 --> 00:31:27.420
‑Do you think maybe it's to have access to it? Like if they needed

00:31:27.420 --> 00:31:29.440
that correspondence to be able to still get paid,

00:31:29.440 --> 00:31:31.800
they wanted the option to be able to log back into a

00:31:31.800 --> 00:31:33.370
pre‑compromised account and look at it?

00:31:33.740 --> 00:31:35.620
‑I think you might be  on that.

00:31:35.620 --> 00:31:37.140
By moving it to another folder,

00:31:37.140 --> 00:31:40.050
they can always go back and get those emails and then respond to them.

00:31:40.060 --> 00:31:42.740
If they move it to the trash or delete it,

00:31:42.750 --> 00:31:47.410
then there's always the chance that eventually Office 365 or the user is

00:31:47.410 --> 00:31:50.170
going to empty their trash or empty their deleted emails,

00:31:50.180 --> 00:31:51.690
and so they would lose access to it.

00:31:51.690 --> 00:31:53.570
So I really do think that's what it is.

00:31:53.640 --> 00:31:57.850
And normally they put it into a folder like RSS because most people,

00:31:57.850 --> 00:32:00.520
if they have an RSS folder for RSS feeds,

00:32:00.520 --> 00:32:02.960
don't use it, and so they're never going to look in there.

00:32:03.740 --> 00:32:04.370
‑Yeah, that makes sense.

00:32:04.370 --> 00:32:10.470
I never checked mine, so, I probably should now. Yeah, awesome.

00:32:10.480 --> 00:32:13.940
And so that applies, and I kind of wanted to make a point of a note here.

00:32:13.940 --> 00:32:16.100
Do you mind clicking back out of that so I can see the rest of the rules,

00:32:16.100 --> 00:32:17.070
unless you're not done with this?

00:32:17.070 --> 00:32:17.220
‑No, no, no, absolutely.

00:32:17.230 --> 00:32:21.280
‑Okay, so we see New‑InboxRule, New‑InboxRule,

00:32:21.340 --> 00:32:24.660
knowing how these detections are written often,

00:32:24.670 --> 00:32:26.670
or if you're doing your own detections,

00:32:26.670 --> 00:32:29.460
I just wanted to point out that Set‑InboxRule is

00:32:29.460 --> 00:32:31.000
also something you should look at.

00:32:31.000 --> 00:32:34.200
It's not just, if there's a new inbox rule,

00:32:34.200 --> 00:32:38.330
that can sometimes be the way that detection mechanisms do this.

00:32:38.330 --> 00:32:40.170
Microsoft's obviously doing a great job,

00:32:40.170 --> 00:32:44.040
but there's other groups that don't always have that same capability.

00:32:44.040 --> 00:32:45.170
It's not going to be the same rule set.

00:32:45.170 --> 00:32:48.690
So my point here is that they can just come in and modify an existing one

00:32:48.690 --> 00:32:50.800
and you probably should be alerting on that as well.

00:32:50.810 --> 00:32:51.900
‑Yeah, exactly.

00:32:51.900 --> 00:32:58.570
Now, you can go and export these here by going to Download all results.

00:32:58.540 --> 00:33:00.480
Here's the catch with that, though.

00:33:00.480 --> 00:33:05.350
Within at least this interface, you can only download 50,000 records at a time,

00:33:05.340 --> 00:33:07.680
which sounds like a lot,

00:33:07.680 --> 00:33:12.030
but if I'm investigating an organization or I'm looking at an organization,

00:33:12.030 --> 00:33:14.750
and I wouldn't necessarily know what to filter it based on,

00:33:14.750 --> 00:33:18.130
so I had to pull all logs, 50,000 records,

00:33:18.130 --> 00:33:19.550
depending on the size of the organization,

00:33:19.550 --> 00:33:21.470
could maybe be a day.

00:33:21.480 --> 00:33:24.530
So you may have to go through that multiple times in order to pull

00:33:24.530 --> 00:33:27.620
back records going back as far as you need to. ‑Yeah,

00:33:27.630 --> 00:33:30.220
and again, this isn't just the sign‑in logs.

00:33:30.220 --> 00:33:32.900
It's the audit logs, which historically,

00:33:32.900 --> 00:33:36.270
if you look at any‑‑‑this is every user action that was taken.

00:33:36.270 --> 00:33:41.600
For a reference, when you click into this API and you just made this log search,

00:33:41.600 --> 00:33:44.720
it's probably about four or five audit log entries.

00:33:44.720 --> 00:33:48.110
It's not simply user did a log.

00:33:48.110 --> 00:33:49.440
It's not just that one thing.

00:33:49.440 --> 00:33:52.330
So that's why it's so large.

00:33:52.330 --> 00:33:52.790
‑Right.

00:33:52.790 --> 00:33:55.290
And so one last thing to show in this interface.

00:33:55.290 --> 00:33:59.070
The audit logs are really great for pulling this information out,

00:33:59.070 --> 00:34:00.770
but let me clear it.

00:34:00.770 --> 00:34:05.050
We also talked about the applications that can

00:34:05.140 --> 00:34:06.850
bypass multifactor authentication.

00:34:06.850 --> 00:34:09.010
So how can you search for that?

00:34:09.020 --> 00:34:12.290
So there are a number of ways that you can go in and

00:34:12.290 --> 00:34:14.530
search for applications themselves,

00:34:14.540 --> 00:34:19.010
but really what you want to do is search for the users actually

00:34:19.010 --> 00:34:22.460
consenting to applications to kind of narrow it down.

00:34:22.440 --> 00:34:22.770
I mean,

00:34:22.780 --> 00:34:25.310
you can absolutely use PowerShell to pull all

00:34:25.310 --> 00:34:28.639
applications that are in your user accounts,

00:34:28.650 --> 00:34:31.250
but you could be coming back with who knows how many

00:34:31.250 --> 00:34:34.860
thousands of applications to look at, and you don't really have time to do that.

00:34:34.870 --> 00:34:37.960
One of the things you can do is go to the audit view here,

00:34:38.739 --> 00:34:43.770
go to Filter results, and then under Activity,

00:34:43.780 --> 00:34:49.960
look for consent to application, consent to application,

00:34:49.969 --> 00:34:52.239
and then filter it like that.

00:34:52.239 --> 00:34:55.820
We didn't use malicious apps here, so nothing is going to pull up.

00:34:55.830 --> 00:34:58.750
But if something did come up, that means a user said, yes,

00:34:58.760 --> 00:35:01.810
I'm going to allow this application access into my environment.

00:35:01.810 --> 00:35:04.260
And that's something then, you could go in,

00:35:04.260 --> 00:35:06.860
you could dig into that, you can see what the application is.

00:35:06.840 --> 00:35:10.180
Each application will have a unique ID associated with it,

00:35:10.180 --> 00:35:12.910
which you can then go and Google and validate whether,

00:35:12.910 --> 00:35:17.520
oh, this is iOS's email application, or this is Google's email application,

00:35:17.520 --> 00:35:19.580
or this one has never been seen before.

00:35:19.580 --> 00:35:22.670
That one that hasn't been seen before, then jump in,

00:35:22.670 --> 00:35:24.650
look at what the permissions are,

00:35:24.650 --> 00:35:28.950
what that application has access to and see if it does

00:35:28.960 --> 00:35:31.370
allow access or full access in the email,

00:35:31.370 --> 00:35:34.360
and that could be the way that the attackers have gotten in.

00:35:34.740 --> 00:35:37.790
‑Yeah, absolutely, and I wanted to dig into that a little bit.

00:35:37.790 --> 00:35:39.170
I think now is the  time.

00:35:39.170 --> 00:35:44.880
We talk about the attack chain of how the application would be used,

00:35:44.890 --> 00:35:45.640
and we mainly,

00:35:45.640 --> 00:35:49.250
specifically we're talking about bypassing multifactor authentication.

00:35:49.250 --> 00:35:51.370
And that sounds super scary.

00:35:51.370 --> 00:35:53.560
Again, it doesn't mean don't use multifactor authentication.

00:35:53.560 --> 00:35:56.030
Highly encourage using multifactor authentication.

00:35:56.040 --> 00:35:58.880
It gets rid of the whole swath of attackers who

00:35:58.880 --> 00:36:00.730
aren't using this application method.

00:36:00.740 --> 00:36:04.620
So you're at least narrowing down the potential attackers.

00:36:04.630 --> 00:36:08.920
So with that out of the way, we're looking at these applications.

00:36:08.930 --> 00:36:10.610
I want to talk a little bit about the mechanics of

00:36:10.610 --> 00:36:14.000
why that works and how that works, just in case someone is not aware,

00:36:14.000 --> 00:36:17.340
mainly because, so these applications get tokens,

00:36:17.340 --> 00:36:18.180
or OAuth tokens,

00:36:18.180 --> 00:36:23.840
and API tokens that are static and don't require multifactor authentication.

00:36:23.850 --> 00:36:25.960
That's really the point of it.

00:36:25.960 --> 00:36:27.780
When you authorize an application,

00:36:27.790 --> 00:36:31.040
it generates a token that is permanent authentication

00:36:31.040 --> 00:36:33.610
access to your account or your environment.

00:36:33.610 --> 00:36:35.360
‑Yeah, exactly.

00:36:35.430 --> 00:36:37.820
Think of these applications similar to a program

00:36:37.820 --> 00:36:39.450
that you install on your computer.

00:36:39.450 --> 00:36:42.490
You log in to your computer, you authenticate to your computer,

00:36:42.500 --> 00:36:45.720
but after you do that, you have access to your computer.

00:36:45.720 --> 00:36:49.470
And if you install a backdoor malicious program into your computer,

00:36:49.480 --> 00:36:51.200
it's got access to everything on there.

00:36:51.210 --> 00:36:52.580
Same concept here.

00:36:52.580 --> 00:36:57.100
You are allowing this basically app in the cloud

00:36:57.110 --> 00:36:59.600
access to your Office 365 environment.

00:36:59.610 --> 00:37:02.600
You're saying, yes, you can access whatever you want.

00:37:02.600 --> 00:37:06.150
And then that app just happens to be malicious,

00:37:06.150 --> 00:37:08.530
and then you can then use that,

00:37:08.540 --> 00:37:11.200
or the attacker can then use that to access whatever they want,

00:37:11.200 --> 00:37:14.350
grab emails, send emails through your account,

00:37:14.350 --> 00:37:15.060
and so on.

00:37:15.330 --> 00:37:16.950
‑Yeah, make forwarding rules.

00:37:17.130 --> 00:37:23.040
So yeah, effectively, that app's access is the same as having a user.

00:37:23.050 --> 00:37:23.310
‑Yes,

00:37:23.310 --> 00:37:25.400
and that is absolutely why you need to have some of these

00:37:25.400 --> 00:37:27.340
detections and protections in place.

00:37:27.350 --> 00:37:31.950
Microsoft has started to add things in to do app analysis,

00:37:31.950 --> 00:37:35.500
or at least let you know when new apps are being installed into Office

00:37:35.500 --> 00:37:38.580
365 so that you can get a report that shows that,

00:37:38.580 --> 00:37:41.020
hey, these 10 users just added in these applications.

00:37:41.020 --> 00:37:44.650
And you can use those to validate whether or not they're

00:37:44.660 --> 00:37:48.650
legitimate or not in more kind of real time than having to go in

00:37:48.650 --> 00:37:50.250
and manually pull all this information out.

00:37:51.030 --> 00:37:52.500
‑Yeah, absolutely.

00:37:52.510 --> 00:37:58.590
And I don't want to say that this is new. Office 365 isn't new by any means.

00:37:58.590 --> 00:38:03.030
But I think defenders, and depending on the organization you're in,

00:38:03.040 --> 00:38:07.000
have room to grow to start including this type of information.

00:38:07.000 --> 00:38:09.160
Like we just talked about, some of it's even difficult to get to.

00:38:09.160 --> 00:38:12.930
The logs aren't in the  place or it's this dashboard or that dashboard,

00:38:12.930 --> 00:38:15.650
or you have to have a license, and all of that becomes a misunderstanding.

00:38:15.650 --> 00:38:19.420
Or it's AWS or another, whatever it is.

00:38:19.420 --> 00:38:22.440
There's just a million different ways to try to get the information you need.

00:38:22.450 --> 00:38:24.800
But this is definitely the evolution of,

00:38:24.800 --> 00:38:26.430
here's the kind of things we can you start adding

00:38:26.430 --> 00:38:28.680
to our tool bag as connections.

00:38:28.680 --> 00:38:28.980
And yeah,

00:38:28.980 --> 00:38:34.550
I know it's increased things to look at because Office 365 doesn't exist only

00:38:34.550 --> 00:38:36.850
when you don't also have on‑premises stuff to worry about.

00:38:36.850 --> 00:38:40.500
You now have both, but that's just another place when you start looking,

00:38:40.510 --> 00:38:41.390
for sure.

00:38:41.390 --> 00:38:42.340
‑Right, exactly.

00:38:42.340 --> 00:38:45.790
‑And so that happens all the time,

00:38:45.790 --> 00:38:49.280
and hopefully now we can get a better grasp of what to do to detect it.

00:38:49.280 --> 00:38:52.140
But say we have people out there who are literally following along,

00:38:52.140 --> 00:38:53.330
and right now they're like, yeah, that sounds,

00:38:53.330 --> 00:38:54.160
like, really cool.

00:38:54.170 --> 00:38:55.430
Let's look at this application thing,

00:38:55.430 --> 00:38:59.330
press Enter and there's really bad application names

00:38:59.330 --> 00:39:01.840
coming up that have weird access to it.

00:39:02.120 --> 00:39:03.740
And they're finding all the same rules.

00:39:03.820 --> 00:39:06.210
They're like, oh, no, yeah, people are logging in from all over the world.

00:39:06.210 --> 00:39:07.680
They're logging in from other planets.

00:39:07.680 --> 00:39:09.110
That's definitely impossible.

00:39:09.120 --> 00:39:10.030
This is weird.

00:39:10.420 --> 00:39:11.190
What do we do now?

00:39:11.190 --> 00:39:13.630
We need to get into doing some instant response.

00:39:13.630 --> 00:39:15.420
So are we ready to talk about that next?

00:39:15.420 --> 00:39:16.360
‑Yeah, absolutely.

00:39:16.360 --> 00:39:19.950
Let's go in and let's talk about what you do once you find one of these things.

00:39:19.950 --> 00:39:22.100
And we'll talk a little bit even more about,

00:39:22.100 --> 00:39:24.980
you know, we've gone through and done some of this analysis.

00:39:24.990 --> 00:39:27.860
Let's show how to actually automate a little bit this a little

00:39:27.860 --> 00:39:29.440
bit more to make it a little bit easier to do.

00:39:29.720 --> 00:39:30.740
‑That sounds good to me.

00:39:30.740 --> 00:39:34.250
I'm about tired of scrolling through logs at this point in my career.
