WEBVTT

00:00.000 --> 00:07.560
The fact that we leverage as OT pen testers, assuming that we compromise the enterprise environment, we get domain admin.

00:07.560 --> 00:13.140
Domain admin is not always the key or dependent on success.

00:13.140 --> 00:14.480
It just makes things easier.

00:14.480 --> 00:16.420
So first thing, get domain admin.

00:16.560 --> 00:17.520
And oh...

00:18.740 --> 00:20.200
Let me go back.

00:20.200 --> 00:20.700
Okay.

00:21.040 --> 00:22.500
Thank you.

00:23.520 --> 00:24.440
Cool.

00:24.440 --> 00:25.420
Yes.

00:25.800 --> 00:27.240
Much better.

00:28.900 --> 00:30.700
Well, I'm actually a little bit ahead.

00:30.700 --> 00:32.540
So here's the remote access architecture.

00:32.540 --> 00:36.340
So just going back a slide, you have RDP jump servers.

00:36.340 --> 00:39.660
You have remote access proxy or VPN gateway.

00:39.660 --> 00:42.920
So these are the most three common types of remote access.

00:42.920 --> 00:45.740
Like I said, there could be a jump server in the OT DMC.

00:45.740 --> 00:47.360
Sometimes it's double hopped.

00:47.580 --> 00:54.260
But this is kind of key as an OT pen tester to know what type of remote access people are using to get in.

00:54.260 --> 00:56.200
Because that will change our tactic.

00:56.880 --> 00:57.660
Okay.

00:57.720 --> 01:01.100
So this is like a basic standard IT type of attack.

01:01.100 --> 01:02.540
But it's actually pretty...

01:02.540 --> 01:05.720
I kind of want to highlight it, because it's actually pretty interesting.

01:06.400 --> 01:16.260
So assuming we get domain admin in the enterprise network, the first thing we do is we pivot to NZ user's workstation that remotes into the OT DMC.

01:16.300 --> 01:22.100
And of course, we also look for the RDP save credentials.

01:22.100 --> 01:31.360
If you think about these operators, if they're logging into the OT DMC five days a week, and they don't want to type in their creds every single time they RDP in.

01:31.580 --> 01:33.640
So of course, you look at the desktop.

01:33.640 --> 01:35.660
You might find a .rdp file.

01:35.900 --> 01:42.960
And using something like Sharp DP API or Mimikatz, you can harvest these clear text credentials.

01:43.660 --> 01:51.320
But if they're leveraging multi-factor authentication, that would prevent us from masquerading as these users.

01:51.320 --> 01:59.140
But we also like to keep this in our back pocket, because the chances that once they're in the OT network, there's a good chance that these creds will work again.

01:59.140 --> 02:02.420
So like cred reuse is definitely a thing between IT and OT.

02:04.420 --> 02:08.740
Okay, another kind of low-level attack is group membership.

02:08.740 --> 02:19.700
So again, once we get domain admin, we look at the groups that these OT users are associated with, and we just add ourselves to those groups.

02:19.700 --> 02:24.540
And sometimes, just by doing that, we can access the same resources that they do.

02:25.000 --> 02:29.020
But again, if multi-factor authentication, that would prevent us.

02:29.020 --> 02:33.320
But we'll just use that later.

02:33.960 --> 02:38.220
Okay, so two kind of low-level, just general type of IT attacks.

02:38.500 --> 02:41.100
And now we're getting into something a little bit more interesting.

02:41.600 --> 02:53.320
So I'm not sure if any of you heard of set RDP, but this attack is a fun attack to do, it's very limited as far as the type of environments we can leverage this.

02:53.700 --> 03:02.200
So what's interesting about this attack is that it intercepts remote desktop credentials as an end-user attempts to authenticate to a jump server.

03:02.440 --> 03:09.120
But it only works in usually small environments, like wastewater treatment plants, or just very small organizations.

03:09.420 --> 03:16.840
Because to pull off this attack, you have to be in the same subnet, and the workstation and the jump server also has to be in the same subnet.

03:16.840 --> 03:19.720
So you're talking about a very small organization.

03:19.720 --> 03:22.820
But this is a pretty fun attack because you can just run this man-in-the-middle attack

03:26.020 --> 03:28.240
and gather clear-text credentials.

03:28.400 --> 03:33.180
Again, if there's multi-factor authentication, that would stop us from pivoting.

