WEBVTT

00:00.820 --> 00:02.040
Hello everyone.

00:02.600 --> 00:03.380
Hello!

00:03.580 --> 00:05.920
Hi, so thanks for coming along today.

00:05.920 --> 00:10.240
We are here to talk about everyone's favourite subject from 25 years ago.

00:11.680 --> 00:16.140
So a friend of mine said this to me when I told him what our research was about.

00:17.060 --> 00:18.220
And yeah, it holds true.

00:18.220 --> 00:21.540
I mean, Windows has got some stuff going on.

00:21.540 --> 00:24.720
So let's find out exactly how broken it is.

00:25.040 --> 00:28.320
So real quickly, we're from there.

00:29.220 --> 00:31.180
That's a very accurate map.

00:31.320 --> 00:35.500
We're from the middle of Middle Earth, a little place called Wellington in New Zealand.

00:36.100 --> 00:38.540
And yeah, it was a long flight.

00:38.800 --> 00:39.720
It was too long.

00:39.720 --> 00:41.300
It was too long in economy.

00:42.040 --> 00:43.120
Anyway, a little bit about me.

00:43.120 --> 00:46.280
I've worked at a bunch of logos, which is very exciting.

00:47.360 --> 00:51.100
I actually had a life before hacking where I used to tour a lot of bands to New Zealand.

00:51.100 --> 00:56.160
So please don't ask me about the early 2000s, because I had PTSD and a lot of debt.

00:57.520 --> 00:59.200
I'm also a former software developer.

00:59.200 --> 01:01.660
I'm a relatively active security researcher.

01:01.660 --> 01:04.000
A few CBEs in various things.

01:04.000 --> 01:08.300
I'm a frequent flyer with Search New Zealand, which is the cybersecurity emergency response team.

01:08.440 --> 01:09.560
They love me.

01:09.620 --> 01:11.720
Please don't ask me about council software.

01:12.720 --> 01:13.880
And I'm Thomas.

01:13.880 --> 01:17.380
I have also worked at fewer logos than Jim.

01:17.380 --> 01:19.020
I'm a little bit younger than Jim.

01:19.020 --> 01:21.720
I also do some CTF stuff.

01:22.420 --> 01:25.160
And I'm also a senior security consultant.

01:25.160 --> 01:26.660
I also do research.

01:26.940 --> 01:30.500
I found a fun thing a few years ago in Kiteworks.

01:30.600 --> 01:34.520
Also did the Kramer thing with Jim a couple of slides ago.

01:34.520 --> 01:35.760
Don't know if you remember.

01:35.900 --> 01:38.720
And then also the Microsoft stuff in this talk.

01:39.980 --> 01:43.000
So this talk is about NTLM.

01:43.040 --> 01:45.900
NTLM is supposedly going away.

01:47.040 --> 01:51.760
Every NTLM bug we've seen has usually been a gateway bug to something better.

01:51.760 --> 01:55.060
Like usually it leads into something that's quite nice.

01:55.060 --> 01:56.100
Sometimes a bounty.

01:56.760 --> 01:59.620
It has been an absolute ride with the MSRC.

01:59.620 --> 02:00.940
They have a very hard job.

02:00.940 --> 02:02.520
We met with them the other day.

02:02.520 --> 02:06.000
And we did have to change some of our talk because it turns out they're actually quite nice.

02:06.000 --> 02:11.220
Yeah, when you like meet them and they've got faces and names, you kind of feel a little bad.

02:11.420 --> 02:12.040
Oops.

02:12.800 --> 02:17.360
Windows has an overwhelming desire to authenticate to everything that it can.

02:17.360 --> 02:21.760
It just likes sending hashes out like there's no tomorrow.

02:22.320 --> 02:26.520
And the Windows ecosystem is very vast and very fun.

02:27.840 --> 02:29.980
So, NTLM.

02:29.980 --> 02:32.360
We are not going to give it a stupid name.

02:32.820 --> 02:39.480
Someone called SQLI squealy and it still haunts you.

02:40.600 --> 02:43.720
It stands for New Technology Land Manager.

02:44.140 --> 02:47.000
There's something about calling things new in technology.

02:47.000 --> 02:49.540
That means it's going to be around forever.

02:50.480 --> 02:56.200
And it's up there with the simple in SNMP and lightweight in LDAP.

02:57.660 --> 03:02.660
So, NTLM was developed in the 90s, like a few of you here.

03:03.500 --> 03:05.320
It's preceded by LM.

03:05.320 --> 03:08.680
And this is finally completely removed in server 2025.

03:09.220 --> 03:10.720
So, it hasn't been removed yet.

03:11.340 --> 03:15.000
It was intended to provide authentication, integrity, and confidentiality.

03:15.000 --> 03:15.920
So far, so good.

03:15.920 --> 03:18.680
This is, you know, what you expect out of NTLM.

03:19.120 --> 03:22.000
They've recommended not to use it since 2010.

03:22.000 --> 03:23.860
Does anyone know what year we're in now?

03:24.720 --> 03:31.140
There was a 2011 DEF CON talk that I watched called, Nail the Coffin Shut, and NTLM is dead.

03:31.960 --> 03:34.040
It failed to die.

03:35.540 --> 03:40.420
So, are there a crap load of CDEs associated with this protocol?

03:40.900 --> 03:46.000
So, essentially at its core, it is a hash of a password, also called an NT hash.

03:46.000 --> 03:47.720
It's a challenge response mechanism.

