1 00:00:00,820 --> 00:00:02,040 Hello everyone. 2 00:00:02,600 --> 00:00:03,380 Hello! 3 00:00:03,580 --> 00:00:05,920 Hi, so thanks for coming along today. 4 00:00:05,920 --> 00:00:10,240 We are here to talk about everyone's favourite subject from 25 years ago. 5 00:00:11,680 --> 00:00:16,140 So a friend of mine said this to me when I told him what our research was about. 6 00:00:17,060 --> 00:00:18,220 And yeah, it holds true. 7 00:00:18,220 --> 00:00:21,540 I mean, Windows has got some stuff going on. 8 00:00:21,540 --> 00:00:24,720 So let's find out exactly how broken it is. 9 00:00:25,040 --> 00:00:28,320 So real quickly, we're from there. 10 00:00:29,220 --> 00:00:31,180 That's a very accurate map. 11 00:00:31,320 --> 00:00:35,500 We're from the middle of Middle Earth, a little place called Wellington in New Zealand. 12 00:00:36,100 --> 00:00:38,540 And yeah, it was a long flight. 13 00:00:38,800 --> 00:00:39,720 It was too long. 14 00:00:39,720 --> 00:00:41,300 It was too long in economy. 15 00:00:42,040 --> 00:00:43,120 Anyway, a little bit about me. 16 00:00:43,120 --> 00:00:46,280 I've worked at a bunch of logos, which is very exciting. 17 00:00:47,360 --> 00:00:51,100 I actually had a life before hacking where I used to tour a lot of bands to New Zealand. 18 00:00:51,100 --> 00:00:56,160 So please don't ask me about the early 2000s, because I had PTSD and a lot of debt. 19 00:00:57,520 --> 00:00:59,200 I'm also a former software developer. 20 00:00:59,200 --> 00:01:01,660 I'm a relatively active security researcher. 21 00:01:01,660 --> 00:01:04,000 A few CBEs in various things. 22 00:01:04,000 --> 00:01:08,300 I'm a frequent flyer with Search New Zealand, which is the cybersecurity emergency response team. 23 00:01:08,440 --> 00:01:09,560 They love me. 24 00:01:09,620 --> 00:01:11,720 Please don't ask me about council software. 25 00:01:12,720 --> 00:01:13,880 And I'm Thomas. 26 00:01:13,880 --> 00:01:17,380 I have also worked at fewer logos than Jim. 27 00:01:17,380 --> 00:01:19,020 I'm a little bit younger than Jim. 28 00:01:19,020 --> 00:01:21,720 I also do some CTF stuff. 29 00:01:22,420 --> 00:01:25,160 And I'm also a senior security consultant. 30 00:01:25,160 --> 00:01:26,660 I also do research. 31 00:01:26,940 --> 00:01:30,500 I found a fun thing a few years ago in Kiteworks. 32 00:01:30,600 --> 00:01:34,520 Also did the Kramer thing with Jim a couple of slides ago. 33 00:01:34,520 --> 00:01:35,760 Don't know if you remember. 34 00:01:35,900 --> 00:01:38,720 And then also the Microsoft stuff in this talk. 35 00:01:39,980 --> 00:01:43,000 So this talk is about NTLM. 36 00:01:43,040 --> 00:01:45,900 NTLM is supposedly going away. 37 00:01:47,040 --> 00:01:51,760 Every NTLM bug we've seen has usually been a gateway bug to something better. 38 00:01:51,760 --> 00:01:55,060 Like usually it leads into something that's quite nice. 39 00:01:55,060 --> 00:01:56,100 Sometimes a bounty. 40 00:01:56,760 --> 00:01:59,620 It has been an absolute ride with the MSRC. 41 00:01:59,620 --> 00:02:00,940 They have a very hard job. 42 00:02:00,940 --> 00:02:02,520 We met with them the other day. 43 00:02:02,520 --> 00:02:06,000 And we did have to change some of our talk because it turns out they're actually quite nice. 44 00:02:06,000 --> 00:02:11,220 Yeah, when you like meet them and they've got faces and names, you kind of feel a little bad. 45 00:02:11,420 --> 00:02:12,040 Oops. 46 00:02:12,800 --> 00:02:17,360 Windows has an overwhelming desire to authenticate to everything that it can. 47 00:02:17,360 --> 00:02:21,760 It just likes sending hashes out like there's no tomorrow. 48 00:02:22,320 --> 00:02:26,520 And the Windows ecosystem is very vast and very fun. 49 00:02:27,840 --> 00:02:29,980 So, NTLM. 50 00:02:29,980 --> 00:02:32,360 We are not going to give it a stupid name. 51 00:02:32,820 --> 00:02:39,480 Someone called SQLI squealy and it still haunts you. 52 00:02:40,600 --> 00:02:43,720 It stands for New Technology Land Manager. 53 00:02:44,140 --> 00:02:47,000 There's something about calling things new in technology. 54 00:02:47,000 --> 00:02:49,540 That means it's going to be around forever. 55 00:02:50,480 --> 00:02:56,200 And it's up there with the simple in SNMP and lightweight in LDAP. 56 00:02:57,660 --> 00:03:02,660 So, NTLM was developed in the 90s, like a few of you here. 57 00:03:03,500 --> 00:03:05,320 It's preceded by LM. 58 00:03:05,320 --> 00:03:08,680 And this is finally completely removed in server 2025. 59 00:03:09,220 --> 00:03:10,720 So, it hasn't been removed yet. 60 00:03:11,340 --> 00:03:15,000 It was intended to provide authentication, integrity, and confidentiality. 61 00:03:15,000 --> 00:03:15,920 So far, so good. 62 00:03:15,920 --> 00:03:18,680 This is, you know, what you expect out of NTLM. 63 00:03:19,120 --> 00:03:22,000 They've recommended not to use it since 2010. 64 00:03:22,000 --> 00:03:23,860 Does anyone know what year we're in now? 65 00:03:24,720 --> 00:03:31,140 There was a 2011 DEF CON talk that I watched called, Nail the Coffin Shut, and NTLM is dead. 66 00:03:31,960 --> 00:03:34,040 It failed to die. 67 00:03:35,540 --> 00:03:40,420 So, are there a crap load of CDEs associated with this protocol? 68 00:03:40,900 --> 00:03:46,000 So, essentially at its core, it is a hash of a password, also called an NT hash. 69 00:03:46,000 --> 00:03:47,720 It's a challenge response mechanism. 70 00:03:47,720 --> 00:03:50,980 So, the client establishes a network path and negotiates. 71 00:03:50,980 --> 00:03:52,940 The server responds with a challenge message. 72 00:03:52,940 --> 00:03:55,200 The client responds with an authenticate message. 73 00:03:55,320 --> 00:03:56,980 And it does this using the NT hash. 74 00:03:56,980 --> 00: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. 75 00:04:02,760 --> 00:04:06,680 So, on a network, essentially this lets you browse file shares and websites. 76 00:04:08,240 --> 00:04:11,700 So, some quick definitions before we get stuck into the bugs. 77 00:04:11,820 --> 00:04:17,460 A hash is data produced from one-way functions, so you don't have to pass your plaintext password around. 78 00:04:17,460 --> 00: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. 79 00:04:23,260 --> 00:04:26,560 It's expensive to get the hot dog back into the cow. 80 00:04:27,140 --> 00:04:32,280 So, UNC is the Universal Naming Convention, you know, slash slash thing. 81 00:04:32,280 --> 00:04:38,120 HTTP, Hypertext Transfer Protocol, and URI, the Uniform Resource Handler. 82 00:04:38,840 --> 00:04:40,980 So, what happens if you steal one? 83 00:04:40,980 --> 00:04:42,380 There's kind of three things. 84 00:04:42,380 --> 00: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 . 85 00:04:50,260 --> 00:04:53,660 You can also relay it and pretend to be that person. 86 00:04:53,740 --> 00:04:58,440 That's mainly with NTLM and NTLM v1. 87 00:04:58,720 --> 00:05:01,540 NTLM v2 does it sometimes, just for fun. 88 00:05:01,640 --> 00:05:07,600 And you can also just take a screenshot of it, report it to the MSRC, have a fun conversation with them. 89 00:05:09,680 --> 00: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. 90 00:05:18,140 --> 00:05:21,200 There's also the MorpheSec talk that was yesterday. 91 00:05:21,200 --> 00:05:26,260 They went into some more NTLM stuff there, but it's a doozy. 92 00:05:26,260 --> 00:05:30,400 There was the MonikaLink one this year, the Windows themes file as well. 93 00:05:30,400 --> 00:05:33,860 You could just load a theme and it would send off your hash for fun. 94 00:05:34,040 --> 00: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. 95 00:05:41,160 --> 00:05:43,400 And, yeah, some other ones. 96 00:05:43,400 --> 00:05:45,220 Everyone's favorite, Petit Patin . 97 00:05:47,140 --> 00:05:50,900 So, NTLM is just a host of vulnerabilities. 98 00:05:50,900 --> 00:05:54,300 A lot of it is just by design, we won't fix it. 99 00:05:54,300 --> 00:05:56,700 I mean, it's old. 100 00:05:57,080 --> 00: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. 101 00:06:07,520 --> 00: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. 102 00:06:17,660 --> 00:06:23,480 So, we have a good authority, an anonymous source at Microsoft, who actually confirmed this for us. 103 00:06:23,480 --> 00:06:28,360 And he said to us when we met them, the runway for this is between 50 and 100 years. 104 00:06:29,800 --> 00:06:31,240 So, yeah. 105 00:06:33,770 --> 00:06:36,430 So, it's going to be disabled on a future version of Windows 11. 106 00:06:36,430 --> 00:06:37,370 This is great. 107 00:06:37,750 --> 00:06:40,430 And they have told us that they're stopping working on it. 108 00:06:40,430 --> 00:06:42,250 So, it's feature complete, apparently. 109 00:06:42,750 --> 00:06:48,190 So, now Windows will attempt to authenticate with Kerberos first, which is really secure and great. 110 00:06:48,830 --> 00:06:52,950 But it still falls back to NTLM if a Kerberos negotiation doesn't happen. 111 00:06:53,290 --> 00:06:55,430 And so, it's going to be disabled in a future release. 112 00:06:55,730 --> 00:07:00,290 And it can always be re-enabled, just like NTLM v1. 113 00:07:01,350 --> 00:07:04,890 So, one of the tools we've been using is a very, very well known tool. 114 00:07:04,890 --> 00:07:06,550 We're not going to go too much into it. 115 00:07:06,630 --> 00:07:11,530 This is Responder, the rogue authentication server developed by Elgandex. 116 00:07:11,530 --> 00:07:14,010 Please go and flick them some money for this great tool. 117 00:07:14,250 --> 00: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. 118 00:07:23,550 --> 00:07:24,770 It does some other cool stuff. 119 00:07:24,770 --> 00:07:26,270 It's a very valuable pen testing tool. 120 00:07:26,270 --> 00:07:30,350 If you've never heard of it, go run it in an internal network and frighten your SOC team. 121 00:07:30,770 --> 00:07:33,490 For our purposes, we're just going to use it to collect hashes. 122 00:07:34,630 --> 00:07:39,930 So, this current obsession with NTLM hashes started a couple of years ago. 123 00:07:40,130 --> 00:07:42,650 I was testing an ArcGIS application. 124 00:07:42,650 --> 00:07:48,770 For those of you not familiar with ArcGIS, it's mapping software beloved by local government. 125 00:07:49,230 --> 00:07:52,230 I asked my workmate, Amad, if he had any tricks. 126 00:07:52,230 --> 00:07:56,450 He was a very high ranked bug crowd guy, so of course he did. 127 00:07:56,670 --> 00:08:01,610 He suggested I run Responder on one of our servers for a blind SSRF that we had found. 128 00:08:02,550 --> 00:08:04,330 And we got a hash on port 80. 129 00:08:04,930 --> 00:08:08,010 But ArcGIS is running Java on IIS. 130 00:08:08,950 --> 00:08:11,030 So, now we wanted to speed run. 131 00:08:11,030 --> 00:08:18,670 In case you're wondering what RSS and ArcGIS looks like, you can specify an RSS URL for some obscure reason. 132 00:08:20,590 --> 00:08:21,770 So, yeah. 133 00:08:21,910 --> 00:08:24,430 Sorry about the NTLM bugs, everyone. 134 00:08:26,190 --> 00:08:29,050 So, Windows does want you to be safe. 135 00:08:29,050 --> 00:08:31,130 They do have some built in protections. 136 00:08:31,130 --> 00:08:34,550 One of them is Mark of the Web, which you might have seen before. 137 00:08:34,690 --> 00: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. 138 00:08:41,930 --> 00:08:46,630 And basically it just says, nah, I'm not going to use all of the features. 139 00:08:46,630 --> 00:08:48,950 I'm just going to let you briefly look at it. 140 00:08:48,950 --> 00:08:52,690 You can click the little warning to make it go away, but it's safe. 141 00:08:53,810 --> 00:08:58,470 The WordPad issue that I mentioned earlier, that just bypassed it. 142 00:08:58,470 --> 00:09:01,030 I don't think they even had Mark of the Web on WordPad files. 143 00:09:01,030 --> 00:09:01,730 Oh, no. 144 00:09:01,790 --> 00:09:02,370 No. 145 00:09:03,050 --> 00: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. 146 00:09:08,990 --> 00:09:09,830 It's great. 147 00:09:10,970 --> 00:09:16,250 They also have this from, what, Windows NT days? 148 00:09:16,930 --> 00:09:18,630 They're called Safe Zones. 149 00:09:19,130 --> 00:09:20,650 This is a recent screenshot, Thomas. 150 00:09:20,650 --> 00:09:25,630 Yeah, this is from Windows 11, as you can see, with the little Xs in the top right hand corner. 151 00:09:27,270 --> 00: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. 152 00:09:34,750 --> 00: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. 153 00:09:43,570 --> 00:09:48,470 So, it's time to query some hashes from some software before MTLM goes away. 154 00:09:48,990 --> 00:09:50,350 So, we're going to talk about a few things. 155 00:09:50,430 --> 00: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. 156 00:10:11,150 --> 00:10:18,730 So, GraphicsMagick is generally regarded as the safer one because it's a relatively fuzzed fork of ImageMagick. 157 00:10:18,730 --> 00:10:21,790 So, it's a massive attack surface. 158 00:10:22,310 --> 00:10:27,410 ImageMagick is generally associated with ImageTragic, which everyone will remember from a few years ago. 159 00:10:28,290 --> 00:10:31,430 But ImageMagick didn't leak a hash over port 445. 160 00:10:32,330 --> 00:10:37,930 So, it will leak a hash by SVG converting to anything via a UNC path href. 161 00:10:38,170 --> 00:10:44,170 And it's noted in the documentation as SSRF, but there is nothing about hashes or UNC paths. 162 00:10:46,090 --> 00:10:47,450 VLC player. 163 00:10:47,690 --> 00: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. 164 00:10:54,610 --> 00:11:00,370 Our old workmate, Amit, he disclosed that and then VLC were like, it's a Windows problem. 165 00:11:00,370 --> 00:11:02,410 No, it's a VLC problem. 166 00:11:02,690 --> 00:11:05,870 I mean, it's also a Windows problem, but come on guys. 167 00:11:06,250 --> 00:11:09,310 You could also do it in iTunes and Windows Media Player. 168 00:11:09,310 --> 00:11:12,030 I'm sorry if you still use those programs. 169 00:11:12,390 --> 00:11:17,170 There's probably maybe six of you in the audience that still use Windows Media Player and iTunes for Windows. 170 00:11:17,170 --> 00:11:18,050 I'm sorry. 171 00:11:18,450 --> 00:11:22,970 There's also lots of other formats and protocols that may or may not support NTLM. 172 00:11:22,970 --> 00:11:26,650 I mean, I'd tell you to go and look at them, but VLC don't care. 173 00:11:28,890 --> 00:11:33,670 So, Aspose.net is a lovely piece of document processing software. 174 00:11:33,670 --> 00: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. 175 00:11:40,390 --> 00:11:43,590 It has a few known documented security issues. 176 00:11:44,590 --> 00: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. 177 00:11:53,030 --> 00:11:56,170 So, they know about them and they have front footed it. 178 00:11:57,610 --> 00:12:03,210 So, leaking hashes at port 4.5 is relatively abundant and low value within an ecosystem. 179 00:12:03,690 --> 00: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. 180 00:12:10,790 --> 00:12:13,350 Port 80, however, is not as blocked. 181 00:12:13,370 --> 00:12:18,890 So, when Windows sees a UNC path, those little slashes we saw before, it only knows how to do one thing. 182 00:12:19,130 --> 00:12:22,930 And it takes a little bit of work to get it out by HTTP. 183 00:12:23,070 --> 00:12:23,890 So, let's try. 184 00:12:24,810 --> 00: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. 185 00:12:32,450 --> 00:12:38,170 So, there's a piece of software in Aotearoa, New Zealand called ISO plan developed by a company called ISOVIST. 186 00:12:38,450 --> 00:12:41,370 So, again, I alluded to not talking to you about council software. 187 00:12:41,370 --> 00: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. 188 00:12:49,990 --> 00: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. 189 00:12:57,270 --> 00:12:58,590 Yeah, you could just tell. 190 00:12:59,790 --> 00:13:03,310 So, headless PDF generation is so dumb. 191 00:13:03,970 --> 00:13:06,090 This is not a talk about headless PDF generation. 192 00:13:06,090 --> 00: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, 193 00:13:22,650 --> 00:13:24,770 such as iframes, portals, embeds. 194 00:13:24,770 --> 00:13:26,430 So, these have all been blocked. 195 00:13:26,570 --> 00:13:28,950 There had been some hardening done, which is great. 196 00:13:29,910 --> 00:13:32,850 However, cat pictures were not blocked. 197 00:13:33,850 --> 00:13:39,590 So, I managed to get an image tag to give up an NTLM hash on port 80. 198 00:13:40,970 --> 00:13:45,070 So, my first question was, what even is this? 199 00:13:46,310 --> 00:13:48,670 So, we talked about HiQ PDF. 200 00:13:49,270 --> 00:13:51,630 Over a million downloads in NuGet for this package. 201 00:13:51,630 --> 00:13:54,470 NuGet is the package repo for .NET. 202 00:13:54,770 --> 00:14:02,410 It has a settings .xml file, and the default property for NTLM authentication is true. 203 00:14:02,630 --> 00:14:06,790 So, I guess I really just wanted to know how this happened. 204 00:14:06,910 --> 00:14:10,790 And then I looked into it a bit, and I figured out how it happened. 205 00:14:11,550 --> 00:14:15,150 You can tell it's really high quality by the 3D rendered box art. 206 00:14:15,170 --> 00:14:17,650 This is the very height of technology. 207 00:14:19,790 --> 00: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. 208 00:14:26,370 --> 00:14:30,530 The HTTP URL connection function used to pass hashes by default. 209 00:14:30,650 --> 00:14:32,390 We're not entirely sure it does now. 210 00:14:32,390 --> 00:14:34,770 I tried a couple of test projects to see. 211 00:14:34,770 --> 00:14:38,290 It seems to be safe, but it is still out there causing issues. 212 00:14:38,290 --> 00:14:40,630 See GeoServer and ArcGIS. 213 00:14:41,010 --> 00:14:45,790 So, Java calls the underlying Win32 API, which is a WinHTTP request. 214 00:14:45,790 --> 00: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. 215 00:14:55,970 --> 00:14:59,270 We have to do a little Lord of the Rings meme. 216 00:15:00,130 --> 00:15:02,070 We're from New Zealand, we have to. 217 00:15:03,670 --> 00: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. 218 00:15:12,530 --> 00:15:16,710 And it's like, please don't quit me, it's unsafe, do you really want to continue? 219 00:15:16,710 --> 00:15:18,710 Are you sure you want to get hacked? 220 00:15:18,710 --> 00:15:21,290 And I'm sure no one clicks yes ever, right? 221 00:15:21,290 --> 00:15:22,850 Yeah, it's a security control. 222 00:15:23,190 --> 00:15:24,270 I mean, it's fair. 223 00:15:24,270 --> 00:15:25,730 It's probably what their lawyers want. 224 00:15:25,730 --> 00: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. 225 00:15:32,930 --> 00:15:38,370 So, if you want to have a bug in a Microsoft product, you need to get past this. 226 00:15:38,770 --> 00: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. 227 00:15:47,310 --> 00:15:51,250 So, with that in mind, let's see what we can find in the Microsoft ecosystem. 228 00:15:53,010 --> 00:15:55,030 Enter iCredentials. 229 00:15:55,030 --> 00:16:02,650 So, it's just an interface, but it does some stuff. 230 00:16:02,890 --> 00:16:09,190 When we first got some hashes out on port 80, we started looking at the code and going, what is this? 231 00:16:09,330 --> 00:16:11,010 Why is this? 232 00:16:11,010 --> 00:16:13,710 Turns out it's not banana water. 233 00:16:13,710 --> 00:16:17,010 It's not gross and made up. 234 00:16:17,270 --> 00:16:20,850 It's just developers making logic errors, doing dumb things. 235 00:16:20,850 --> 00:16:26,570 It provides the base authentication interface for retrieving credentials for web client authentication. 236 00:16:27,830 --> 00:16:30,250 And it's used in .NET a lot. 237 00:16:30,250 --> 00:16:37,010 And some of the anti-patterns that it has are weird and they fall back to some dumb things. 238 00:16:37,170 --> 00:16:38,850 Like in NuGet. 239 00:16:38,990 --> 00:16:43,110 So, you've probably seen NuGet before if you've ever touched C Sharp. 240 00:16:43,110 --> 00:16:47,290 It's reasonably integral to the .NET ecosystem. 241 00:16:48,590 --> 00:16:52,710 And they have some very good advice for storing credentials. 242 00:16:52,710 --> 00:16:57,170 Just put them in the NuGet config file, it will encrypt it, it will be fine. 243 00:16:57,210 --> 00:17:00,830 But it also just falls back to NTLM sometimes. 244 00:17:00,830 --> 00:17:04,430 I would like 500 of my coworkers' hashes, please. 245 00:17:05,550 --> 00:17:08,490 It does it on NuGet restore, by the way. 246 00:17:08,510 --> 00:17:13,570 Which it does it when you get cloned something in like Visual Studio. 247 00:17:14,010 --> 00:17:16,510 And that bypasses all safety checks. 248 00:17:16,510 --> 00:17:18,930 There's no little don't click me button. 249 00:17:19,610 --> 00:17:22,390 So, Jim got a nice new e-bike from Microsoft. 250 00:17:22,390 --> 00:17:23,690 It's very zippy. 251 00:17:26,490 --> 00:17:29,710 Jim had to be very specific with Microsoft. 252 00:17:30,990 --> 00:17:34,050 Yeah, I had to make him a video with the breakpoint set. 253 00:17:34,050 --> 00:17:35,670 And I had to be like, it happens here. 254 00:17:35,670 --> 00:17:36,770 This is where it happens. 255 00:17:36,770 --> 00:17:38,370 It happens right here, Microsoft. 256 00:17:38,370 --> 00:17:39,230 Please believe me. 257 00:17:41,250 --> 00:17:43,930 So, just we had a random thought. 258 00:17:43,930 --> 00:17:47,230 Like, what if we reframe it as an SSRF problem? 259 00:17:47,230 --> 00: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? 260 00:17:56,590 --> 00:18:03,170 There's a lot of harmless HTTP interactions in Microsoft products like RSS, don't know why I'm mentioning that. 261 00:18:03,630 --> 00:18:06,670 URI schemes, don't know why I'm mentioning that either. 262 00:18:07,190 --> 00:18:10,090 And web service in Excel, I'm just mentioning that one. 263 00:18:10,590 --> 00:18:16,730 If you think of these interactions like a flavor of SSRF, you can just find some new cool things. 264 00:18:17,510 --> 00:18:20,930 Like, what if you just suddenly redirect a resource? 265 00:18:20,930 --> 00:18:22,750 So, we did that. 266 00:18:22,750 --> 00:18:30,670 We redirected things to a nice little UNC path and it just does things. 267 00:18:30,670 --> 00:18:34,310 It just happily switches protocols and tries to auth. 268 00:18:34,510 --> 00:18:35,550 Browsers don't do that. 269 00:18:35,550 --> 00:18:38,570 Browsers go like, where are you trying to go? 270 00:18:38,570 --> 00:18:40,510 This is a dangerous redirect. 271 00:18:40,790 --> 00:18:41,630 Yeah. 272 00:18:42,590 --> 00:18:48,410 But we wrote some quick little code and then started pointing things at it. 273 00:18:49,430 --> 00:18:52,350 So, this is Microsoft bug number two. 274 00:18:52,810 --> 00:18:55,790 So, we might have rabbit holed a little bit with the URI handlers. 275 00:18:55,790 --> 00: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. 276 00:19:05,630 --> 00: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. 277 00:19:13,790 --> 00:19:19,370 And it was nearly all of them, except for the Microsoft URI schemes, which was very weird. 278 00:19:19,610 --> 00: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. 279 00:19:28,730 --> 00:19:33,030 So, now we have a little bit of an idea what to do when we fetch remote resources. 280 00:19:33,850 --> 00:19:39,450 So, no warnings, one click, embedded in an email should be a relatively safe thing to do. 281 00:19:40,530 --> 00:19:43,070 So, they've asked us to not spill the beans. 282 00:19:43,070 --> 00:19:45,970 So, could everyone just, like, block their eyes and ears? 283 00:19:46,630 --> 00:19:47,250 Yeah. 284 00:19:47,750 --> 00:19:50,670 There are some security controls in place. 285 00:19:50,870 --> 00:19:53,170 All files will open in a preview mode, which is good. 286 00:19:53,170 --> 00:19:54,970 Mark of the web is on it. 287 00:19:54,970 --> 00: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. 288 00:20:01,370 --> 00:20:03,650 So, the URI handlers essentially look like this. 289 00:20:03,650 --> 00: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. 290 00:20:13,650 --> 00:20:18,210 And you can also force a file extension change, which is quite fun. 291 00:20:19,790 --> 00:20:21,970 And here's a little video of this happening. 292 00:20:23,830 --> 00: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. 293 00:20:35,830 --> 00:20:37,110 I would click that link. 294 00:20:37,110 --> 00:20:38,650 I'll totally click that link. 295 00:20:39,330 --> 00:20:40,830 And then we link someone's hash. 296 00:20:46,150 --> 00:20:48,110 Thank you, everyone. 297 00:20:48,770 --> 00:20:53,830 So, there are some much better NTLM-related bugs than the ones we've been showing. 298 00:20:53,830 --> 00:20:58,730 Hafei Lee from Checkpoint Research discovered a bug called moniker link. 299 00:20:59,210 --> 00:21:03,850 And so, this technique allows for a different and usually blocked file extension to be loaded. 300 00:21:03,850 --> 00:21:07,510 So, a whole new class of bug comes into play. 301 00:21:08,390 --> 00:21:10,430 In 2024, moniker link came up. 302 00:21:10,430 --> 00:21:12,490 So, we have two things. 303 00:21:12,490 --> 00:21:15,770 We have test.rtf and an exclamation mark and something. 304 00:21:15,810 --> 00:21:18,250 So, we have the file moniker and the composite moniker. 305 00:21:18,810 --> 00:21:22,610 The Outlook talk yesterday covered this sort of stuff a little bit as well. 306 00:21:23,070 --> 00: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. 307 00:21:31,950 --> 00:21:34,370 We have three days left until Patch Tuesday. 308 00:21:34,370 --> 00:21:36,250 So, have fun, everyone. 309 00:21:38,550 --> 00:21:41,350 So, we found some more stuff. 310 00:21:41,350 --> 00:21:42,970 We're still bored. 311 00:21:43,450 --> 00:21:48,710 You can also bypass existing CVEs with that same one weird trick. 312 00:21:48,710 --> 00:21:55,410 So, back in 2023, some researchers at Varonis discovered a nice little CVE. 313 00:21:55,410 --> 00:21:59,470 There's two email headers that were sort of affected. 314 00:21:59,690 --> 00:22:07,190 There's the content class sharing thing, like you're sharing a document or a calendar or an RSS feed, maybe. 315 00:22:07,190 --> 00:22:13,790 And then a X sharing content URL, which in their case, they used a UNC path. 316 00:22:14,190 --> 00:22:16,530 We gave it a little HTTP path. 317 00:22:16,910 --> 00:22:19,710 Microsoft's fix was to add a nice little warning. 318 00:22:19,710 --> 00:22:20,890 They love their warnings. 319 00:22:20,890 --> 00:22:23,370 The please don't click me little warning. 320 00:22:24,450 --> 00:22:27,850 Guess what happens if you just redirect it to a UNC path? 321 00:22:29,190 --> 00:22:31,050 Microsoft triages it. 322 00:22:31,470 --> 00:22:32,710 That's what happens. 323 00:22:33,550 --> 00:22:35,230 And this is essentially what it looks like. 324 00:22:35,230 --> 00:22:38,770 It's a Microsoft instruction telling you to click a link with no warnings. 325 00:22:39,030 --> 00:22:40,730 Seems kind of bad, right? 326 00:22:41,050 --> 00:22:42,690 I would add your calendar, though. 327 00:22:43,170 --> 00:22:44,290 I don't know. 328 00:22:46,370 --> 00:22:51,770 And then we dropped it to the MSRC, and we had a fun little journey. 329 00:22:53,030 --> 00:22:56,950 Hi, this is Clusters Important, and you've accepted it for immediate servicing. 330 00:22:56,950 --> 00:22:59,570 Can you please let me know if this is eligible for a bounty? 331 00:23:00,590 --> 00:23:01,130 No. 332 00:23:01,130 --> 00:23:08,270 It says here in the link you just said that it is in scope. 333 00:23:09,010 --> 00:23:11,810 Uh, it's a moderate, I guess? 334 00:23:12,530 --> 00:23:15,750 You just told me that it was important in the same email. 335 00:23:16,350 --> 00:23:18,290 No, we've reclassified it, sorry. 336 00:23:19,510 --> 00:23:24,490 Yeah, so it was fixed last patch Tuesday, and it was the only moderate. 337 00:23:27,310 --> 00:23:29,030 So this is my dog, Lupe. 338 00:23:29,030 --> 00: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. 339 00:23:37,610 --> 00:23:40,330 So, you know, thanks, Microsoft. 340 00:23:40,550 --> 00:23:42,250 Sorry again, MSRC team. 341 00:23:42,250 --> 00:23:43,530 You're very lovely people. 342 00:23:43,530 --> 00:23:44,410 It's so nice. 343 00:23:44,410 --> 00: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. 344 00:23:50,870 --> 00:23:54,210 Yeah, I had to say that, because I quite like them now. 345 00:23:57,310 --> 00: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. 346 00:24:11,910 --> 00: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. 347 00:24:21,310 --> 00: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. 348 00:24:29,170 --> 00:24:31,230 I said, cool, yeah, that makes sense. 349 00:24:31,230 --> 00:24:33,790 But now we know about these cool Outlook headers. 350 00:24:34,990 --> 00:24:40,030 So what happens if we combine URI schemes with these cool new headers that we have? 351 00:24:40,390 --> 00:24:44,330 Outlook has a feed handler, which will open RSS feed directly in Outlook. 352 00:24:44,870 --> 00:24:48,750 Obviously, four slides back is how we know about the URI handlers. 353 00:24:49,230 --> 00:24:53,190 Under normal circumstances, it will prompt open Outlook and give a warning. 354 00:24:53,830 --> 00:24:57,870 However, if you embed it in a sharing header, it won't warn. 355 00:24:58,030 --> 00:25:02,310 It was initially deprioritized by Microsoft as several clicks were involved. 356 00:25:02,310 --> 00:25:03,430 One click. 357 00:25:03,830 --> 00:25:06,070 It's a bug, but moderate. 358 00:25:07,010 --> 00:25:08,370 And this is what it looks like. 359 00:25:08,370 --> 00:25:11,450 Again, Microsoft wording saying, please click this thing. 360 00:25:11,450 --> 00:25:12,130 Would you click that? 361 00:25:12,130 --> 00:25:14,450 I would so click to add your RSS feed. 362 00:25:14,450 --> 00:25:16,070 I love RSS. 363 00:25:19,600 --> 00:25:21,780 Enter Visual Studio. 364 00:25:21,780 --> 00:25:23,300 We went back to it again. 365 00:25:24,100 --> 00:25:25,940 It can git clone things. 366 00:25:25,940 --> 00:25:32,760 I don't know if you're familiar with git, but it's kind of like subversion or Maven. 367 00:25:33,220 --> 00:25:34,840 No, everyone knows git. 368 00:25:36,040 --> 00:25:40,240 You can git clone from a bunch of things, like SSH, which is one of the normal things. 369 00:25:40,240 --> 00:25:45,720 Same with unauth HTTP, which is a public GitHub repo and you've just copy pasted the link. 370 00:25:45,880 --> 00:25:50,440 Auth HTTP, like a private GitHub repo and you've copy pasted the link. 371 00:25:50,720 --> 00: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. 372 00:26:00,080 --> 00:26:01,500 I'm sure people do that. 373 00:26:01,980 --> 00:26:04,860 But we're just going to focus on the auth HTTP. 374 00:26:05,920 --> 00:26:08,820 So the command line, it's secure by default. 375 00:26:08,820 --> 00:26:10,680 It asks for auth, kind of. 376 00:26:11,720 --> 00:26:14,820 But what if we just, you know, don't put in a username or password? 377 00:26:14,820 --> 00:26:15,560 Yeah, what if, Thomas? 378 00:26:15,560 --> 00:26:16,040 Let's find out. 379 00:26:16,040 --> 00:26:18,160 Surely it just doesn't send a username. 380 00:26:18,160 --> 00:26:18,960 It won't send anything. 381 00:26:20,120 --> 00:26:24,380 So by default, it just sends a hash of your current account. 382 00:26:27,160 --> 00:26:28,920 But, like, it's fine. 383 00:26:29,120 --> 00:26:30,880 I can see the use cases for it. 384 00:26:30,880 --> 00:26:36,320 Like, say you're in an internal environment and you've got, like, some weird web server you git clone from. 385 00:26:36,540 --> 00:26:38,380 You probably want it most. 386 00:26:39,120 --> 00:26:41,200 But what it is, is it's promising. 387 00:26:41,200 --> 00:26:48,160 Like, maybe some other things, you know, they want to get your username and password and do stuff. 388 00:26:48,460 --> 00:26:51,400 Like, GUIs, how do they get credentials? 389 00:26:51,440 --> 00:26:52,840 They prompt you for them. 390 00:26:52,840 --> 00:26:54,360 Uh, yeah. 391 00:26:54,360 --> 00:26:54,860 Yep. 392 00:26:54,860 --> 00:26:55,580 No. 393 00:26:55,600 --> 00:26:58,920 So, Git Credential Manager, it will do things for you. 394 00:26:59,000 --> 00:27:02,780 It will, by default, pass a blank username and password. 395 00:27:04,260 --> 00:27:06,700 Visual Studio uses Git Credential Manager. 396 00:27:08,000 --> 00:27:12,140 So, on the right, our good old friend, Responder. 397 00:27:12,720 --> 00:27:17,960 That's just gonna nicely listen there and then we'll open some Visual Studio. 398 00:27:20,040 --> 00:27:23,780 And then, oh, my coworker sent me this cool link. 399 00:27:23,780 --> 00:27:25,100 I'm just gonna go git clone this. 400 00:27:25,100 --> 00:27:26,320 It's on the internet. 401 00:27:26,320 --> 00:27:28,920 I blindly clone things all the time. 402 00:27:28,960 --> 00:27:30,940 I'm a security professional, Thomas. 403 00:27:30,940 --> 00:27:32,780 I do too, but, like, seriously. 404 00:27:33,500 --> 00:27:34,700 And, whoa, what's that? 405 00:27:34,700 --> 00:27:37,040 That's an NTLM hash that it just sent. 406 00:27:38,120 --> 00:27:39,000 Yay. 407 00:27:41,640 --> 00:27:43,780 So, some fun side notes. 408 00:27:43,780 --> 00:27:45,800 It also works in Git submodules. 409 00:27:45,800 --> 00: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. 410 00:27:55,240 --> 00:27:58,940 So, do you know what blindly clones submodules by default, Thomas? 411 00:27:58,940 --> 00:27:59,700 Do you have any idea? 412 00:28:00,160 --> 00:28:01,440 Visual Studio? 413 00:28:01,700 --> 00:28:02,640 You are correct, Thomas. 414 00:28:02,640 --> 00:28:03,460 Oh, wow. 415 00:28:03,840 --> 00:28:06,440 It also works in things like VC Package. 416 00:28:06,440 --> 00:28:10,840 You can point to a Git URL and it will just also download it. 417 00:28:10,840 --> 00:28:13,040 NPM, also, for funsies. 418 00:28:13,780 --> 00:28:19,480 And other IDEs, like JetBrains and then, like, GitHub Desktop, they don't do this. 419 00:28:19,820 --> 00:28:23,340 So, we told Microsoft and then they came back with this fun response. 420 00:28:23,340 --> 00:28:25,640 We'll just give you a minute to digest this. 421 00:28:26,020 --> 00:28:29,820 Actually, I'll cut out the, like, extra words. 422 00:28:30,620 --> 00:28:35,600 Git cloning from an untrusted source is the same as browsing an untrusted SMB share. 423 00:28:36,060 --> 00:28:37,500 Oh, is it Microsoft? 424 00:28:37,640 --> 00:28:39,620 Yeah, I do that all the time, browsing un... 425 00:28:39,620 --> 00:28:40,100 Same. 426 00:28:40,100 --> 00:28:40,680 Yeah. 427 00:28:41,580 --> 00:28:48,500 So, we tried to find where the security boundary was after they came back. 428 00:28:48,520 --> 00:28:51,100 And we were like, okay. 429 00:28:51,100 --> 00:28:54,260 So, it's not a Visual Studio problem because they said no. 430 00:28:54,260 --> 00:28:56,900 So, maybe it's a Git Credential Manager problem. 431 00:28:57,340 --> 00:29:00,940 But then, a Credential Manager uses Git. 432 00:29:00,940 --> 00:29:06,120 But Git uses libcurl, which is compiled with the use-ntln flags. 433 00:29:06,260 --> 00:29:08,020 But it's actually a Visual Studio problem. 434 00:29:08,020 --> 00:29:11,840 Oh, we don't know where the problem is. 435 00:29:11,840 --> 00:29:13,500 It's sort of everywhere but nowhere. 436 00:29:13,500 --> 00:29:16,680 And no one wants to take blame for it, really. 437 00:29:17,640 --> 00:29:21,640 Microsoft will patch anything that you can prove that it's in their products. 438 00:29:22,660 --> 00:29:23,920 Anything else? 439 00:29:24,560 --> 00:29:25,900 That's a Windows problem. 440 00:29:25,900 --> 00:29:27,520 I just like the VLC team. 441 00:29:29,940 --> 00:29:35,220 You can use that on your next red team, I guess, if you want to hack some developers. 442 00:29:38,020 --> 00:29:45,340 So, where we ended up was we have four bugs reported to MS. 443 00:29:45,860 --> 00:29:47,800 Two bounties and one swag. 444 00:29:47,800 --> 00:29:50,200 I'm so sorry to my dog from the previous slides. 445 00:29:50,200 --> 00:29:53,240 Your surgery came later than expected for some weird reason. 446 00:29:53,760 --> 00:29:55,800 One, not a bug, which is Git. 447 00:29:57,120 --> 00:29:59,980 One, yes, it's a bug, but it's not a priority. 448 00:30:00,260 --> 00:30:01,080 I mean, that's fair. 449 00:30:01,080 --> 00:30:01,920 It's RSS. 450 00:30:02,800 --> 00:30:07,740 And, you know, to get to this point, we have a very, very rigorous methodology, obviously. 451 00:30:08,020 --> 00:30:10,180 I mean, I have a spreadsheet. 452 00:30:10,800 --> 00:30:13,280 It's actually a text file on my desktop. 453 00:30:16,850 --> 00:30:19,870 So, yeah, this is basically how we found all these bugs. 454 00:30:19,870 --> 00: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. 455 00:30:27,090 --> 00:30:28,730 Image tag, do it. 456 00:30:28,730 --> 00:30:30,610 Sharing tag, do it. 457 00:30:30,610 --> 00:30:31,490 RSS. 458 00:30:31,950 --> 00:30:33,190 Who uses RSS? 459 00:30:33,190 --> 00:30:34,310 No one uses RSS. 460 00:30:36,010 --> 00:30:38,210 So, where to next? 461 00:30:38,650 --> 00:30:41,410 There are a lot of places this could be a thing. 462 00:30:41,410 --> 00:30:43,390 And , I mean, it's just HTTP. 463 00:30:43,510 --> 00:30:47,950 So , like, build servers, they can have links. 464 00:30:48,270 --> 00:30:48,890 Yeah. 465 00:30:50,710 --> 00:30:52,550 Pipelines, they could have links. 466 00:30:52,550 --> 00:30:56,010 Document processing things, like, I don't know, PDF generators. 467 00:30:56,150 --> 00:30:58,030 Yeah, they could do it, too. 468 00:30:58,650 --> 00:31:00,190 Maybe Word has it. 469 00:31:00,190 --> 00:31:01,530 Maybe Teams has it. 470 00:31:01,730 --> 00:31:02,870 No one uses Teams, though, so... 471 00:31:02,870 --> 00:31:03,850 No one uses Teams. 472 00:31:03,850 --> 00:31:04,370 No. 473 00:31:04,890 --> 00:31:06,090 Maybe video games. 474 00:31:06,090 --> 00:31:06,490 I don't know. 475 00:31:06,490 --> 00:31:07,690 Maybe drop a link in chat. 476 00:31:08,210 --> 00:31:13,090 Yeah, I reckon video games is something I want to look at, because I like playing video games for research. 477 00:31:13,090 --> 00:31:14,830 Yeah, I should do that in work time. 478 00:31:15,550 --> 00:31:16,610 Our boss is here. 479 00:31:18,650 --> 00:31:22,490 Basically, anywhere you could put a URL in is probably a good place to start. 480 00:31:22,510 --> 00: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. 481 00:31:31,170 --> 00:31:34,210 Yeah, and just go turn NTLM off if you can. 482 00:31:34,210 --> 00:31:36,530 It probably will break everything, but turn it off. 483 00:31:36,530 --> 00:31:39,230 Turn it off and then turn it back on immediately when someone screams. 484 00:31:39,570 --> 00:31:42,210 Yeah , use Kerberos, because that's more secure. 485 00:31:43,650 --> 00:31:45,510 Anyway, this is the end of our talk. 486 00:31:45,510 --> 00:31:48,250 We had speedrun it, much like our NTLM bugs. 487 00:31:48,730 --> 00:31:53,050 But finding bugs doesn't happen in isolation, so a big thank you to everyone named. 488 00:31:54,090 --> 00:31:57,170 Yeah, and thank you for the MSRC for listening and meeting with us. 489 00:31:57,170 --> 00:31:59,170 They are genuinely good folks who... 490 00:31:59,170 --> 00:32:03,110 They need more of them, because there's only 30 of them, apparently, which is not nearly enough. 491 00:32:03,110 --> 00:32:05,350 And thanks for inviting us to your party as well. 492 00:32:05,350 --> 00:32:06,030 That was fun. 493 00:32:06,030 --> 00:32:07,150 Yeah, that was good. 494 00:32:07,210 --> 00:32:09,190 And thank you for everyone who has published their research. 495 00:32:09,190 --> 00:32:10,930 This is something I don't say lightly. 496 00:32:11,550 --> 00:32:16,870 Every piece of research published leads to more research, so please keep disclosing, please keep blogging. 497 00:32:16,870 --> 00:32:19,370 It's so good reading it. 498 00:32:20,610 --> 00:32:22,970 And also thank you for the DEF CON organizers. 499 00:32:23,130 --> 00:32:24,170 You guys are awesome. 500 00:32:24,170 --> 00:32:25,330 And hacking is a team sport. 501 00:32:25,330 --> 00:32:29,390 And please come up to us afterwards if you have any ideas where to get hashes out of. 502 00:32:29,490 --> 00:32:30,650 We want to know. 503 00:32:30,790 --> 00:32:33,170 We want more moderates that we don't get bounties for. 504 00:32:33,170 --> 00:32:33,930 Perfect. 505 00:32:41,380 --> 00:32:45,440 There is a microphone there for tall people who can ask questions. 506 00:32:57,500 --> 00:32:58,200 All right. 507 00:32:58,200 --> 00:32:59,240 Thanks, everyone. 508 00:33:00,040 --> 00:33:01,140 Thank you.