03:33.180 --> 03:38.440
But we can keep this in our back pocket and maybe reuse the creds later on.

03:40.220 --> 03:43.400
Okay, so this is where the fun stuff happens.

03:43.400 --> 03:49.760
This is probably the most common technique that we use to pivot between IoT and OT.

03:50.600 --> 03:52.800
And there's a few reasons why.

03:52.800 --> 03:54.580
It's actually very easy to pull off.

03:54.580 --> 03:56.360
There's not a whole lot of requirements.

03:56.760 --> 03:59.620
And it bypasses multi-factor authentication.

03:59.940 --> 04:08.300
So again, assuming we have domain admin, we find the users, like operators, that remote into the OT DMZ.

04:08.340 --> 04:10.240
We pivot to their workstation.

04:10.240 --> 04:16.140
And so one of the requirements is we have to have an anti-authority system level shell.

04:16.140 --> 04:17.320
And that's pretty easy to do.

04:17.840 --> 04:19.380
There's multiple ways to do it.

04:19.380 --> 04:20.540
You can use Task Manager.

04:20.540 --> 04:22.000
You can use PsXec.

04:22.200 --> 04:28.460
We just upload PsXec, spawn another shell as anti-authority system.

04:28.660 --> 04:30.720
And then the first thing we run is query user.

04:30.720 --> 04:33.360
So what users are logged on to that host?

04:33.360 --> 04:36.580
If it's a jump server on the enterprise, it's not...

04:40.440 --> 04:43.580
at any given time, you can see at least 12 different connections.

04:43.660 --> 04:46.840
So jump servers, there's a lot of connections we can see.

04:46.900 --> 04:50.140
If it's an end-user workstation, it's probably just one session.

04:50.140 --> 04:55.520
But with this attack, what we do is then we find the user that we want to hijack.

04:55.540 --> 04:59.260
And we run, like, tscon.exe and the session ID.

04:59.260 --> 05:01.280
And then, boom, we have their session.

05:01.280 --> 05:02.860
We just, like, bump them off.

05:02.860 --> 05:04.820
And now we have their connection.

05:05.180 --> 05:08.280
So we're just piggybacking off of their remote access process.

05:08.280 --> 05:12.320
So they're going through the whole remote access two-factor authentication.

05:12.320 --> 05:15.360
They're going to jump server or remote access proxy.

05:15.560 --> 05:19.640
And then in some situations, they're even pivoting to, like, some engineer workstation.

05:19.740 --> 05:23.800
So we don't need to know what their password is or know the two-factor authentication.

05:23.800 --> 05:26.140
We just bump them off and we have their session.

05:26.280 --> 05:29.120
The thing about this attack is it's not very OPSEC.

05:29.120 --> 05:30.940
It's actually, like, non-SEC.

05:31.620 --> 05:33.120
You know, we're bumping them off.

05:33.120 --> 05:35.660
Usually, they think it's, like, a network connectivity issue.

05:35.900 --> 05:41.780
But, you know, this type of attack, we usually collaborate with the end user.

05:41.780 --> 05:45.880
Because if they're, like, an operator doing something very important, we don't want to just bump them off.

05:45.880 --> 05:50.020
So we let them know beforehand, hey, we're going to run this attack.

05:50.020 --> 05:51.260
Are you okay with that?

05:51.340 --> 05:53.760
And then we bump them off and take over.

05:53.920 --> 05:55.700
But again, it's not very OPSEC.

05:55.700 --> 05:56.940
Like , you know, it is something...

05:56.940 --> 06:01.300
If you try to do this as a red team, someone would know.

06:01.900 --> 06:05.320
So this leads me into the next attack.

06:05.920 --> 06:07.580
Remote desktop shadowing.

06:07.580 --> 06:09.740
So this is also, like, another favorite of mine.

06:10.480 --> 06:14.360
It's very similar to remote desktop session hijacking.

06:14.440 --> 06:18.520
But you don't need to have an NT authority system shell.

06:18.520 --> 06:22.660
All you need is admin and you have to make an edit to the registry.

06:23.240 --> 06:25.300
And then same thing, you can run a query user.

06:25.300 --> 06:29.020
If you're on a jump server, you'll probably see over a dozen connections.

06:29.020 --> 06:32.560
If you're on top of workstations, this is usually the end user's connection.

06:33.400 --> 06:37.560
And then we run mstsc.exe, which is RDP.