03:47.720 --> 03:50.980
So, the client establishes a network path and negotiates.

03:50.980 --> 03:52.940
The server responds with a challenge message.

03:52.940 --> 03:55.200
The client responds with an authenticate message.

03:55.320 --> 03:56.980
And it does this using the NT hash.

03:56.980 --> 04:02.640
And there's a couple of different flavors that we're going to be talking about, which is mostly net NTLM v1 and net NTLM v2.

04:02.760 --> 04:06.680
So, on a network, essentially this lets you browse file shares and websites.

04:08.240 --> 04:11.700
So, some quick definitions before we get stuck into the bugs.

04:11.820 --> 04:17.460
A hash is data produced from one-way functions, so you don't have to pass your plaintext password around.

04:17.460 --> 04:23.160
I've been asked to localize my talk, so this is essentially the equivalent of turning a cow into a hot dog.

04:23.260 --> 04:26.560
It's expensive to get the hot dog back into the cow.

04:27.140 --> 04:32.280
So, UNC is the Universal Naming Convention, you know, slash slash thing.

04:32.280 --> 04:38.120
HTTP, Hypertext Transfer Protocol, and URI, the Uniform Resource Handler.

04:38.840 --> 04:40.980
So, what happens if you steal one?

04:40.980 --> 04:42.380
There's kind of three things.

04:42.380 --> 04:50.140
You can brute force it, turn it back into a plaintext password, talk to the password-cracking village about how quickly they can do it these days .

04:50.260 --> 04:53.660
You can also relay it and pretend to be that person.

04:53.740 --> 04:58.440
That's mainly with NTLM and NTLM v1.

04:58.720 --> 05:01.540
NTLM v2 does it sometimes, just for fun.

05:01.640 --> 05:07.600
And you can also just take a screenshot of it, report it to the MSRC, have a fun conversation with them.

05:09.680 --> 05:18.140
So, we did a few minutes of Googling, and these are all the bugs that we found in like three minutes about NTLM.

05:18.140 --> 05:21.200
There's also the MorpheSec talk that was yesterday.

05:21.200 --> 05:26.260
They went into some more NTLM stuff there, but it's a doozy.

05:26.260 --> 05:30.400
There was the MonikaLink one this year, the Windows themes file as well.

05:30.400 --> 05:33.860
You could just load a theme and it would send off your hash for fun.

05:34.040 --> 05:40.180
Outlook sound files, which was like a zero-click RCE, there was a bypass for that and then a bypass for that again, I think.

05:41.160 --> 05:43.400
And, yeah, some other ones.

05:43.400 --> 05:45.220
Everyone's favorite, Petit Patin .

05:47.140 --> 05:50.900
So, NTLM is just a host of vulnerabilities.

05:50.900 --> 05:54.300
A lot of it is just by design, we won't fix it.

05:54.300 --> 05:56.700
I mean, it's old.

05:57.080 --> 06:06.340
So, what they're doing is they're going to deprecate it and then eventually disable it, which is kind of fixing it, I guess.

06:07.520 --> 06:16.100
Given that like half of the environments in little old New Zealand still use NTLM v1, it's going to take a long time.

06:17.660 --> 06:23.480
So, we have a good authority, an anonymous source at Microsoft, who actually confirmed this for us.

06:23.480 --> 06:28.360
And he said to us when we met them, the runway for this is between 50 and 100 years.

06:29.800 --> 06:31.240
So, yeah.

06:33.770 --> 06:36.430
So, it's going to be disabled on a future version of Windows 11.

06:36.430 --> 06:37.370
This is great.

06:37.750 --> 06:40.430
And they have told us that they're stopping working on it.

06:40.430 --> 06:42.250
So, it's feature complete, apparently.

06:42.750 --> 06:48.190
So, now Windows will attempt to authenticate with Kerberos first, which is really secure and great.

06:48.830 --> 06:52.950
But it still falls back to NTLM if a Kerberos negotiation doesn't happen.

06:53.290 --> 06:55.430
And so, it's going to be disabled in a future release.

06:55.730 --> 07:00.290
And it can always be re-enabled, just like NTLM v1.

07:01.350 --> 07:04.890
So, one of the tools we've been using is a very, very well known tool.

07:04.890 --> 07:06.550
We're not going to go too much into it.

07:06.630 --> 07:11.530
This is Responder, the rogue authentication server developed by Elgandex.

07:11.530 --> 07:14.010
Please go and flick them some money for this great tool.

07:14.250 --> 07:23.470
The two ports that we are concerned with, port 80 and port 445, and it provides authentication challenges on these ports and a lot of others.

07:23.550 --> 07:24.770
It does some other cool stuff.

07:24.770 --> 07:26.270
It's a very valuable pen testing tool.

07:26.270 --> 07:30.350
If you've never heard of it, go run it in an internal network and frighten your SOC team.

07:30.770 --> 07:33.490
For our purposes, we're just going to use it to collect hashes.

07:34.630 --> 07:39.930
So, this current obsession with NTLM hashes started a couple of years ago.

07:40.130 --> 07:42.650
I was testing an ArcGIS application.

07:42.650 --> 07:48.770
For those of you not familiar with ArcGIS, it's mapping software beloved by local government.

07:49.230 --> 07:52.230
I asked my workmate, Amad, if he had any tricks.

07:52.230 --> 07:56.450
He was a very high ranked bug crowd guy, so of course he did.

07:56.670 --> 08:01.610
He suggested I run Responder on one of our servers for a blind SSRF that we had found.

