Hello everyone. Hello! Hi, so thanks for coming along today. We are here to talk about everyone's favourite subject from 25 years ago. So a friend of mine said this to me when I told him what our research was about. And yeah, it holds true. I mean, Windows has got some stuff going on. So let's find out exactly how broken it is. So real quickly, we're from there. That's a very accurate map. We're from the middle of Middle Earth, a little place called Wellington in New Zealand. And yeah, it was a long flight. It was too long. It was too long in economy. Anyway, a little bit about me. I've worked at a bunch of logos, which is very exciting. I actually had a life before hacking where I used to tour a lot of bands to New Zealand. So please don't ask me about the early 2000s, because I had PTSD and a lot of debt. I'm also a former software developer. I'm a relatively active security researcher. A few CBEs in various things. I'm a frequent flyer with Search New Zealand, which is the cybersecurity emergency response team. They love me. Please don't ask me about council software. And I'm Thomas. I have also worked at fewer logos than Jim. I'm a little bit younger than Jim. I also do some CTF stuff. And I'm also a senior security consultant. I also do research. I found a fun thing a few years ago in Kiteworks. Also did the Kramer thing with Jim a couple of slides ago. Don't know if you remember. And then also the Microsoft stuff in this talk. So this talk is about NTLM. NTLM is supposedly going away. Every NTLM bug we've seen has usually been a gateway bug to something better. Like usually it leads into something that's quite nice. Sometimes a bounty. It has been an absolute ride with the MSRC. They have a very hard job. We met with them the other day. And we did have to change some of our talk because it turns out they're actually quite nice. Yeah, when you like meet them and they've got faces and names, you kind of feel a little bad. Oops. Windows has an overwhelming desire to authenticate to everything that it can. It just likes sending hashes out like there's no tomorrow. And the Windows ecosystem is very vast and very fun. So, NTLM. We are not going to give it a stupid name. Someone called SQLI squealy and it still haunts you. It stands for New Technology Land Manager. There's something about calling things new in technology. That means it's going to be around forever. And it's up there with the simple in SNMP and lightweight in LDAP. So, NTLM was developed in the 90s, like a few of you here. It's preceded by LM. And this is finally completely removed in server 2025. So, it hasn't been removed yet. It was intended to provide authentication, integrity, and confidentiality. So far, so good. This is, you know, what you expect out of NTLM. They've recommended not to use it since 2010. Does anyone know what year we're in now? There was a 2011 DEF CON talk that I watched called, Nail the Coffin Shut, and NTLM is dead. It failed to die. So, are there a crap load of CDEs associated with this protocol? So, essentially at its core, it is a hash of a password, also called an NT hash. It's a challenge response mechanism. So, the client establishes a network path and negotiates. The server responds with a challenge message. The client responds with an authenticate message. And it does this using the NT hash. 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. So, on a network, essentially this lets you browse file shares and websites. So, some quick definitions before we get stuck into the bugs. A hash is data produced from one-way functions, so you don't have to pass your plaintext password around. I've been asked to localize my talk, so this is essentially the equivalent of turning a cow into a hot dog. It's expensive to get the hot dog back into the cow. So, UNC is the Universal Naming Convention, you know, slash slash thing. HTTP, Hypertext Transfer Protocol, and URI, the Uniform Resource Handler. So, what happens if you steal one? There's kind of three things. 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. You can also relay it and pretend to be that person. That's mainly with NTLM and NTLM v1. NTLM v2 does it sometimes, just for fun. And you can also just take a screenshot of it, report it to the MSRC, have a fun conversation with them. So, we did a few minutes of Googling, and these are all the bugs that we found in like three minutes about NTLM. There's also the MorpheSec talk that was yesterday. They went into some more NTLM stuff there, but it's a doozy. There was the MonikaLink one this year, the Windows themes file as well. You could just load a theme and it would send off your hash for fun. 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. And, yeah, some other ones. Everyone's favorite, Petit Patin. So, NTLM is just a host of vulnerabilities. A lot of it is just by design, we won't fix it. I mean, it's old. 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. Given that like half of the environments in little old New Zealand still use NTLM v1, it's going to take a long time. So, we have a good authority, an anonymous source at Microsoft, who actually confirmed this for us. And he said to us when we met them, the runway for this is between 50 and 100 years. So, yeah. So, it's going to be disabled on a future version of Windows 11. This is great. And they have told us that they're stopping working on it. So, it's feature complete, apparently. So, now Windows will attempt to authenticate with Kerberos first, which is really secure and great. But it still falls back to NTLM if a Kerberos negotiation doesn't happen. And so, it's going to be disabled in a future release. And it can always be re-enabled, just like NTLM v1. So, one of the tools we've been using is a very, very well known tool. We're not going to go too much into it. This is Responder, the rogue authentication server developed by Elgandex. Please go and flick them some money for this great tool. 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. It does some other cool stuff. It's a very valuable pen testing tool. If you've never heard of it, go run it in an internal network and frighten your SOC team. For our purposes, we're just going to use it to collect hashes. So, this current obsession with NTLM hashes started a couple of years ago. I was testing an ArcGIS application. For those of you not familiar with ArcGIS, it's mapping software beloved by local government. I asked my workmate, Amad, if he had any tricks. He was a very high ranked bug crowd guy, so of course he did. He suggested I run Responder on one of our servers for a blind SSRF that we had found. And we got a hash on port 80. But ArcGIS is running Java on IIS. So, now we wanted to speed run. In case you're wondering what RSS and ArcGIS looks like, you can specify an RSS URL for some obscure reason. So, yeah. Sorry about the NTLM bugs, everyone. So, Windows does want you to be safe. They do have some built in protections. One of them is Mark of the Web, which you might have seen before. 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. And basically it just says, nah, I'm not going to use all of the features. I'm just going to let you briefly look at it. You can click the little warning to make it go away, but it's safe. The WordPad issue that I mentioned earlier, that just bypassed it. I don't think they even had Mark of the Web on WordPad files. Oh, no. No. And also, if you get cloned something and there's a document in it, it also just doesn't set the flag. It's great. They also have this from, what, Windows NT days? They're called Safe Zones. This is a recent screenshot, Thomas. Yeah, this is from Windows 11, as you can see, with the little Xs in the top right hand corner. Yeah, you can see that because it says scripting of Java outlets, it's very up to date and protects you against many things. The little thing down the bottom with the user authentication, it stops some hashes over port 445, but that's about it. So, it's time to query some hashes from some software before MTLM goes away. So, we're going to talk about a few things. 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. So, GraphicsMagick is generally regarded as the safer one because it's a relatively fuzzed fork of ImageMagick. So, it's a massive attack surface. ImageMagick is generally associated with ImageTragic, which everyone will remember from a few years ago. But ImageMagick didn't leak a hash over port 445. So, it will leak a hash by SVG converting to anything via a UNC path href. And it's noted in the documentation as SSRF, but there is nothing about hashes or UNC paths. VLC player. 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. Our old workmate, Amit, he disclosed that and then VLC were like, it's a Windows problem. No, it's a VLC problem. I mean, it's also a Windows problem, but come on guys. You could also do it in iTunes and Windows Media Player. I'm sorry if you still use those programs. There's probably maybe six of you in the audience that still use Windows Media Player and iTunes for Windows. I'm sorry. There's also lots of other formats and protocols that may or may not support NTLM. I mean, I'd tell you to go and look at them, but VLC don't care. So, Aspose.net is a lovely piece of document processing software. 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. It has a few known documented security issues. SSRF, server side request forgery, NTLM hash leakage, file inclusion, and it's right there on their web application security when loading resources page. So, they know about them and they have front footed it. So, leaking hashes at port 4.5 is relatively abundant and low value within an ecosystem. 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. Port 80, however, is not as blocked. So, when Windows sees a UNC path, those little slashes we saw before, it only knows how to do one thing. And it takes a little bit of work to get it out by HTTP. So, let's try. So, I just wanted to look at the district plan for our city and not go to the cyber security emergency response team. So, there's a piece of software in Aotearoa, New Zealand called ISO plan developed by a company called ISOVIST. So, again, I alluded to not talking to you about council software. It's so niche and weird and the people who develop it know councils and local government, but they might not necessarily know security. 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. Yeah, you could just tell. So, headless PDF generation is so dumb. This is not a talk about headless PDF generation. 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, such as iframes, portals, embeds. So, these have all been blocked. There had been some hardening done, which is great. However, cat pictures were not blocked. So, I managed to get an image tag to give up an NTLM hash on port 80. So, my first question was, what even is this? So, we talked about HiQ PDF. Over a million downloads in NuGet for this package. NuGet is the package repo for .NET. It has a settings.xml file, and the default property for NTLM authentication is true. So, I guess I really just wanted to know how this happened. And then I looked into it a bit, and I figured out how it happened. You can tell it's really high quality by the 3D rendered box art. This is the very height of technology. So, the other thing we found is, because of all the ArcGIS stuff, Java on IIS is a lovely place to look. The HTTP URL connection function used to pass hashes by default. We're not entirely sure it does now. I tried a couple of test projects to see. It seems to be safe, but it is still out there causing issues. See GeoServer and ArcGIS. So, Java calls the underlying Win32 API, which is a WinHTTP request. 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. We have to do a little Lord of the Rings meme. We're from New Zealand, we have to. So, they also have one other little security thing on Windows, and that's this prompt that comes up now and then. And it's like, please don't quit me, it's unsafe, do you really want to continue? Are you sure you want to get hacked? And I'm sure no one clicks yes ever, right? Yeah, it's a security control. I mean, it's fair. It's probably what their lawyers want. 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. So, if you want to have a bug in a Microsoft product, you need to get past this. 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. So, with that in mind, let's see what we can find in the Microsoft ecosystem. Enter iCredentials. So, it's just an interface, but it does some stuff. When we first got some hashes out on port 80, we started looking at the code and going, what is this? Why is this? Turns out it's not banana water. It's not gross and made up. It's just developers making logic errors, doing dumb things. It provides the base authentication interface for retrieving credentials for web client authentication. And it's used in .NET a lot. And some of the anti-patterns that it has are weird and they fall back to some dumb things. Like in NuGet. So, you've probably seen NuGet before if you've ever touched C Sharp. It's reasonably integral to the .NET ecosystem. And they have some very good advice for storing credentials. Just put them in the NuGet config file, it will encrypt it, it will be fine. But it also just falls back to NTLM sometimes. I would like 500 of my coworkers' hashes, please. It does it on NuGet restore, by the way. Which it does it when you get cloned something in like Visual Studio. And that bypasses all safety checks. There's no little don't click me button. So, Jim got a nice new e-bike from Microsoft. It's very zippy. Jim had to be very specific with Microsoft. Yeah, I had to make him a video with the breakpoint set. And I had to be like, it happens here. This is where it happens. It happens right here, Microsoft. Please believe me. So, just we had a random thought. Like, what if we reframe it as an SSRF problem? 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? There's a lot of harmless HTTP interactions in Microsoft products like RSS, don't know why I'm mentioning that. URI schemes, don't know why I'm mentioning that either. And web service in Excel, I'm just mentioning that one. If you think of these interactions like a flavor of SSRF, you can just find some new cool things. Like, what if you just suddenly redirect a resource? So, we did that. We redirected things to a nice little UNC path and it just does things. It just happily switches protocols and tries to auth. Browsers don't do that. Browsers go like, where are you trying to go? This is a dangerous redirect. Yeah. But we wrote some quick little code and then started pointing things at it. So, this is Microsoft bug number two. So, we might have rabbit holed a little bit with the URI handlers. 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. So, I dumped every single URI scheme from my Windows machine and I wanted to see which one Outlook would warn on. And it was nearly all of them, except for the Microsoft URI schemes, which was very weird. 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. So, now we have a little bit of an idea what to do when we fetch remote resources. So, no warnings, one click, embedded in an email should be a relatively safe thing to do. So, they've asked us to not spill the beans. So, could everyone just, like, block their eyes and ears? Yeah. There are some security controls in place. All files will open in a preview mode, which is good. Mark of the web is on it. 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. So, the URI handlers essentially look like this. 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. And you can also force a file extension change, which is quite fun. And here's a little video of this happening. 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. I would click that link. I'll totally click that link. And then we link someone's hash. Thank you, everyone. So, there are some much better NTLM-related bugs than the ones we've been showing. Hafei Lee from Checkpoint Research discovered a bug called moniker link. And so, this technique allows for a different and usually blocked file extension to be loaded. So, a whole new class of bug comes into play. In 2024, moniker link came up. So, we have two things. We have test.rtf and an exclamation mark and something. So, we have the file moniker and the composite moniker. The Outlook talk yesterday covered this sort of stuff a little bit as well. So, the component object model will look up whatever is after the exclamation mark, which we now potentially control through a redirect. We have three days left until Patch Tuesday. So, have fun, everyone. So, we found some more stuff. We're still bored. You can also bypass existing CVEs with that same one weird trick. So, back in 2023, some researchers at Varonis discovered a nice little CVE. There's two email headers that were sort of affected. There's the content class sharing thing, like you're sharing a document or a calendar or an RSS feed, maybe. And then a X sharing content URL, which in their case, they used a UNC path. We gave it a little HTTP path. Microsoft's fix was to add a nice little warning. They love their warnings. The please don't click me little warning. Guess what happens if you just redirect it to a UNC path? Microsoft triages it. That's what happens. And this is essentially what it looks like. It's a Microsoft instruction telling you to click a link with no warnings. Seems kind of bad, right? I would add your calendar, though. I don't know. And then we dropped it to the MSRC, and we had a fun little journey. Hi, this is Clusters Important, and you've accepted it for immediate servicing. Can you please let me know if this is eligible for a bounty? No. It says here in the link you just said that it is in scope. Uh, it's a moderate, I guess? You just told me that it was important in the same email. No, we've reclassified it, sorry. Yeah, so it was fixed last patch Tuesday, and it was the only moderate. So this is my dog, Lupe. 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. So, you know, thanks, Microsoft. Sorry again, MSRC team. You're very lovely people. It's so nice. Oh, they also said something about the bug before, that it's been feature flagged, so it's mostly fixed, but sort of not. Yeah, I had to say that, because I quite like them now. 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. So interestingly, the web request had been made while the warning box was showing, so full marks to Microsoft for almost getting there. 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. I said, cool, yeah, that makes sense. But now we know about these cool Outlook headers. So what happens if we combine URI schemes with these cool new headers that we have? Outlook has a feed handler, which will open RSS feed directly in Outlook. Obviously, four slides back is how we know about the URI handlers. Under normal circumstances, it will prompt open Outlook and give a warning. However, if you embed it in a sharing header, it won't warn. It was initially deprioritized by Microsoft as several clicks were involved. One click. It's a bug, but moderate. And this is what it looks like. Again, Microsoft wording saying, please click this thing. Would you click that? I would so click to add your RSS feed. I love RSS. Enter Visual Studio. We went back to it again. It can git clone things. I don't know if you're familiar with git, but it's kind of like subversion or Maven. No, everyone knows git. You can git clone from a bunch of things, like SSH, which is one of the normal things. Same with unauth HTTP, which is a public GitHub repo and you've just copy pasted the link. Auth HTTP, like a private GitHub repo and you've copy pasted the link. 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. I'm sure people do that. But we're just going to focus on the auth HTTP. So the command line, it's secure by default. It asks for auth, kind of. But what if we just, you know, don't put in a username or password? Yeah, what if, Thomas? Let's find out. Surely it just doesn't send a username. It won't send anything. So by default, it just sends a hash of your current account. But, like, it's fine. I can see the use cases for it. Like, say you're in an internal environment and you've got, like, some weird web server you git clone from. You probably want it most. But what it is, is it's promising. Like, maybe some other things, you know, they want to get your username and password and do stuff. Like, GUIs, how do they get credentials? They prompt you for them. Uh, yeah. Yep. No. So, Git Credential Manager, it will do things for you. It will, by default, pass a blank username and password. Visual Studio uses Git Credential Manager. So, on the right, our good old friend, Responder. That's just gonna nicely listen there and then we'll open some Visual Studio. And then, oh, my coworker sent me this cool link. I'm just gonna go git clone this. It's on the internet. I blindly clone things all the time. I'm a security professional, Thomas. I do too, but, like, seriously. And, whoa, what's that? That's an NTLM hash that it just sent. Yay. So, some fun side notes. It also works in Git submodules. 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. So, do you know what blindly clones submodules by default, Thomas? Do you have any idea? Visual Studio? You are correct, Thomas. Oh, wow. It also works in things like VC Package. You can point to a Git URL and it will just also download it. NPM, also, for funsies. And other IDEs, like JetBrains and then, like, GitHub Desktop, they don't do this. So, we told Microsoft and then they came back with this fun response. We'll just give you a minute to digest this. Actually, I'll cut out the, like, extra words. Git cloning from an untrusted source is the same as browsing an untrusted SMB share. Oh, is it Microsoft? Yeah, I do that all the time, browsing un... Same. Yeah. So, we tried to find where the security boundary was after they came back. And we were like, okay. So, it's not a Visual Studio problem because they said no. So, maybe it's a Git Credential Manager problem. But then, a Credential Manager uses Git. But Git uses libcurl, which is compiled with the use-ntln flags. But it's actually a Visual Studio problem. Oh, we don't know where the problem is. It's sort of everywhere but nowhere. And no one wants to take blame for it, really. Microsoft will patch anything that you can prove that it's in their products. Anything else? That's a Windows problem. I just like the VLC team. You can use that on your next red team, I guess, if you want to hack some developers. So, where we ended up was we have four bugs reported to MS. Two bounties and one swag. I'm so sorry to my dog from the previous slides. Your surgery came later than expected for some weird reason. One, not a bug, which is Git. One, yes, it's a bug, but it's not a priority. I mean, that's fair. It's RSS. And, you know, to get to this point, we have a very, very rigorous methodology, obviously. I mean, I have a spreadsheet. It's actually a text file on my desktop. So, yeah, this is basically how we found all these bugs. Anywhere you see an HTTP, just put a responder URL and see what Windows does, and you will be delighted with the results. Image tag, do it. Sharing tag, do it. RSS. Who uses RSS? No one uses RSS. So, where to next? There are a lot of places this could be a thing. And, I mean, it's just HTTP. So, like, build servers, they can have links. Yeah. Pipelines, they could have links. Document processing things, like, I don't know, PDF generators. Yeah, they could do it, too. Maybe Word has it. Maybe Teams has it. No one uses Teams, though, so... No one uses Teams. No. Maybe video games. I don't know. Maybe drop a link in chat. Yeah, I reckon video games is something I want to look at, because I like playing video games for research. Yeah, I should do that in work time. Our boss is here. Basically, anywhere you could put a URL in is probably a good place to start. 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. Yeah, and just go turn NTLM off if you can. It probably will break everything, but turn it off. Turn it off and then turn it back on immediately when someone screams. Yeah, use Kerberos, because that's more secure. Anyway, this is the end of our talk. We had speedrun it, much like our NTLM bugs. But finding bugs doesn't happen in isolation, so a big thank you to everyone named. Yeah, and thank you for the MSRC for listening and meeting with us. They are genuinely good folks who... They need more of them, because there's only 30 of them, apparently, which is not nearly enough. And thanks for inviting us to your party as well. That was fun. Yeah, that was good. And thank you for everyone who has published their research. This is something I don't say lightly. Every piece of research published leads to more research, so please keep disclosing, please keep blogging. It's so good reading it. And also thank you for the DEF CON organizers. You guys are awesome. And hacking is a team sport. And please come up to us afterwards if you have any ideas where to get hashes out of. We want to know. We want more moderates that we don't get bounties for. Perfect. There is a microphone there for tall people who can ask questions. All right. Thanks, everyone. Thank you.