06:37.560 --> 06:41.200
Or you can run shadow.exe.

06:41.200 --> 06:48.860
And with the no consent prompt, this means that the end user wouldn't know that you're shadowing their session.

06:49.060 --> 06:51.300
So that kind of makes it OPSEC.

06:51.300 --> 06:56.240
So once we run this command, we would have, like, a view of their desktop.

06:56.680 --> 06:59.540
And, like, again, they wouldn't know that we're viewing their desktop.

06:59.820 --> 07:05.280
But on the flip side, if we run commands or move the mouse, they can see that.

07:05.540 --> 07:08.340
So not very OPSEC, right?

07:08.800 --> 07:13.460
Again, we would work with the end user to let them know we're going to run this attack.

07:13.660 --> 07:19.340
But we can't do a whole lot if we want to, like, hide our activity.

07:19.340 --> 07:22.320
So this kind of leads into, like, the next attack.

07:22.540 --> 07:23.760
This is OPSEC.

07:23.760 --> 07:25.740
This is actually very, very OPSEC.

07:25.740 --> 07:29.100
So hidden desktop or HVNC.

07:29.560 --> 07:33.560
So, again, we have a domain admin on the enterprise network.

07:33.680 --> 07:36.440
We pivot to an end user workstation.

07:36.440 --> 07:44.800
And if we're using Cobol Strike, we can run hidden desktop, which is an open source tool by White Knight Labs.

07:44.800 --> 07:48.780
There's also, like, commercial tools from OST and Fortra.

07:48.780 --> 07:58.160
But the main concept here is that, again, the end user is logging into the OTDMC or they're logging into, like, their engineering workstation.

07:58.320 --> 08:04.440
And once they have gone through the connection process, we would launch HVNC's hidden desktop.

08:05.060 --> 08:06.940
And then we would be presented with a...

08:06.940 --> 08:07.540
Sorry.

08:07.940 --> 08:09.180
Is that better?

08:09.180 --> 08:09.620
Yeah.

08:09.620 --> 08:20.200
We would be presented with another UI of their desktop, but we can run commands, open up prompts without them seeing our activity.

08:20.540 --> 08:22.160
So this is actually really hard.

08:22.160 --> 08:23.300
This is a nice trick.

08:23.300 --> 08:29.240
So we're pretty much piggybacking off of their connection into the OTDMC or even lower.

08:29.480 --> 08:32.520
And, yeah, it bypasses two-factor authentication.

08:34.920 --> 08:35.800
Okay.

08:36.140 --> 08:37.000
Next.

08:37.000 --> 08:42.900
So this is unfortunately something that I've encountered on many engagements.

08:42.900 --> 08:45.160
Larger organizations.

08:45.680 --> 09:04.380
So in situations where, like, an organization is relying on top IT to manage network infrastructure or even worse, like, a third party to manage their network infrastructure, unfortunately, sometimes they leave it open to, like, from the enterprise to the OT.

09:04.380 --> 09:07.600
So, like, it's a very implicit...

09:07.600 --> 09:08.600
Bless you.

09:08.720 --> 09:09.920
Implicit rules.

09:09.920 --> 09:21.700
For example, if they have implicit firewall rules, they allow access to network switches, routers, management portals to the whole enterprise.

09:21.700 --> 09:29.520
This is something that we can leverage to access these, like, these interfaces, like, over SSH or telnet or web.

09:29.520 --> 09:35.560
And it's really sad because, like, you know, it kind of bypasses their whole remote access design.

09:35.560 --> 09:40.760
And, yeah, so it's not just the router switches or firewalls.

09:40.760 --> 09:43.220
It's also other, like, miscellaneous devices.

09:43.220 --> 09:45.960
Like, one common one is BMC devices.

09:46.140 --> 09:52.140
So, like, think iDRAC or ILO or UPS devices.

09:52.140 --> 09:55.840
So what I have here is, like, a UPS interface over telnet.

09:55.840 --> 09:58.020
And then I can enable SSH.

09:58.020 --> 10:01.300
And with SSH tunneling, I can pivot into OTDMC.

10:01.300 --> 10:07.160
So this is kind of like one of those things where, yeah, they just leave open to the whole enterprise network.

10:07.160 --> 10:12.360
And , yeah, if you have SSH, and if you combine this with default creds, it's even worse.

10:13.720 --> 10:15.220
So miscellaneous stuff.