08:02.550 --> 08:04.330
And we got a hash on port 80.

08:04.930 --> 08:08.010
But ArcGIS is running Java on IIS.

08:08.950 --> 08:11.030
So, now we wanted to speed run.

08:11.030 --> 08:18.670
In case you're wondering what RSS and ArcGIS looks like, you can specify an RSS URL for some obscure reason.

08:20.590 --> 08:21.770
So, yeah.

08:21.910 --> 08:24.430
Sorry about the NTLM bugs, everyone.

08:26.190 --> 08:29.050
So, Windows does want you to be safe.

08:29.050 --> 08:31.130
They do have some built in protections.

08:31.130 --> 08:34.550
One of them is Mark of the Web, which you might have seen before.

08:34.690 --> 08:41.410
If you were to download a file from the internet, it sets a little flag on the document, like a Word document or some other things as well.

08:41.930 --> 08:46.630
And basically it just says, nah, I'm not going to use all of the features.

08:46.630 --> 08:48.950
I'm just going to let you briefly look at it.

08:48.950 --> 08:52.690
You can click the little warning to make it go away, but it's safe.

08:53.810 --> 08:58.470
The WordPad issue that I mentioned earlier, that just bypassed it.

08:58.470 --> 09:01.030
I don't think they even had Mark of the Web on WordPad files.

09:01.030 --> 09:01.730
Oh, no.

09:01.790 --> 09:02.370
No.

09:03.050 --> 09:08.990
And also, if you get cloned something and there's a document in it, it also just doesn't set the flag.

09:08.990 --> 09:09.830
It's great.

09:10.970 --> 09:16.250
They also have this from, what, Windows NT days?

09:16.930 --> 09:18.630
They're called Safe Zones.

09:19.130 --> 09:20.650
This is a recent screenshot, Thomas.

09:20.650 --> 09:25.630
Yeah, this is from Windows 11, as you can see, with the little Xs in the top right hand corner.

09:27.270 --> 09:34.470
Yeah, you can see that because it says scripting of Java outlets, it's very up to date and protects you against many things.

09:34.750 --> 09:42.950
The little thing down the bottom with the user authentication, it stops some hashes over port 445, but that's about it.

09:43.570 --> 09:48.470
So, it's time to query some hashes from some software before MTLM goes away.

09:48.990 --> 09:50.350
So, we're going to talk about a few things.

09:50.430 --> 10:10.590
ImageMagick and GraphicsMagick, VLC media player, Aspos.net, HiQ PDF, the Q stands for quality, as we find out, Java on IIS and Windows, Calendars, NuGet and iCredential, RSS feeds and Outlook, MS Office, URI handlers and Outlook, and Git for Windows.

10:11.150 --> 10:18.730
So, GraphicsMagick is generally regarded as the safer one because it's a relatively fuzzed fork of ImageMagick.

10:18.730 --> 10:21.790
So, it's a massive attack surface.

10:22.310 --> 10:27.410
ImageMagick is generally associated with ImageTragic, which everyone will remember from a few years ago.

10:28.290 --> 10:31.430
But ImageMagick didn't leak a hash over port 445.

10:32.330 --> 10:37.930
So, it will leak a hash by SVG converting to anything via a UNC path href.

10:38.170 --> 10:44.170
And it's noted in the documentation as SSRF, but there is nothing about hashes or UNC paths.

10:46.090 --> 10:47.450
VLC player.

10:47.690 --> 10:54.170
So, you can just load a playlist file and it's got a UNC path in it and it will go away and fetch the hash.

10:54.610 --> 11:00.370
Our old workmate, Amit, he disclosed that and then VLC were like, it's a Windows problem.

11:00.370 --> 11:02.410
No, it's a VLC problem.

11:02.690 --> 11:05.870
I mean, it's also a Windows problem, but come on guys.

11:06.250 --> 11:09.310
You could also do it in iTunes and Windows Media Player.

11:09.310 --> 11:12.030
I'm sorry if you still use those programs.

11:12.390 --> 11:17.170
There's probably maybe six of you in the audience that still use Windows Media Player and iTunes for Windows.

11:17.170 --> 11:18.050
I'm sorry.

11:18.450 --> 11:22.970
There's also lots of other formats and protocols that may or may not support NTLM.

11:22.970 --> 11:26.650
I mean, I'd tell you to go and look at them, but VLC don't care.

11:28.890 --> 11:33.670
So, Aspose.net is a lovely piece of document processing software.

11:33.670 --> 11:40.090
Anyone who's ever spent any time on the red team or doing any kind of pen testing will know just how rich and intact surface document processing is.

11:40.390 --> 11:43.590
It has a few known documented security issues.

11:44.590 --> 11:53.030
SSRF, server side request forgery, NTLM hash leakage, file inclusion, and it's right there on their web application security when loading resources page.

11:53.030 --> 11:56.170
So, they know about them and they have front footed it.

11:57.610 --> 12:03.210
So, leaking hashes at port 4.5 is relatively abundant and low value within an ecosystem.

12:03.690 --> 12:10.430
So, port 4.5, any good system administrator will block this port on a firewall because there's no reason that it needs to talk to the internet.

12:10.790 --> 12:13.350
Port 80, however, is not as blocked.

12:13.370 --> 12:18.890
So, when Windows sees a UNC path, those little slashes we saw before, it only knows how to do one thing.

12:19.130 --> 12:22.930
And it takes a little bit of work to get it out by HTTP.

