all righty so coming up next for us uh great speaker in house uh Steve cyphus who will be uh presenting on deprecating ntlm and other uh deprecating ntlm is easy and other lives that we tell ourselves so I hope you all enjoy thank you very much no problem all right how's everyone doing I didn't even do anything in you're clapping okay uh and as he said uh I am killing ntlm or at least [Music] I'm thank you like I said I'm done um you might be shocked to find out that ntlm is everywhere um it's kind of a pain in the ass to kill Dustin showed it's incredibly dangerous um P or something yes um the good news at least is that he was talking about ntlm V1 I'm talking about ntlm V2 so when I say deprecating ntlm I actually mean the whole Suite of things we're not just killing ntlm V1 incidentally we actually killed ntlm V1 already when we introduced credential guard in Windows 10 uh the problem with that is you have to turn credential guard on oh well so let's do some level setting so you know everyone kind of has heard of ntlm at the very least you saw presentation earlier showed how incredibly easy it is to break but let's do some level setting let's talk about how it works what it is why it's important why it's so terrible um and at its base core it is an Authentication Protocol I as a user want to go talk to a file server a mail server uh whatever and that thing that I'm talking to wants to know who I am and the value of that is from an nlm perspective we're doing it in such a way that uh we are doing it indirectly so I am saying hi I'm Steve and what ends up happening is I'm not telling you my password that is a critical piece of information because uh if I tell you my password now you know my password that's not great so ntlm Works uh separately from uh from other protocols because it doesn't send you your password it does a challenge response thing and it gets used in Windows historically it was one of the first authentication protocols but these days uh it gets used as a fallback mechanism when I want other protocols to work like Kerberos or uh uh o or things like that and usually what happens is ntlm comes into play when we are trying to negotiate another protocol that is better of some sort and there are cases where we cannot negotiate a better protocol there are three of them primarily there are workg group accounts local user accounts so if you're if you're on a non-domain joined machine or you are on a um consumer account or you know it's 1997 something like that you end up uh using ntlm there's no there's nothing else you can use it must be ntlm when you're using a consumer account when you're doing uh MSA Microsoft account like when uh when you're when you're MSA joining your machine um fun fact uh how many people have tried the MSA password list thing where you don't log in with a password anymore few people how many of you tried to RDP from or to that machine to another passwordless box yeah yeah a couple people doesn't work you want to know why it doesn't work ntlm thank you ntlm um there's a whole history about why that doesn't work but it's because ntlm is stupid and of course there are scenarios when you have a misconfigured domain where we've tried to do something better like Cur Rose because name resolution failures or line of sight or things like that and as a result we can't negotiate something better so we switch to ntlm and so the way that ntlm works is like I said it's a challenge response protocol what a challenge response protocol is I've talked to a server the server says who the hell are you and it says well the server the server is saying I need you to prove you are who you say say you are and more importantly I need to know at this exact moment that you are actually holding on to a credential of the person you say you are there's a there's a a lifetime guarantee of that and so what a server does is it challenges it says I need you to do something with this message and the client says okay I have this message I have a username I have a password and I'm going to in this case in in the in the ntlm case I'm going to uh do an HM which is a hashed uh message authentication code doesn't matter what that means it's a it's a it's a cryptographic operation that basically says I have a key which is the password and I'm operating over some value which is the challenge and the username and the server says okay cool whatever cool you're logged in you now have your access to your file share your accounting software your whatever so why is that bad couple reasons first of all crypto sucks we're talking old crypto super old crypto Dustin was talking about Dez we're not doing Dez here this is ntlmv2 Dez broken horribly horribly broken gone in hours hmac md5 and md4 a little less broken still broken little less broken the actual problem is that md4 and H md5 are incredibly fast operations so much so that if I execute this hundreds of millions billions trillions of times a second I can guess what values I want them to be that's what the cracking operations are and depending on your scale this can be really easy or really hard and I have this number 1. 22 THS that's Tera hases a second so that's 1. 22 trillion hashes a second and if I have an eight character password which for a very long time was what we recommended you know collectively as an industry eight characters was pretty good three minutes that's nothing takes no time at all to crack that and as a result if I am doing that with a message that is this hmac md5 over a challenge going across the wire if I've intercepted that and I have minutes to attack it you're done your domain admin is hosed but what is 1.
22 what is that well let's look at it at a scale that we understand how many play video games yep lot of people how many have 3080s or some equivalent few people it's a pretty high-end graphic card or at least it was at the time that I actually created this slide which is a couple years ago um one and then you also have someone who is a lot uh nastier these are you know gangs these are are uh organized crime these are nation states people who have a ton of money that really don't like you and then you have 1. 22 tashes it's like 30 3080s I have a 4080 in my desktop I know I'm special um 15 of them it's a 4080 will crack approximately two 2 and a half times faster than a 3080 so that's 15 of them I looked online right before this presentation a 4080 anywhere from $1,000 to $2,000 depending on what you get so that's $115,000 like it's a lot of money but it's also not a lot of money and if I'm taking $115,000 to crack a 8 Minute uh 3 minutes to crack an eight character password it's I've sold itself like that's that's not that's nothing so the cryptography the cryptographic pain of ntlm is very obvious so it's not great another issue with ntlm is that we don't have server o and server o is actually really important so much so that we have an entire protocol dedicated to it TLS right the point of TLS is that I'm connecting to a to my bank and I want to make sure that I'm connecting to my bank and not some random fishing site or some whatever or worse uh a site that is intercepting my bank uh my bank's website that's the point of server off the thing that I'm connecting to is the thing I want to connect to ntlm doesn't have that it just doesn't care it will take the challenge it'll run an hmac over the challenge and it'll fire it off there's nothing about it that says that this is the server that I'm actually talking to there's nothing to bind the request that I'm making to the server that is supposed to accept the request that is as a result how we end up with attacks like relaying proxying things like that very very nasty over the years we've bolted on other stuff uh you may have heard of um things like extended protection or Channel binding or token binding or things like that and they kind of solve these problems but not really and you have to bolt it on meaning that it's not part of the ntlm protocol so if no one if if if you're just implementing nlm by default you don't have server o not great and lastly passwords who loves passwords yeah no one oh one person one person raised their hands passwords are terrible right humans by and large we suck at generating passwords we suck at remembering passwords and I'm being very negative by saying suck but it's true we're actually very bad at it um we have this ability to generate patterns in our head and we have this ability to recognize patterns in our head and the problem is patterns are not random by definition they are not random and in order for a password to be good it needs to be random therefore we don't generate good passwords so that's a problem if we have a protocol that only understands passwords it's not great oh yeah sometimes coding is hard we do we we sometimes make mistakes um my team owns ntlm we own authentication in Windows we are the ones that have to fix these things we are the ones that stay up late we're the ones that bang our heads against desks we're the ones that have to look at this and say oh for God's sake right so we want to kill it why don't we it's just code rip it out of the program or rip it out of Windows was not what I was expecting people to laugh at we could right just delete the folder that's that's the literal code like that's the folder in the code uh in Windows Believe It or Not windows it's just code there's nothing special about it it's it's a humongous repo of code but there is one folder it's msv sspi that is the ntlm code in Windows we could delete it it'll break the world probably actually will break the windows compile um I don't want to risk my life or my my job on that so what do we do well what can we do well we have to figure out a way to kill it so let's talk a bit about who's doing the killing my team's AP authentication platform we're Windows like I said we own all of this crap we are the ones that you blame when your password cannot work and you cannot log in uh were the ones that broke Kerberos rc4 last year you're welcome by the way uh I meant that actually sarcastically it wasn't supposed to be a CL we didn't actually mean to break you we were trying very hard not to break you and we did it anyway um and we have a whole Suite of teams like our servicing team believe it or not my team we own all of the code in Wind well in in the authentication code in Windows um but the code that you use on a daily basis is owned actually by the servicing team so like I am 6 months ahead of what everyone is in this room is using and the servicing team is actually the ones who get blamed when things break because they're the ones that broke it because we told them to uh then we have our SMB team uh SMB is a huge attack Vector for ntlm because it's super easy to use um it's super easy to coers it into uh giving you an ntlm challenge response and then there's the msrc team who's just pleading with us please kill this goddamn thing sorry I'm trying not to swear and I'm doing a bad job and then is there the supporting people uh the support people who are Fielding questions and and and hate mail from you who are telling us please kill andm and of course Azure who actually has to deploy all of this stuff into into a uh multi-million machine uh distributed system that at any given point in time might be affected from a security thing so not great and they're all asking us it's a it's a team effort we have to figure out how do we kill this thing and in order to kill it we have to look at it from a perspective okay well why can't we kill it and so as a result we have to look at why do people use it what is good about it well in order to kill it we have a bar graph we want to go from zero which is where we're at to where we want to be which is completely removed from the product I'm going to be honest with you it's never leaving the product it might be off by default but at some point in time someone will have to turn it on and it'll be there but it'll be off by default so we want to get from you know 0 to 100 well one of the interesting things things about ntlm is this concept of line of sight when I want to authenticate to a service sometimes I can just go talk to that service I go talk to the file share I go talk to my email service and that thing goes talk to who goes and talks to whoever it needs to talk to in this case active directory well in more modern protocols Kerberos oo uh web-based protocols uh WS fed samle things like that there's a third party in this case we have a third party it's the thing proving you are who you say you are active directory uh Azure sorry um entra but in order to do that we actually have to go talk to them first that's kind of annoying why don't I just go talk to like I don't give a crap about authenticating to this other thing I want to go talk to my file share like that's really the important thing authentication is secondary no one in this room actually cares about authentication the thing that we care about is the thing on the file server right it's the Excel spreadsheet it's the website that contains our accounting information right it's that stuff security is secondary the business is what's important that's the thing we care about it just happens that in order to be able to access the thing we care about we have to authenticate and so if we make it more difficult by requiring us to go to this other thing and it's kind of a pain ntlm solves that it doesn't care it just goes directly to the thing and that thing forwards it on that makes up give or take 5% of all ntlm authentication and I say 5% and I'm kind of making that up I'm being a bit hand wavy uh it is based on real numbers it's based on Telemetry so it's anonymized it's aggregated um it changes on a fairly regular basis I checked it uh yesterday and the freaking thing went down to 4 per. so I didn't update my slide deck 5% give or take next unknown server remember I talked about this doesn't care who you're talking to so if I have to go all the way over here to a domain controller when I'm doing keros or or or ooth or something like that and I say I need to go talk to this file share that thing's going to say what file share I don't know who that is ntlm doesn't have that problem it can just fire a request it's it's username and password and that fires it off to the domain controller domain controller says oh well I know this user I don't know what server you're talking to but I know the user so it's good that's a double-edged sword inag excuse me in aggregate that's about 14% that's a that's an aggregate number of of different things that is IP address based one of the fun things is IPS are hard they change because of DHCP things like that leases whatever um we don't necessarily know who an IP is it's a number it's somewhere on the network it's not meaningful the you know SMB accounting file server that is Meaningful that is the thing I want to talk to but there's no mapping of that and so if you have an IP we by default say ah we'll just do ntlm because we don't care and then there's other scenarios like we have tried saying hey I'm trying to connect to the SMB file share and the domain controller says don't know who that is so it's an aggre you know this 14% And of course local users I talked about that earlier if I am on a work group machine I'm not on a domain I'm consumer Network or it's just a managed device somewhere in the cloud doesn't have an account it's not the main joints not whatever uh it's just going to do nlm that's just this just what it is the domain the local authentication system in Windows doesn't understand anything else it's just ntlm that makes up 29% of all ntlm authentication that's I think that's 48% and this is intentional this is things that we could not do better 48% of all ntlm traffic is something that we tried to do something better fell back to nlm because we couldn't for some reason and we know we couldn't for some reason we need to do something about that so that we can solve these problems so that when we do fall back to ntlm it's actually for no reason at all we aren't falling back right if I have a local user account if I have a uh line of sight issue if I have an authentication uh sorry a server name issue uh all of those things just disappear they don't happen anymore because we know how to do it with a better protocol and one of the interesting problems is well we could we could come up with all sorts of solutions to these problems but we're windows we have this problem where there are billions of machines out there that are doing ntlm on a daily basis for Better or For Worse and so this thing needs to be built in needs to be uh part of Windows core can't rely on anything else uh has to be everywhere all at once we also need to make sure that it solves the crypto problem which is it doesn't take 6 hours or 3 minutes or some obscenely small small amount of time to crack a password and it can't just rely on passwords like passwords are a pain like passwords are great in some ways they serve certain purposes they will be around forever but maybe in smaller and smaller quantities for specific purposes bootstrapping purposes for instance things like that but we really want something that isn't solely Dependable on uh passwords well what are our options we have Oo we have web- based protocols we have samel we have this thing called Kos actually it's um bit of a shock to some people people look at this and say Kerberos that's gross don't want keros we spent years trying to kill Kerberos uh I didn't I I actually quite like Kos I spent years building it into Azure ad actually um we actually spent the last 3 years optimizing it in Windows making it better overhauling we actually rebuilt the entire crypto stack from scratch well why is it better why is it better than ntlm why is it we're not doing something over another protocol like ooth well for ooth as an example uh oloth requires an IDP an identity provider something else it's also web- based so that's HTTP uh web servers that requires TLS that requires certificates and as soon as you start going that R down that rabbit hole it's really complicated we also don't want to take a dependency on things like the cloud um there are scenarios that can't so it has to be Central to the one thing so keros actually works Kerberos is just a protocol it's actually a deceptively simple protocol wrapped in a bunch of complex goo that nobody understands and I will save You by not explaining how it works first of all crypto about Kerberos is a lot better than ntlm at the very least uh we're not relying on stupid things like md4 and hmac md5 ah but we have rc4 well we actually don't anymore uh back in November of 2022 we killed rc4 incidentally uh there was a security vulnerability that we found well we didn't find it was it was Ed to us uh and we had to fix it kind of scrambled to fix it um one of the interesting side effects of that msrc was that we didn't just do it to kill rc4 we actually did it to make it crypto agile and when I say crypto agile what that actually means is at any given point in time if we need to we can pick up an old Cipher and replace it with the new Cipher and that's important because if you have a break such as with rc4 we can say oh okay well we'll just you know overnight we'll just replace it with a different protocol or with a different algorithm well that was that was one of the things we spent a very long time on as a result of November 2022 uh since then rc4 usage in Kerberos as far as we can tell as dropped to 0.