10:16.160 --> 10:16.440
Okay.

10:16.440 --> 10:20.120
This is my last slide on attacks.

10:20.160 --> 10:24.680
And I was, like, kind of wondering if I should leave this in, put this in here, because I almost feel like it's common knowledge.

10:24.680 --> 10:28.960
But the thing is, I see this so often, and it's kind of sad.

10:29.580 --> 10:30.120
Okay.

10:30.120 --> 10:41.100
So in situations where there's, like, a jump server in the enterprise network, and then they incorporate, like, two-factor authentication, they use RSA or whatever, two-factor authentication, they forget that.

10:41.100 --> 10:46.440
So even if I have domain admin access, I can't remote desktop into the jump server because I don't have two-factor, right?

10:46.440 --> 10:49.720
So the client usually thinks, oh, this is great, you know, you can get in.

10:49.720 --> 10:55.240
But they tend to forget that, like, on Windows servers, like, WinRM is on by default.

10:55.320 --> 10:57.200
Or SMB might be open.

10:57.200 --> 11:00.720
We don't need two-factor authentication to access these services.

11:00.720 --> 11:14.780
We can just use, like, Evo, WinRM, or PS remoting to access the jump server through a different port, and then we can just redo the whole attack chain, use RDP shadow, RDP session hijacking, or HPNC.

11:15.300 --> 11:20.720
So, yeah, always put the jump server below the firewall and close off any ports.

11:20.720 --> 11:25.600
If it's meant to be just remote desktop, make sure only remote desktop is exposed.

11:27.300 --> 11:28.400
Okay.

11:28.400 --> 11:32.620
So defense detection opportunities.

11:32.620 --> 11:44.380
So , yeah, easy to detect remote desktop session hijacking, just look for TS con, RDP shadowing, look for shadow.exe, especially with the no consent prompt.

11:44.380 --> 11:48.900
That should be a very, like, high fidelity indicator.

11:48.900 --> 12:00.340
Because if you think about an IT support that's working with someone to troubleshoot something, they're usually going to ask for permission to take over their screen, their desktop.

12:00.340 --> 12:04.000
So if someone's not using that, that might be a red flag.

12:04.680 --> 12:13.080
HPNC is going to be much more difficult to detect because you're going to have to look at, like, API calls to, like, switch desktop or create desktop.

12:13.080 --> 12:15.260
That's going to be a bit of a challenge.

12:17.240 --> 12:17.740
Okay.

12:17.740 --> 12:20.100
So hard in the DMC defensive takeaways.

12:20.800 --> 12:28.540
Like, a lot of the attacks that I mentioned, yeah, like, we bypassed two-factor authentication and all that.

12:28.540 --> 12:30.560
But there's still a lot of things that you can do.

12:30.560 --> 12:36.280
So first, secure remote access paths, you know, the basics, multi-factor authentication for everything.

12:37.400 --> 12:39.540
So strengthen segmentation points.

12:39.540 --> 12:53.540
So one thing I want to see more often, I've only seen this top one engagement, unfortunately, but they had two jump servers, but they split the protocol from remote desktop to remote desktop over web.

12:53.660 --> 13:00.860
And funny enough, that actually kind of was pretty effective because we could hijack the session that had, like, a standard remote desktop access.

13:00.860 --> 13:04.580
But once they switched to remote desktop over web, they're not using port 339 anymore.

13:04.580 --> 13:06.800
It's using 80 and 443.

13:06.980 --> 13:11.060
And so we couldn't hijack that same session on the second server.

13:11.060 --> 13:14.560
So you want to separate, you want to change the protocols.

13:14.560 --> 13:17.380
So not just go with RDP over RDP.

13:19.040 --> 13:26.140
Hardened jump servers, like I said, you want to make sure that if you expect people to RDPN, only RDP is accessible.

13:26.140 --> 13:27.720
You want to put it behind the firewall.

13:28.380 --> 13:29.440
You want to NAT it.

13:30.600 --> 13:35.440
And of course, you want to enhance detection and visibility if you can, wherever you can.

13:36.140 --> 13:41.100
So look for, like, even IDs 4624, 4634, 4778.

13:42.380 --> 13:44.540
And so I'm a bit early.

13:44.760 --> 13:49.100
I actually have time for some questions.

13:49.600 --> 13:49.880
Oh.

13:50.800 --> 13:51.900
Thank you.