12:23.070 --> 12:23.890
So, let's try.

12:24.810 --> 12:31.890
So, I just wanted to look at the district plan for our city and not go to the cyber security emergency response team.

12:32.450 --> 12:38.170
So, there's a piece of software in Aotearoa, New Zealand called ISO plan developed by a company called ISOVIST.

12:38.450 --> 12:41.370
So, again, I alluded to not talking to you about council software.

12:41.370 --> 12:49.450
It's so niche and weird and the people who develop it know councils and local government, but they might not necessarily know security.

12:49.990 --> 12:56.630
And anyone who's ever spent time as a pen tester, so much of it is vibes based, you could tell that this thing had been pen tested before.

12:57.270 --> 12:58.590
Yeah, you could just tell.

12:59.790 --> 13:03.310
So, headless PDF generation is so dumb.

13:03.970 --> 13:06.090
This is not a talk about headless PDF generation.

13:06.090 --> 13:22.650
It's a well known and well documented tech surface within web applications, but sometimes you need to turn HTML into PDFs, which is, you know, there's a few well known places you can look for bugs, because basically HTML gives you a lot of primitives to do some fun and dangerous things,

13:22.650 --> 13:24.770
such as iframes, portals, embeds.

13:24.770 --> 13:26.430
So, these have all been blocked.

13:26.570 --> 13:28.950
There had been some hardening done, which is great.

13:29.910 --> 13:32.850
However, cat pictures were not blocked.

13:33.850 --> 13:39.590
So, I managed to get an image tag to give up an NTLM hash on port 80.

13:40.970 --> 13:45.070
So, my first question was, what even is this?

13:46.310 --> 13:48.670
So, we talked about HiQ PDF.

13:49.270 --> 13:51.630
Over a million downloads in NuGet for this package.

13:51.630 --> 13:54.470
NuGet is the package repo for .NET.

13:54.770 --> 14:02.410
It has a settings .xml file, and the default property for NTLM authentication is true.

14:02.630 --> 14:06.790
So, I guess I really just wanted to know how this happened.

14:06.910 --> 14:10.790
And then I looked into it a bit, and I figured out how it happened.

14:11.550 --> 14:15.150
You can tell it's really high quality by the 3D rendered box art.

14:15.170 --> 14:17.650
This is the very height of technology.

14:19.790 --> 14:26.290
So, the other thing we found is, because of all the ArcGIS stuff, Java on IIS is a lovely place to look.

14:26.370 --> 14:30.530
The HTTP URL connection function used to pass hashes by default.

14:30.650 --> 14:32.390
We're not entirely sure it does now.

14:32.390 --> 14:34.770
I tried a couple of test projects to see.

14:34.770 --> 14:38.290
It seems to be safe, but it is still out there causing issues.

14:38.290 --> 14:40.630
See GeoServer and ArcGIS.

14:41.010 --> 14:45.790
So, Java calls the underlying Win32 API, which is a WinHTTP request.

14:45.790 --> 14:54.090
And Blazor have a very good write up about coaxing things out on port 80, and they even made a stack overflow post proving it.

14:55.970 --> 14:59.270
We have to do a little Lord of the Rings meme.

15:00.130 --> 15:02.070
We're from New Zealand, we have to.

15:03.670 --> 15:12.530
So, they also have one other little security thing on Windows, and that's this prompt that comes up now and then.

15:12.530 --> 15:16.710
And it's like, please don't quit me, it's unsafe, do you really want to continue?

15:16.710 --> 15:18.710
Are you sure you want to get hacked?

15:18.710 --> 15:21.290
And I'm sure no one clicks yes ever, right?

15:21.290 --> 15:22.850
Yeah, it's a security control.

15:23.190 --> 15:24.270
I mean, it's fair.

15:24.270 --> 15:25.730
It's probably what their lawyers want.

15:25.730 --> 15:32.350
They want the functionality, but their lawyers are like, if you don't have this prompt, people will get angry and we could get sued.

15:32.930 --> 15:38.370
So, if you want to have a bug in a Microsoft product, you need to get past this.

15:38.770 --> 15:46.230
You need to have basically no warning that it's going to be fun and dangerous and you're going to get people's hashes or run some code.

15:47.310 --> 15:51.250
So, with that in mind, let's see what we can find in the Microsoft ecosystem.

15:53.010 --> 15:55.030
Enter iCredentials.

15:55.030 --> 16:02.650
So, it's just an interface, but it does some stuff.

16:02.890 --> 16:09.190
When we first got some hashes out on port 80, we started looking at the code and going, what is this?

16:09.330 --> 16:11.010
Why is this?

16:11.010 --> 16:13.710
Turns out it's not banana water.

16:13.710 --> 16:17.010
It's not gross and made up.

16:17.270 --> 16:20.850
It's just developers making logic errors, doing dumb things.

16:20.850 --> 16:26.570
It provides the base authentication interface for retrieving credentials for web client authentication.

16:27.830 --> 16:30.250
And it's used in .NET a lot.

16:30.250 --> 16:37.010
And some of the anti-patterns that it has are weird and they fall back to some dumb things.

16:37.170 --> 16:38.850
Like in NuGet.

16:38.990 --> 16:43.110
So, you've probably seen NuGet before if you've ever touched C Sharp.

16:43.110 --> 16:47.290
It's reasonably integral to the .NET ecosystem.

16:48.590 --> 16:52.710
And they have some very good advice for storing credentials.

16:52.710 --> 16:57.170
Just put them in the NuGet config file, it will encrypt it, it will be fine.

16:57.210 --> 17:00.830
But it also just falls back to NTLM sometimes.

17:00.830 --> 17:04.430
I would like 500 of my coworkers' hashes, please.

17:05.550 --> 17:08.490
It does it on NuGet restore, by the way.

17:08.510 --> 17:13.570
Which it does it when you get cloned something in like Visual Studio.

17:14.010 --> 17:16.510
And that bypasses all safety checks.

17:16.510 --> 17:18.930
There's no little don't click me button.

17:19.610 --> 17:22.390
So, Jim got a nice new e-bike from Microsoft.

17:22.390 --> 17:23.690
It's very zippy.

17:26.490 --> 17:29.710
Jim had to be very specific with Microsoft.

17:30.990 --> 17:34.050
Yeah, I had to make him a video with the breakpoint set.

17:34.050 --> 17:35.670
And I had to be like, it happens here.

17:35.670 --> 17:36.770
This is where it happens.

17:36.770 --> 17:38.370
It happens right here, Microsoft.

17:38.370 --> 17:39.230
Please believe me.

17:41.250 --> 17:43.930
So, just we had a random thought.

17:43.930 --> 17:47.230
Like, what if we reframe it as an SSRF problem?

17:47.230 --> 17:56.590
Like, what if instead of trying to get NTLM hashes out, we pretended it was a server and not a client anymore and we just thought it was just HTTP something?

17:56.590 --> 18:03.170
There's a lot of harmless HTTP interactions in Microsoft products like RSS, don't know why I'm mentioning that.

18:03.630 --> 18:06.670
URI schemes, don't know why I'm mentioning that either.

18:07.190 --> 18:10.090
And web service in Excel, I'm just mentioning that one.

18:10.590 --> 18:16.730
If you think of these interactions like a flavor of SSRF, you can just find some new cool things.

18:17.510 --> 18:20.930
Like, what if you just suddenly redirect a resource?

18:20.930 --> 18:22.750
So, we did that.

18:22.750 --> 18:30.670
We redirected things to a nice little UNC path and it just does things.

18:30.670 --> 18:34.310
It just happily switches protocols and tries to auth.

18:34.510 --> 18:35.550
Browsers don't do that.

18:35.550 --> 18:38.570
Browsers go like, where are you trying to go?

18:38.570 --> 18:40.510
This is a dangerous redirect.

18:40.790 --> 18:41.630
Yeah.

18:42.590 --> 18:48.410
But we wrote some quick little code and then started pointing things at it.

18:49.430 --> 18:52.350
So, this is Microsoft bug number two.

18:52.810 --> 18:55.790
So, we might have rabbit holed a little bit with the URI handlers.

18:55.790 --> 19:05.490
Quick recap, every time you install a program on Windows, it installs a URI handler which is a little scheme that you can embed in a website or something to allow that program to be opened automatically.

19:05.630 --> 19:13.790
So, I dumped every single URI scheme from my Windows machine and I wanted to see which one Outlook would warn on.

19:13.790 --> 19:19.370
And it was nearly all of them, except for the Microsoft URI schemes, which was very weird.

19:19.610 --> 19:28.630
And it just straight up opens words, Microsoft Word or Excel or PowerPoint or Access, if anyone still uses that, and fetches the remote resource.

19:28.730 --> 19:33.030
So, now we have a little bit of an idea what to do when we fetch remote resources.

19:33.850 --> 19:39.450
So, no warnings, one click, embedded in an email should be a relatively safe thing to do.

19:40.530 --> 19:43.070
So, they've asked us to not spill the beans.

19:43.070 --> 19:45.970
So, could everyone just, like, block their eyes and ears?

19:46.630 --> 19:47.250
Yeah.

19:47.750 --> 19:50.670
There are some security controls in place.

19:50.870 --> 19:53.170
All files will open in a preview mode, which is good.

19:53.170 --> 19:54.970
Mark of the web is on it.

19:54.970 --> 20:00.790
And you can't put UNC paths in the URI scheme, so you can't straight up convince someone to load a file, which is good.

20:01.370 --> 20:03.650
So, the URI handlers essentially look like this.

20:03.650 --> 20:13.310
MS Word, title of the thing you want to open, OFE, open for editing, short for URL, and then you just give it an HTTP link, and it'll rush off and fetch that.

20:13.650 --> 20:18.210
And you can also force a file extension change, which is quite fun.

20:19.790 --> 20:21.970
And here's a little video of this happening.

20:23.830 --> 20:35.010
So, essentially, we are spinning up our little redirector in the top right, and then we spin up everyone's favorite hacking tool, Responder, and then we just go into our email and click a link.

20:35.830 --> 20:37.110
I would click that link.

20:37.110 --> 20:38.650
I'll totally click that link.

20:39.330 --> 20:40.830
And then we link someone's hash.

20:46.150 --> 20:48.110
Thank you, everyone.

20:48.770 --> 20:53.830
So, there are some much better NTLM-related bugs than the ones we've been showing.

20:53.830 --> 20:58.730
Hafei Lee from Checkpoint Research discovered a bug called moniker link.

20:59.210 --> 21:03.850
And so, this technique allows for a different and usually blocked file extension to be loaded.

21:03.850 --> 21:07.510
So, a whole new class of bug comes into play.

21:08.390 --> 21:10.430
In 2024, moniker link came up.

21:10.430 --> 21:12.490
So, we have two things.