13:56.610 --> 13:57.270
Yes.

13:57.270 --> 13:57.990
Go ahead.

14:04.370 --> 14:04.890
Do next...

14:04.890 --> 14:07.130
Oh, the question is, why are...

14:07.130 --> 14:09.590
Is do next on the jump box bad?

14:10.230 --> 14:10.570
Okay.

14:10.970 --> 14:21.510
So do next on the jump box means, like, when an end user remotes into the jump box, they have an interface in the OT DMC already, right?

14:21.510 --> 14:26.670
So it makes it very easy for us to start scanning the network.

14:27.230 --> 14:28.430
You know, you can just do an ARP.

14:28.430 --> 14:31.610
You can enumerate the OT DMC much easier.

14:31.890 --> 14:33.550
You don't want to be doing that.

14:33.550 --> 14:36.610
You want to have an RDP into something else.

14:37.190 --> 14:40.330
Yeah, that would be, yeah, very easy to enumerate.

14:40.610 --> 14:41.950
Any other questions?

14:55.480 --> 14:56.740
What was the beginning again?

14:56.740 --> 14:57.220
Sorry.

14:59.910 --> 15:00.790
Oh.

15:01.610 --> 15:02.730
Yeah, yeah.

15:02.730 --> 15:06.130
Actually, I don't commonly see that, but that's a good idea.

15:06.130 --> 15:11.370
He said, do I recommend having separate identity stores between IT DMC and OT?

15:11.370 --> 15:12.570
Yes, definitely.

15:12.650 --> 15:13.770
Especially, like, Active Directory.

15:13.770 --> 15:17.430
You don't want to have Active Directory between enterprise and OT.

15:18.170 --> 15:19.590
In some situations, I've seen...

15:20.190 --> 15:20.970
Oh, thank you.

15:20.970 --> 15:21.750
Five minutes.

15:23.230 --> 15:24.970
Some situations I've seen...

15:24.970 --> 15:28.790
Actually, OT DMC is work group devices, which makes it, you know, very interesting.

15:28.790 --> 15:33.530
Definitely separate identity stores between IT and enterprise.

15:33.530 --> 15:34.470
I mean, OT.

15:35.350 --> 15:36.490
Any other questions?

15:36.490 --> 15:37.650
Got a few more minutes.

15:41.770 --> 15:42.810
Go ahead.

15:49.640 --> 15:53.020
Yeah, that's why I like it so much.

15:53.020 --> 15:54.840
Because it's hard to detect.

15:54.840 --> 15:56.160
It really is.

15:58.020 --> 16:01.780
So, actually, I created a fork of this tool.

16:01.780 --> 16:05.600
Because most of the times on the OT Pentest, we're not even using C2.

16:05.600 --> 16:06.700
We're living off the LAN.

16:07.780 --> 16:11.560
So, this is where, like, something like URL rules would come in.

16:11.840 --> 16:14.760
And I know, like, you know, I work at SE.

16:14.760 --> 16:21.360
I know how, you know, for bigger organizations, URL rules is not always the most practical thing to find API calls.

16:21.360 --> 16:22.480
Because it's a lot of resource...

16:22.480 --> 16:24.200
It's very resource intensive, right?

16:24.700 --> 16:25.160
So...

16:25.160 --> 16:27.170
But, yeah, you want...

16:27.920 --> 16:33.240
I mean, for this attack, you're going to have to detect the C2 beacon first.

16:33.240 --> 16:35.640
So, that's your best bet.

16:36.800 --> 16:38.380
Aaron, go ahead.

16:54.060 --> 16:54.820
Okay.

16:55.480 --> 16:56.500
So, yeah.

16:56.500 --> 16:57.700
Suspicious SMB pipes.

16:57.700 --> 16:58.660
That's a good one.

16:59.100 --> 17:00.760
But, again, again, a huge organization.

17:00.760 --> 17:01.700
That may be hard to...

17:01.700 --> 17:03.020
It's like a needle in a haystack, right?

17:03.260 --> 17:03.640
So...

17:03.640 --> 17:04.040
But, yeah.

17:04.060 --> 17:05.980
Thank you for that input, Aaron.

17:07.760 --> 17:08.900
Anything else?

17:12.780 --> 17:13.320
Okay.

17:13.320 --> 17:14.440
Well, that's it.

17:14.620 --> 17:15.400
Thanks, guys.