21:12.490 --> 21:15.770
We have test.rtf and an exclamation mark and something.

21:15.810 --> 21:18.250
So, we have the file moniker and the composite moniker.

21:18.810 --> 21:22.610
The Outlook talk yesterday covered this sort of stuff a little bit as well.

21:23.070 --> 21:31.330
So, the component object model will look up whatever is after the exclamation mark, which we now potentially control through a redirect.

21:31.950 --> 21:34.370
We have three days left until Patch Tuesday.

21:34.370 --> 21:36.250
So, have fun, everyone.

21:38.550 --> 21:41.350
So, we found some more stuff.

21:41.350 --> 21:42.970
We're still bored.

21:43.450 --> 21:48.710
You can also bypass existing CVEs with that same one weird trick.

21:48.710 --> 21:55.410
So, back in 2023, some researchers at Varonis discovered a nice little CVE.

21:55.410 --> 21:59.470
There's two email headers that were sort of affected.

21:59.690 --> 22:07.190
There's the content class sharing thing, like you're sharing a document or a calendar or an RSS feed, maybe.

22:07.190 --> 22:13.790
And then a X sharing content URL, which in their case, they used a UNC path.

22:14.190 --> 22:16.530
We gave it a little HTTP path.

22:16.910 --> 22:19.710
Microsoft's fix was to add a nice little warning.

22:19.710 --> 22:20.890
They love their warnings.

22:20.890 --> 22:23.370
The please don't click me little warning.

22:24.450 --> 22:27.850
Guess what happens if you just redirect it to a UNC path?

22:29.190 --> 22:31.050
Microsoft triages it.

22:31.470 --> 22:32.710
That's what happens.

22:33.550 --> 22:35.230
And this is essentially what it looks like.

22:35.230 --> 22:38.770
It's a Microsoft instruction telling you to click a link with no warnings.

22:39.030 --> 22:40.730
Seems kind of bad, right?

22:41.050 --> 22:42.690
I would add your calendar, though.

22:43.170 --> 22:44.290
I don't know.

22:46.370 --> 22:51.770
And then we dropped it to the MSRC, and we had a fun little journey.

22:53.030 --> 22:56.950
Hi, this is Clusters Important, and you've accepted it for immediate servicing.

22:56.950 --> 22:59.570
Can you please let me know if this is eligible for a bounty?

23:00.590 --> 23:01.130
No.

23:01.130 --> 23:08.270
It says here in the link you just said that it is in scope.

23:09.010 --> 23:11.810
Uh, it's a moderate, I guess?

23:12.530 --> 23:15.750
You just told me that it was important in the same email.

23:16.350 --> 23:18.290
No, we've reclassified it, sorry.

23:19.510 --> 23:24.490
Yeah, so it was fixed last patch Tuesday, and it was the only moderate.

23:27.310 --> 23:29.030
So this is my dog, Lupe.

23:29.030 --> 23:37.090
She recently had cruciate ligament surgery, and the amount of the surgery was the same amount that a bug bounty from Microsoft would have been.

23:37.610 --> 23:40.330
So, you know, thanks, Microsoft.

23:40.550 --> 23:42.250
Sorry again, MSRC team.

23:42.250 --> 23:43.530
You're very lovely people.

23:43.530 --> 23:44.410
It's so nice.

23:44.410 --> 23:50.830
Oh, they also said something about the bug before, that it's been feature flagged, so it's mostly fixed, but sort of not.

23:50.870 --> 23:54.210
Yeah, I had to say that, because I quite like them now.

23:57.310 --> 24:11.330
So RSS, for all six of you still using it in Outlook, we discovered something called an OPML file, which allows you to import an RSS feed, which is obviously critical functionality within Outlook and Microsoft.

24:11.910 --> 24:20.110
So interestingly, the web request had been made while the warning box was showing, so full marks to Microsoft for almost getting there.

24:21.310 --> 24:29.170
Outlook would also follow a redirect path to a UNC and link a hash, and we triaged it with Microsoft, and they initially said, yeah, it's moderate.

24:29.170 --> 24:31.230
I said, cool, yeah, that makes sense.

24:31.230 --> 24:33.790
But now we know about these cool Outlook headers.

24:34.990 --> 24:40.030
So what happens if we combine URI schemes with these cool new headers that we have?

24:40.390 --> 24:44.330
Outlook has a feed handler, which will open RSS feed directly in Outlook.

24:44.870 --> 24:48.750
Obviously, four slides back is how we know about the URI handlers.

24:49.230 --> 24:53.190
Under normal circumstances, it will prompt open Outlook and give a warning.

24:53.830 --> 24:57.870
However, if you embed it in a sharing header, it won't warn.

24:58.030 --> 25:02.310
It was initially deprioritized by Microsoft as several clicks were involved.

25:02.310 --> 25:03.430
One click.

25:03.830 --> 25:06.070
It's a bug, but moderate.

25:07.010 --> 25:08.370
And this is what it looks like.

25:08.370 --> 25:11.450
Again, Microsoft wording saying, please click this thing.

25:11.450 --> 25:12.130
Would you click that?

25:12.130 --> 25:14.450
I would so click to add your RSS feed.

25:14.450 --> 25:16.070
I love RSS.

25:19.600 --> 25:21.780
Enter Visual Studio.

25:21.780 --> 25:23.300
We went back to it again.

25:24.100 --> 25:25.940
It can git clone things.

25:25.940 --> 25:32.760
I don't know if you're familiar with git, but it's kind of like subversion or Maven.

25:33.220 --> 25:34.840
No, everyone knows git.

25:36.040 --> 25:40.240
You can git clone from a bunch of things, like SSH, which is one of the normal things.

25:40.240 --> 25:45.720
Same with unauth HTTP, which is a public GitHub repo and you've just copy pasted the link.

25:45.880 --> 25:50.440
Auth HTTP, like a private GitHub repo and you've copy pasted the link.

25:50.720 --> 26:00.080
You can also git clone from a file path or on Windows you can git clone from an SMB share, which is weird, but it's fine.

26:00.080 --> 26:01.500
I'm sure people do that.

26:01.980 --> 26:04.860
But we're just going to focus on the auth HTTP.

26:05.920 --> 26:08.820
So the command line, it's secure by default.

26:08.820 --> 26:10.680
It asks for auth, kind of.

26:11.720 --> 26:14.820
But what if we just, you know, don't put in a username or password?

26:14.820 --> 26:15.560
Yeah, what if, Thomas?

26:15.560 --> 26:16.040
Let's find out.

26:16.040 --> 26:18.160
Surely it just doesn't send a username.

26:18.160 --> 26:18.960
It won't send anything.

26:20.120 --> 26:24.380
So by default, it just sends a hash of your current account.

26:27.160 --> 26:28.920
But, like, it's fine.

26:29.120 --> 26:30.880
I can see the use cases for it.

26:30.880 --> 26:36.320
Like, say you're in an internal environment and you've got, like, some weird web server you git clone from.

26:36.540 --> 26:38.380
You probably want it most.

26:39.120 --> 26:41.200
But what it is, is it's promising.

26:41.200 --> 26:48.160
Like, maybe some other things, you know, they want to get your username and password and do stuff.

26:48.460 --> 26:51.400
Like, GUIs, how do they get credentials?

26:51.440 --> 26:52.840
They prompt you for them.

26:52.840 --> 26:54.360
Uh, yeah.

26:54.360 --> 26:54.860
Yep.

26:54.860 --> 26:55.580
No.

26:55.600 --> 26:58.920
So, Git Credential Manager, it will do things for you.

26:59.000 --> 27:02.780
It will, by default, pass a blank username and password.

27:04.260 --> 27:06.700
Visual Studio uses Git Credential Manager.

27:08.000 --> 27:12.140
So, on the right, our good old friend, Responder.

27:12.720 --> 27:17.960
That's just gonna nicely listen there and then we'll open some Visual Studio.

27:20.040 --> 27:23.780
And then, oh, my coworker sent me this cool link.

27:23.780 --> 27:25.100
I'm just gonna go git clone this.

27:25.100 --> 27:26.320
It's on the internet.

27:26.320 --> 27:28.920
I blindly clone things all the time.

27:28.960 --> 27:30.940
I'm a security professional, Thomas.

27:30.940 --> 27:32.780
I do too, but, like, seriously.

27:33.500 --> 27:34.700
And, whoa, what's that?

27:34.700 --> 27:37.040
That's an NTLM hash that it just sent.

27:38.120 --> 27:39.000
Yay.

27:41.640 --> 27:43.780
So, some fun side notes.

27:43.780 --> 27:45.800
It also works in Git submodules.

27:45.800 --> 27:55.240
So, you can't just trust GitHub because you could have a nice little link to some attacker's thing as a Git submodule, like, 10 folders deep.

27:55.240 --> 27:58.940
So, do you know what blindly clones submodules by default, Thomas?

27:58.940 --> 27:59.700
Do you have any idea?

28:00.160 --> 28:01.440
Visual Studio?

28:01.700 --> 28:02.640
You are correct, Thomas.

28:02.640 --> 28:03.460
Oh, wow.

28:03.840 --> 28:06.440
It also works in things like VC Package.

28:06.440 --> 28:10.840
You can point to a Git URL and it will just also download it.

28:10.840 --> 28:13.040
NPM, also, for funsies.

28:13.780 --> 28:19.480
And other IDEs, like JetBrains and then, like, GitHub Desktop, they don't do this.

28:19.820 --> 28:23.340
So, we told Microsoft and then they came back with this fun response.

28:23.340 --> 28:25.640
We'll just give you a minute to digest this.

28:26.020 --> 28:29.820
Actually, I'll cut out the, like, extra words.

28:30.620 --> 28:35.600
Git cloning from an untrusted source is the same as browsing an untrusted SMB share.

28:36.060 --> 28:37.500
Oh, is it Microsoft?

28:37.640 --> 28:39.620
Yeah, I do that all the time, browsing un...

28:39.620 --> 28:40.100
Same.

28:40.100 --> 28:40.680
Yeah.

28:41.580 --> 28:48.500
So, we tried to find where the security boundary was after they came back.

28:48.520 --> 28:51.100
And we were like, okay.

28:51.100 --> 28:54.260
So, it's not a Visual Studio problem because they said no.

28:54.260 --> 28:56.900
So, maybe it's a Git Credential Manager problem.

28:57.340 --> 29:00.940
But then, a Credential Manager uses Git.

29:00.940 --> 29:06.120
But Git uses libcurl, which is compiled with the use-ntln flags.

29:06.260 --> 29:08.020
But it's actually a Visual Studio problem.

29:08.020 --> 29:11.840
Oh, we don't know where the problem is.

29:11.840 --> 29:13.500
It's sort of everywhere but nowhere.

29:13.500 --> 29:16.680
And no one wants to take blame for it, really.

29:17.640 --> 29:21.640
Microsoft will patch anything that you can prove that it's in their products.

29:22.660 --> 29:23.920
Anything else?

29:24.560 --> 29:25.900
That's a Windows problem.

29:25.900 --> 29:27.520
I just like the VLC team.

29:29.940 --> 29:35.220
You can use that on your next red team, I guess, if you want to hack some developers.

29:38.020 --> 29:45.340
So, where we ended up was we have four bugs reported to MS.

29:45.860 --> 29:47.800
Two bounties and one swag.

29:47.800 --> 29:50.200
I'm so sorry to my dog from the previous slides.

29:50.200 --> 29:53.240
Your surgery came later than expected for some weird reason.

29:53.760 --> 29:55.800
One, not a bug, which is Git.

29:57.120 --> 29:59.980
One, yes, it's a bug, but it's not a priority.

30:00.260 --> 30:01.080
I mean, that's fair.

30:01.080 --> 30:01.920
It's RSS.

30:02.800 --> 30:07.740
And, you know, to get to this point, we have a very, very rigorous methodology, obviously.

30:08.020 --> 30:10.180
I mean, I have a spreadsheet.

30:10.800 --> 30:13.280
It's actually a text file on my desktop.

30:16.850 --> 30:19.870
So, yeah, this is basically how we found all these bugs.

30:19.870 --> 30:27.090
Anywhere you see an HTTP, just put a responder URL and see what Windows does, and you will be delighted with the results.

30:27.090 --> 30:28.730
Image tag, do it.

30:28.730 --> 30:30.610
Sharing tag, do it.

30:30.610 --> 30:31.490
RSS.

30:31.950 --> 30:33.190
Who uses RSS?

30:33.190 --> 30:34.310
No one uses RSS.

30:36.010 --> 30:38.210
So, where to next?

30:38.650 --> 30:41.410
There are a lot of places this could be a thing.

30:41.410 --> 30:43.390
And , I mean, it's just HTTP.

30:43.510 --> 30:47.950
So , like, build servers, they can have links.

30:48.270 --> 30:48.890
Yeah.

30:50.710 --> 30:52.550
Pipelines, they could have links.

30:52.550 --> 30:56.010
Document processing things, like, I don't know, PDF generators.

30:56.150 --> 30:58.030
Yeah, they could do it, too.

30:58.650 --> 31:00.190
Maybe Word has it.

31:00.190 --> 31:01.530
Maybe Teams has it.

31:01.730 --> 31:02.870
No one uses Teams, though, so...

31:02.870 --> 31:03.850
No one uses Teams.

31:03.850 --> 31:04.370
No.

31:04.890 --> 31:06.090
Maybe video games.

31:06.090 --> 31:06.490
I don't know.

31:06.490 --> 31:07.690
Maybe drop a link in chat.

31:08.210 --> 31:13.090
Yeah, I reckon video games is something I want to look at, because I like playing video games for research.

31:13.090 --> 31:14.830
Yeah, I should do that in work time.

31:15.550 --> 31:16.610
Our boss is here.

31:18.650 --> 31:22.490
Basically, anywhere you could put a URL in is probably a good place to start.

31:22.510 --> 31:30.190
But also, we want to talk to you folks as well, because there's probably a lot of people out there who have some great ideas of where to look, so we would like to hear from them.

31:31.170 --> 31:34.210
Yeah, and just go turn NTLM off if you can.

31:34.210 --> 31:36.530
It probably will break everything, but turn it off.

31:36.530 --> 31:39.230
Turn it off and then turn it back on immediately when someone screams.

31:39.570 --> 31:42.210
Yeah , use Kerberos, because that's more secure.

31:43.650 --> 31:45.510
Anyway, this is the end of our talk.

31:45.510 --> 31:48.250
We had speedrun it, much like our NTLM bugs.

31:48.730 --> 31:53.050
But finding bugs doesn't happen in isolation, so a big thank you to everyone named.

31:54.090 --> 31:57.170
Yeah, and thank you for the MSRC for listening and meeting with us.

31:57.170 --> 31:59.170
They are genuinely good folks who...

31:59.170 --> 32:03.110
They need more of them, because there's only 30 of them, apparently, which is not nearly enough.

32:03.110 --> 32:05.350
And thanks for inviting us to your party as well.

32:05.350 --> 32:06.030
That was fun.

32:06.030 --> 32:07.150
Yeah, that was good.

32:07.210 --> 32:09.190
And thank you for everyone who has published their research.

32:09.190 --> 32:10.930
This is something I don't say lightly.

32:11.550 --> 32:16.870
Every piece of research published leads to more research, so please keep disclosing, please keep blogging.

32:16.870 --> 32:19.370
It's so good reading it.

32:20.610 --> 32:22.970
And also thank you for the DEF CON organizers.

32:23.130 --> 32:24.170
You guys are awesome.

32:24.170 --> 32:25.330
And hacking is a team sport.

32:25.330 --> 32:29.390
And please come up to us afterwards if you have any ideas where to get hashes out of.

32:29.490 --> 32:30.650
We want to know.

32:30.790 --> 32:33.170
We want more moderates that we don't get bounties for.

32:33.170 --> 32:33.930
Perfect.

32:41.380 --> 32:45.440
There is a microphone there for tall people who can ask questions.

32:57.500 --> 32:58.200
All right.

32:58.200 --> 32:59.240
Thanks, everyone.

33:00.040 --> 33:01.140
Thank you.

