1 00:00:00,000 --> 00:00:12,100 Hi everyone and thank you very much for coming to our talk, Windows Epidemic, A Crash Course in Abusing RPC for Windows and Win DDoS. 2 00:00:12,200 --> 00:00:26,580 The theme for our talk today is going to be dumb ways to die for those of you who know it so I really hope that you'll appreciate the connection between the technical details and this funny little mobile game. 3 00:00:27,400 --> 00:00:31,800 My name is Or Yair, I'm the security research team lead at SafeBreach. 4 00:00:31,800 --> 00:00:53,620 I have more than seven years of experience in security research with past research on Linux embedded and Android systems and for more than four years now my main focus lies in vulnerability research in the Windows operating system and third party apps on it and it's also my second DEF CON talk here today. 5 00:00:56,020 --> 00:01:05,920 Hi everyone, my name is Shachak Morag, currently serving as research lead at SafeBreach with seven years of experience in security research. 6 00:01:05,920 --> 00:01:13,980 My background includes extensive expertise in Linux kernel and embedded systems with more than one year of focused research on Windows platforms. 7 00:01:18,750 --> 00:01:22,550 Okay, so let's see what we're going to discuss today. 8 00:01:22,610 --> 00:01:28,290 We're going to start with talking about the growing DDoS threat and denial of service in general. 9 00:01:28,470 --> 00:01:42,360 We'll then focus on one critical denial of service vulnerability that we managed to exploit called LDAP nightmare that was the gateway for this research. 10 00:01:42,820 --> 00:01:59,540 We'll then present our research goals, novel techniques that we invented that focus on developer's blind spots and see how they led us to come up with a new way to create DDoS and also with four new different denial of service vulnerabilities. 11 00:02:00,680 --> 00:02:06,780 But just before we start our journey, let's quickly be reminded of what is DDoS. 12 00:02:06,780 --> 00:02:19,440 So a DDoS is created when many computers try to flood a specific target server with a huge amount of requests in order to make it too busy and finally crash or at least to malfunction. 13 00:02:20,360 --> 00:02:25,540 And now we can start talking about the DDoS related growing risks that we now they see. 14 00:02:25,540 --> 00:02:40,760 So according to G Corrador there was a 56 percent increase in DDoS attacks in the second half of 2024 compared to the second half of 2023 and the same comparison for the first half of the year was 46 percent. 15 00:02:41,200 --> 00:02:52,100 Recently CloudFlare even reported the largest ever recorded DDoS attack with 7.3 terabits per second. 16 00:02:52,440 --> 00:02:58,420 Now creating denial of service has an obvious and large price of course. 17 00:02:58,420 --> 00:03:15,340 According to Perimeter 81 which is a company by checkpoint, each DDoS attack in 2023 cost organizations approximately $6,000 per minute with an average total cost of $486,000. 18 00:03:16,320 --> 00:03:31,040 Recently on January 1st while most of you here were probably hung over, Shahak and I published the first POC for a very hyped denial of service vulnerability called LDAP Nightmare. 19 00:03:31,600 --> 00:03:38,220 Although this vulnerability was fixed and this vulnerability was found by Yuki Chen. 20 00:03:38,220 --> 00:03:46,100 Now although this vulnerability was fixed Yuki did not publish the technical details about it and left us with passion to discover them. 21 00:03:46,760 --> 00:03:54,320 This vulnerability allowed to crash any domain controller without any need for authentication or user interaction. 22 00:03:55,760 --> 00:04:04,760 Our research revealed that domain controllers can be turned into LDAP clients or more specifically CLDAP clients. 23 00:04:04,760 --> 00:04:15,400 Apparently there is a specific RPC call named DSR get DC name EX2 that you can execute on domain controllers without needing to authenticate. 24 00:04:15,460 --> 00:04:27,660 Then this function in order to retrieve the information that it needs it leads the domain controller to become a CLDAP client and you can make it contact any CLDAP server that you want. 25 00:04:28,140 --> 00:04:35,540 Now for clarification CLDAP is just basically LDAP over UDP instead of LDAP over TCP. 26 00:04:36,200 --> 00:04:52,860 The rest of the exploitation chain of this vulnerability after the domain controller became our CLDAP client was returning a simple invalid value from the CLDAP server to the CLDAP client which was the victim domain controller. 27 00:04:53,280 --> 00:04:59,120 This caused the CLDAP client to crash which led the entire machine to crash as well. 28 00:04:59,820 --> 00:05:11,620 That was because the CLDAP client was located in the critical process and if it dies then it just reboots the entire machine. 29 00:05:11,780 --> 00:05:27,300 So even though this domain controllers are a critical component that is heavily researched for security issues then a blind spot in it was still discovered and that was in the LDAP client code. 30 00:05:28,240 --> 00:05:40,980 Out of this fact we extracted our research goals which were focusing on such developers blind spots and targeting them for more denial of service vulnerabilities. 31 00:05:41,580 --> 00:05:49,680 And of course as primary targets we chose to continue with domain controllers which are one of the key components in an active directory network. 32 00:05:49,980 --> 00:05:56,780 So if you deny service from domain controllers you can basically halt entire organizations. 33 00:05:58,580 --> 00:06:02,860 Okay, so let's see which developers blind spots we focus on. 34 00:06:02,860 --> 00:06:12,400 The first one was the one that we already saw which was client code that we can trigger remotely to communicate with us as its servers. 35 00:06:12,400 --> 00:06:15,020 But the second one was also interesting. 36 00:06:15,540 --> 00:06:22,980 We tried to understand how or where in server code developers can forget about certain security needs. 37 00:06:23,080 --> 00:06:41,860 Then we figured out that if the server code is transport agnostic, wrapped and uses heavy obstructions layers and directs the developers to only focus on the application's logic, then there's a higher chance for the developers to forget about certain security needs. 38 00:06:42,100 --> 00:07:00,340 Then we enumerated a few options and looking at Microsoft's definition of the RPC protocol we saw that Microsoft clearly states that RPC enables you to focus on the details of the application rather than the details of the network. 39 00:07:00,340 --> 00:07:02,540 Which was perfect for us. 40 00:07:02,540 --> 00:07:13,480 We realized that RPC which is one of the fundamental building blocks of Windows is actually a transport agnostic wrapped server. 41 00:07:13,840 --> 00:07:18,900 Now RPC does function in the form of a client and a server . 42 00:07:18,900 --> 00:07:22,180 It uses a variety of communication methods. 43 00:07:22,180 --> 00:07:30,800 However, developers of RPC functions that make an RPC interface do not handle the network communication. 44 00:07:30,800 --> 00:07:33,660 They do not handle any network aspects. 45 00:07:33,660 --> 00:07:35,540 They do not handle packets. 46 00:07:35,540 --> 00:07:46,000 They simply write functions that can be called remotely and these functions receive parameters as if these functions were called from the same process. 47 00:07:47,300 --> 00:08:00,060 So our assumption was that developers are more likely to forget about mitigating network related classic server risks when the servers that they develop are RPC servers. 48 00:08:01,460 --> 00:08:07,760 And once we defined our goals and the blind spots that we were looking for we were ready to start our research process. 49 00:08:08,020 --> 00:08:17,080 The first blind spot that we focused on was client code since it was the natural way to go and leverage knowledge that we already had in the area of LDAP nightmare. 50 00:08:17,300 --> 00:08:31,020 So as a reminder from LDAP nightmare we understood that we can turn domain controllers into our clients effortlessly and anonymously as they just trust any LDAP server that they are told to connect to. 51 00:08:31,460 --> 00:08:47,400 The client code that connected to us is the LDAP client code in Windows and that client code is implemented inside WLDAP32.dll and it supports both LDAP and CLDAP. 52 00:08:47,920 --> 00:09:00,200 Now talking a bit more technically about the exact bug that triggered the crash in LDAP nightmare, it was located in the LDAP client's logic for handling referrals. 53 00:09:00,700 --> 00:09:13,860 The code that parses a type of an LDAP packet named referral was flawed and crashed as a result of an invalid value in one of the packet's fields. 54 00:09:14,020 --> 00:09:34,580 So in LDAP there's a concept called LDAP referrals and this concept which is also a type of a packet as we just saw, enables LDAP or CLDAP servers to refer a client to a different LDAP server in case that the server does not have the needed information. 55 00:09:35,940 --> 00:09:42,920 Then when the client receives the referral it normally chases these referrals to get the answers that it needs. 56 00:09:44,220 --> 00:09:54,480 Okay, so even though the referral process didn't really happen in LDAP nightmare, it didn't really go through as part of the exploitation path. 57 00:09:54,540 --> 00:09:58,680 It was just a field in the LDAP referral packet that was invalid. 58 00:09:59,300 --> 00:10:07,000 Even though that was the case we still learned about the referral process that we didn't know before which gave us an idea. 59 00:10:07,500 --> 00:10:16,560 If we are the LDAP server and we can provide a referral, can we use that for something else other than just crashing? 60 00:10:17,560 --> 00:10:25,880 Maybe we can leverage domain controllers as LDAP clients instead of using that against them. 61 00:10:25,880 --> 00:10:32,500 It could be that we can harness their resources for a distributed denial of service. 62 00:10:33,500 --> 00:10:45,140 What if instead of returning an invalid value in the LDAP referral response, we'll return a completely valid one with referrals that point towards a DDoS victim. 63 00:10:45,540 --> 00:10:53,760 Then maybe we'll be able to trigger any domain controller that we want to be a bot in a DDoS botnet attack. 64 00:10:54,740 --> 00:11:08,160 So in a normal DDoS attack an attacker has their own personal computer of course that initiates the attack and communicates with a command and control server. 65 00:11:08,240 --> 00:11:27,220 This command and control server communicates with many different bots that the attacker has managed already to compromise probably and it commands them to send a big amount of requests towards a single victim in order to flood it and this victim is the DDoS victim. 66 00:11:28,180 --> 00:11:45,880 However, if we affect different domain controllers worldwide to connect to our LDAP server and use LDAP referrals to refer them to a single victim server, then this would not require us to compromise many different potential bots. 67 00:11:45,960 --> 00:11:52,480 And then we also don't need to have any footprint on the bots that we're using. 68 00:11:54,080 --> 00:12:02,920 So the first thing that we want to do if we want to supply a long list of many referrals is to remove any size limitations that we have. 69 00:12:03,580 --> 00:12:14,800 So far the domain controller is connected to us via CLDAP which is LDAP over UDP but UDP has a packet size limit that we do not want to have. 70 00:12:15,320 --> 00:12:22,240 So in order to solve this, what we can do is to start with a referral to our own LDAP server. 71 00:12:22,880 --> 00:12:35,940 Apparently when the CLDAP client in Windows receives a referral, it contacts the referral, it chases the referral via LDAP instead of CLDAP. 72 00:12:36,100 --> 00:12:40,200 So this way we can switch from UDP to TCP. 73 00:12:41,180 --> 00:12:45,660 And now we can try to send our referral list to our domain controllers. 74 00:12:45,660 --> 00:12:47,940 However, it's still not that simple. 75 00:12:49,100 --> 00:13:05,300 Inside wldap32.dll which is the Windows LDAP client, in the function that chases referrals that is called LDAP chase referrals, there's a call to a function that checks for duplicate referrals. 76 00:13:05,380 --> 00:13:08,480 This function is called check for existing referral. 77 00:13:08,700 --> 00:13:19,060 So in case the LDAP client encounters a referral that was already chased before, it stops chasing the referral and ends the process completely. 78 00:13:19,060 --> 00:13:21,980 It doesn't chase any other referrals. 79 00:13:22,200 --> 00:13:30,140 So does that mean that we cannot implement our idea since we cannot provide two of the same LDAP referral URLs? 80 00:13:31,640 --> 00:13:34,160 Well no, that's not true. 81 00:13:34,160 --> 00:13:50,280 We found out that even though the LDAP client validates there are no duplicate referrals, it does that only for the URLs themselves and the client does not verify that the URLs are not resolved to the same IP. 82 00:13:50,660 --> 00:14:01,440 So to exploit this logic, all that we needed to do was to configure one subdomain wildcard record in a domain that we own to lead to the victim's IP. 83 00:14:02,100 --> 00:14:12,040 This completed everything that we needed for our innovative DDoS attack that we named Win DDoS. 84 00:14:12,040 --> 00:14:15,400 So now let's fully understand how it works. 85 00:14:15,780 --> 00:14:25,680 So the attacker starts by recruiting worldwide public domain controllers by sending them the RPC call that triggers them to become the attacker's CLDAP client. 86 00:14:26,580 --> 00:14:33,920 The domain controllers then send the CLDAP request to the attacker's CLDAP server. 87 00:14:34,760 --> 00:14:48,140 The attacker's CLDAP server returns a CLDAP referral response that refers the domain controllers to the attacker's LDAP server this time in order to switch from UDP to TCP. 88 00:14:49,120 --> 00:15:09,020 The domain controllers sends the LDAP query now to the attacker's LDAP server over TCP and the attacker responds with an LDAP referral response containing a huge list of LDAP referral URLs all pointing to a single port on a single IP. 89 00:15:10,220 --> 00:15:21,760 The domain controllers then send an LDAP query to that port and the attacker sends a port on that IP and that port can be a port of a server that is a web server for example. 90 00:15:22,480 --> 00:15:34,660 Then due to the fact that web servers do not expect LDAP packets, which are not valid HTTP packets of course, then most of them just close the TCP connection as a result of that. 91 00:15:35,860 --> 00:15:45,240 Once the TCP connection was aborted, the domain controllers continue to the next referral on the list which points them to the same server again. 92 00:15:45,240 --> 00:15:52,460 And this behavior repeats itself until all the URLs in the referral list are over. 93 00:15:52,900 --> 00:15:57,700 So, without further ado, let's see a demonstration of that. 94 00:15:57,700 --> 00:16:19,120 So in this video we'll see how an attacker initiates the Win DDoS attack in order to harness and recruit the resources of three different domain controllers to flood a specific victim server, victim dummy server that we set up as you can see in the preview for the video. 95 00:16:19,120 --> 00:16:20,780 So let's watch it. 96 00:16:22,380 --> 00:16:25,260 So we have our server up and running. 97 00:16:25,260 --> 00:16:36,460 We initiate the attack and we can see that the domain controllers just flood the target victim servers with many, many different requests. 98 00:16:37,220 --> 00:16:38,840 All LDAP. 99 00:16:42,120 --> 00:16:43,000 Okay, cool. 100 00:16:43,000 --> 00:16:46,880 So Win DDoS can be an ideal DDoS attack. 101 00:16:46,880 --> 00:16:53,800 It has a very high bandwidth as it can use the power of tens of thousands of domain controllers around the world. 102 00:16:53,800 --> 00:17:04,340 It does not require purchasing anything and it does not require that the attackers will breach into any devices. 103 00:17:04,340 --> 00:17:07,540 So no footprint is left on the bots. 104 00:17:08,720 --> 00:17:22,400 We believe that if Win DDoS would not have been fixed, such an attack would have dramatically lowered the bar for attackers to conduct a DDoS attack. 105 00:17:22,400 --> 00:17:26,340 It can be done from anywhere in a click of a button. 106 00:17:27,560 --> 00:17:29,580 But there is even more. 107 00:17:29,580 --> 00:17:32,000 There was more to exploit in this behavior. 108 00:17:32,000 --> 00:17:36,820 There was a Win DDoS to find, not just Win DDoS. 109 00:17:37,860 --> 00:17:48,500 After understanding that we can send tens of thousands of referrals, we thought what will happen if we just send too many more? 110 00:17:51,250 --> 00:18:04,450 As we already saw earlier, there is a limit if we use CLDAP because using CLDAP limits us to a referral list of about 64 kilobytes maximum which is the packet size limit for UDP. 111 00:18:04,470 --> 00:18:06,450 So we must use TCP. 112 00:18:06,510 --> 00:18:08,910 But is there any other limit? 113 00:18:10,590 --> 00:18:16,610 How many referrals would you allow if you were Microsoft in this flow? 114 00:18:17,250 --> 00:18:18,490 Ten? 115 00:18:19,290 --> 00:18:20,870 A thousand? 116 00:18:21,490 --> 00:18:22,970 Ten thousand? 117 00:18:23,250 --> 00:18:27,830 Well, there's no really specific number that should make sense, right? 118 00:18:28,530 --> 00:18:34,930 So we can see the proof of it in the fact that it's really all you can eat. 119 00:18:35,010 --> 00:18:42,030 As far as we tested, Microsoft did not set any limit on the referral size nor on the length of a single referral. 120 00:18:42,030 --> 00:18:48,190 When we tried to provide a huge list of referrals, it just took too much time on our side. 121 00:18:48,190 --> 00:18:50,090 Our side was the bottleneck. 122 00:18:50,790 --> 00:18:55,850 So if we provide huge lists, we can create huge allocations. 123 00:18:55,850 --> 00:18:57,830 But there is even more to that. 124 00:18:57,830 --> 00:19:06,570 That is because apparently the LDAP client does not release any referral URL from the list until it hits the end of the list. 125 00:19:06,670 --> 00:19:17,290 That means that the longer the referral list that we provide, the longer the allocation stays in the domain controller's heap memory which can be a very, very long time. 126 00:19:17,290 --> 00:19:19,550 It can be a few hours even. 127 00:19:21,230 --> 00:19:33,510 This widens the gap between allocations and releases and therefore returning a huge list of referrals if done multiple times leads to this. 128 00:19:43,350 --> 00:19:44,790 Cool. 129 00:19:45,170 --> 00:19:48,090 So another denial of service. 130 00:19:48,110 --> 00:19:57,490 The result was that we either saw Elsa crashing, forcing a reboot or else we saw a blue screen of death. 131 00:20:02,420 --> 00:20:04,040 Thank you. 132 00:20:04,580 --> 00:20:05,300 Okay. 133 00:20:05,300 --> 00:20:07,160 But there is even more. 134 00:20:07,160 --> 00:20:16,480 Because if we can create denial of service in domain controllers, leveraging classic server risks, then we can maybe do that in other attack surfaces. 135 00:20:16,480 --> 00:20:21,600 Such as the other blind spot that we talked about. 136 00:20:21,600 --> 00:20:28,600 Which is RPC, the transport agnostic wrapped server that we discussed about. 137 00:20:28,700 --> 00:20:35,600 And with this shift, I'll hand over the mic to Shachak. 138 00:20:39,830 --> 00:20:41,270 Thanks dude. 139 00:20:41,430 --> 00:20:44,230 Now let's move into the second part of our talk. 140 00:20:44,270 --> 00:20:48,750 One of the blind spot we identified earlier has already led to a denial of service. 141 00:20:48,870 --> 00:20:51,090 Now we'll explore the next blind spot. 142 00:20:51,090 --> 00:20:54,070 Transport agnostic wrapped RPC servers. 143 00:20:55,130 --> 00:20:58,070 First we look for potential RPC interfaces. 144 00:20:58,070 --> 00:21:01,230 We search for RPC over TCP or SMB pipes. 145 00:21:01,410 --> 00:21:04,730 Then checks whether each interface could be accessed remotely. 146 00:21:04,730 --> 00:21:06,490 Lacking the local only flag. 147 00:21:06,530 --> 00:21:09,970 This flag restricts the RPC end point to local transport. 148 00:21:10,090 --> 00:21:11,710 Blocking remote access. 149 00:21:11,710 --> 00:21:20,310 To have the same huge impact as referral overflow, we focus on interfaces that require minimal privileges as usually have no security callbacks. 150 00:21:21,690 --> 00:21:23,990 Finding an interface is not enough. 151 00:21:23,990 --> 00:21:26,310 We need to add something important. 152 00:21:26,410 --> 00:21:28,590 Crushing a random process does little. 153 00:21:28,590 --> 00:21:33,570 So we focused on RPC interfaces that runs inside critical processes like Elsos. 154 00:21:33,570 --> 00:21:39,350 If Elsos dies, the old machine stops, login fails and the OS restarts. 155 00:21:40,470 --> 00:21:41,950 Think for a second . 156 00:21:41,950 --> 00:21:47,270 If one RPC call uses a lot of memory, you'll need way fewer calls to cause major damage . 157 00:21:47,490 --> 00:21:51,110 So we filter for function with large controllable parameters. 158 00:21:51,210 --> 00:21:57,190 Simple function without sized input wouldn't allocate enough memory to crush anything quickly. 159 00:21:57,190 --> 00:21:58,610 Remember OS point. 160 00:21:58,610 --> 00:22:03,710 Widening the gap between allocations and deallocations make resources pile up faster. 161 00:22:04,470 --> 00:22:08,390 We try to call RPC methods that match this criteria. 162 00:22:08,390 --> 00:22:10,750 But our naive approach wasn't enough. 163 00:22:10,750 --> 00:22:16,770 Simply calling RPC calls that we thought would be memory consuming for the denial of service attack took ages. 164 00:22:17,090 --> 00:22:21,350 At first, triggering candidate calls show only a small memory increase. 165 00:22:21,690 --> 00:22:23,970 Far too slow to trigger a crash. 166 00:22:24,270 --> 00:22:26,870 We needed a faster way to burn for memory. 167 00:22:27,590 --> 00:22:31,930 But before first optimization, we must understand the RPC bind. 168 00:22:32,110 --> 00:22:33,990 The bind is the handshake. 169 00:22:34,050 --> 00:22:38,350 The client tells the server which interface it wants by sending the interface UUID. 170 00:22:38,530 --> 00:22:42,050 Then the server can accept or reject with the bind acknowledgement. 171 00:22:43,190 --> 00:22:49,510 According to Windows RPC documentation, the client must wait for the server bind up before sending the RPC call. 172 00:22:49,770 --> 00:22:52,170 But waiting wastes critical time. 173 00:22:52,210 --> 00:22:55,210 What if we use the time to send even more packets? 174 00:22:55,530 --> 00:23:01,830 Maybe RPC isn't really stateful and we can send the bind and the call together without waiting for the hack. 175 00:23:03,350 --> 00:23:04,770 What do you think? 176 00:23:04,770 --> 00:23:05,970 Will it work? 177 00:23:06,310 --> 00:23:12,070 We tested it by sending bind and calling a single packet and saw that the server accepts it. 178 00:23:12,070 --> 00:23:13,550 It actually works. 179 00:23:13,770 --> 00:23:15,890 We call this the status RPC technique. 180 00:23:16,030 --> 00:23:18,590 This technique gives us three main wins. 181 00:23:18,930 --> 00:23:21,270 First, one pre-built packet. 182 00:23:21,270 --> 00:23:23,210 No need to rebuild each time. 183 00:23:23,470 --> 00:23:25,990 Second is bind and call in one shot. 184 00:23:26,090 --> 00:23:28,750 And lastly, no need to wait for any replies. 185 00:23:28,750 --> 00:23:30,910 You can send the next packet right away. 186 00:23:32,330 --> 00:23:34,190 And the impact is remarkable. 187 00:23:34,230 --> 00:23:36,610 Our call per second rate skyrocketed. 188 00:23:36,610 --> 00:23:39,690 Lowering the attacker's effort for a denial of service attack. 189 00:23:40,530 --> 00:23:44,150 And to show this, let's dive into our first RPC function. 190 00:23:44,150 --> 00:23:46,590 It's in the NetLogon interface in Asus. 191 00:23:46,850 --> 00:23:50,690 This call translates a list of socket addresses into site names. 192 00:23:50,690 --> 00:23:54,070 It's available in domain controller and is unauthenticated. 193 00:23:54,950 --> 00:23:59,570 The parameter entry count can be up to 32,000 which is perfect for us. 194 00:23:59,650 --> 00:24:01,370 A large numeric parameter. 195 00:24:03,070 --> 00:24:05,010 But is it really perfect? 196 00:24:05,310 --> 00:24:13,070 The Microsoft documentation says that the maximum value of, the maximum value for entry count is 32,000. 197 00:24:13,070 --> 00:24:18,350 The limit was chosen to prevent clients from being able to force large memory allocations on servers. 198 00:24:19,150 --> 00:24:21,190 So, should we give up? 199 00:24:23,050 --> 00:24:24,810 Well, no. 200 00:24:27,530 --> 00:24:34,510 So, let's take a look at another RPC function. 201 00:24:35,210 --> 00:24:43,550 We managed to exploit the exact entry count parameter that Microsoft claimed was protected. 202 00:24:43,830 --> 00:24:47,070 Each call allocates at least eight times the entry count in bytes. 203 00:24:47,070 --> 00:24:53,090 At the maximum value of 32,000 entries, that's at least 256 kilobytes per call. 204 00:24:53,270 --> 00:24:59,090 And using our stateless RPC technique, we could send a 30,000 time packet. 205 00:24:59,090 --> 00:25:04,130 Repeating this call at scale exhausts memory faster than it freezes, causing the DC to crash. 206 00:25:05,150 --> 00:25:09,630 With this, we've added another unauthenticated denial of service attack. 207 00:25:09,730 --> 00:25:11,170 Another Windows. 208 00:25:11,330 --> 00:25:14,130 This time via RPC instead of LDAP. 209 00:25:14,490 --> 00:25:16,910 So, great, another new vulnerability. 210 00:25:17,110 --> 00:25:20,510 But we couldn't crash with other RPC calls quickly enough. 211 00:25:20,770 --> 00:25:23,110 Stateless RPC alone wasn't enough. 212 00:25:23,110 --> 00:25:25,070 We needed new crash methods. 213 00:25:26,030 --> 00:25:35,450 So, given our DDoS discussion and the fact that we limit ourselves to only one computer, we wondered, could we create a DDoS-like attack from a single machine? 214 00:25:35,610 --> 00:25:41,870 What stopped one computer from opening thousands of connection to overwhelm the target like a real DDoS? 215 00:25:42,850 --> 00:25:48,630 And to answer that, we identified the entire bottleneck, which is everything before the RPC call. 216 00:25:49,010 --> 00:25:51,190 First is sending the bind packet. 217 00:25:51,690 --> 00:25:56,250 Second is waiting for the bind acknowledgement , as we know from the stateless RPC technique. 218 00:25:56,630 --> 00:25:59,330 And third is the processing time on the target. 219 00:26:00,870 --> 00:26:03,670 So, we know the RPC call raises memory. 220 00:26:03,750 --> 00:26:06,270 Our plan is to split the attack into two phases. 221 00:26:06,290 --> 00:26:11,530 The first one, open thousands of connections by sending all the bind packets up front. 222 00:26:11,630 --> 00:26:16,110 And the second, flounder simultaneously with RPC call to spike memory. 223 00:26:16,630 --> 00:26:19,350 But binding so many packets takes minutes. 224 00:26:19,350 --> 00:26:23,530 So, how long does the server keep those idle bindings before dropping them? 225 00:26:25,350 --> 00:26:29,070 We wanted to know how many bindings we can send in the first phase. 226 00:26:29,070 --> 00:26:33,430 Remember, the more bind requests we can send, the more effective the attack will be. 227 00:26:33,710 --> 00:26:41,670 In our tests, Windows RPC servers can bind only connection open for 10 minutes, at least without timing out. 228 00:26:41,850 --> 00:26:47,410 That gives the attacker plenty of time to complete thousands of bind and shake before unleashing the flood of RPC calls. 229 00:26:48,510 --> 00:26:53,510 This means attackers can queue bind operation and then unleash a sudden flood of RPC calls. 230 00:26:53,510 --> 00:26:55,890 By passing all pre-call over it. 231 00:26:55,890 --> 00:27:00,490 And in simple terms, bind everything first, then flood with RPC calls later. 232 00:27:00,710 --> 00:27:04,630 Because this attack has an effect like a DDoS, we call it torpedoes. 233 00:27:04,630 --> 00:27:06,650 A single computer DDoS. 234 00:27:08,610 --> 00:27:15,490 On Windows end point, SMB RPC pipes limit 20 simultaneous binding, which is bad for torpedoes. 235 00:27:15,590 --> 00:27:18,450 Only small amount of bind only connection allowed. 236 00:27:18,830 --> 00:27:24,210 However, TCP interfaces have no such limit, making torpedoes very effective. 237 00:27:24,470 --> 00:27:29,530 No common DDoS mitigation as per IP rate limits or aggressive timeout apply. 238 00:27:30,790 --> 00:27:32,850 Let's see torpedoes in action. 239 00:27:32,930 --> 00:27:35,110 We use the network on interface in LSAS. 240 00:27:35,110 --> 00:27:38,870 This call is the first step of the secure channel session key negotiation. 241 00:27:38,910 --> 00:27:41,670 It's available on DCs, unauthenticated. 242 00:27:41,830 --> 00:27:44,250 Anyone with network access can trigger it. 243 00:27:44,350 --> 00:27:47,650 We focus on the unlimited computer name input parameter. 244 00:27:49,090 --> 00:27:55,850 Reversing network on DLL shows that calling this RPC allocates memory via NL insert challenge, which solve the challenges. 245 00:27:56,090 --> 00:28:00,390 With no input validation on the challenge size, we can trigger massive allocations. 246 00:28:00,470 --> 00:28:03,270 Tens of megabytes of memory in a single call. 247 00:28:04,230 --> 00:28:06,330 Our enemy is challenge cleaning. 248 00:28:06,350 --> 00:28:12,810 NL scavenger challenges run only every two minutes, cleaning challenges other than two minutes when a new one arrives. 249 00:28:12,890 --> 00:28:16,970 That window lets us build up a location like with referral overflow. 250 00:28:18,230 --> 00:28:23,470 Without torpedoes, we have a tight two-minute window to crash via resource exhaustion. 251 00:28:23,630 --> 00:28:28,390 But since binding don't create challenges, NL scavenger challenges never runs. 252 00:28:28,850 --> 00:28:32,990 We can send much more calls in the same two-minute window. 253 00:28:33,110 --> 00:28:35,550 And this is our second network back. 254 00:28:39,730 --> 00:28:40,770 Okay. 255 00:28:41,690 --> 00:28:44,890 Now we add a new unauthenticated windows to our arsenal. 256 00:28:46,170 --> 00:28:49,450 But as always, we wanted to dream even bigger. 257 00:28:50,210 --> 00:28:53,170 So far, we achieved denial of service for every DC. 258 00:28:53,450 --> 00:28:57,370 What if we could crash anything, including Windows endpoints? 259 00:28:58,510 --> 00:29:03,370 But as far as we could find, all RPC interfaces on endpoints required authentication. 260 00:29:04,350 --> 00:29:08,230 With this constraint, we returned to our first generic Windows attempt. 261 00:29:08,290 --> 00:29:11,150 We found an RPC in WK SSVC DLL. 262 00:29:11,150 --> 00:29:16,490 It reports currently enabled transport protocols for the SMB redirector on a remote computer. 263 00:29:16,830 --> 00:29:22,230 The preferred maximum parameter lets us allocate up to four gigabytes of memory in one call. 264 00:29:22,390 --> 00:29:24,990 We don't need to use a torpedo zero. 265 00:29:24,990 --> 00:29:30,110 We could force the computer to allocate hundreds of gigabytes of memory with only a few calls. 266 00:29:30,110 --> 00:29:31,990 Sounds like the dream, right? 267 00:29:32,310 --> 00:29:36,750 However, the computer didn't crash, and we wanted to understand why. 268 00:29:38,710 --> 00:29:43,710 Reversing the library shows it's called local alloc with LMM zero in it and our parameter. 269 00:29:44,530 --> 00:29:47,990 We simulated this call in Python, allocating two gigabytes. 270 00:29:48,250 --> 00:29:58,290 Then we used virtual query, a Windows API function that retrieved information about range of pages to inspect the memory region, confirming it was committed with the mem commit flag. 271 00:29:58,510 --> 00:30:03,210 Microsoft docs explained mem commit assigned physical pages only on first access. 272 00:30:03,230 --> 00:30:05,030 And that's why it didn't crash. 273 00:30:05,030 --> 00:30:07,710 The pages weren't accessed. 274 00:30:08,830 --> 00:30:12,130 Still, this confirmed our second blind spot hypothesis. 275 00:30:12,270 --> 00:30:16,810 Developer may over trust RPC and forget about resource abuse risks. 276 00:30:18,370 --> 00:30:21,310 We searched for other ways, but we were stuck. 277 00:30:21,450 --> 00:30:24,830 So what do we do when we don't have any lead to denial of service? 278 00:30:25,630 --> 00:30:27,570 We go to the pool. 279 00:30:27,870 --> 00:30:29,390 Oh, shoot, I mean the spool. 280 00:30:31,290 --> 00:30:38,890 An interesting RPC in spool SV enumerates printers, servers, domains and providers, but it requires credentials. 281 00:30:39,730 --> 00:30:44,310 This limitation still allow any domain user to call it remotely on any computer. 282 00:30:44,430 --> 00:30:50,830 But authenticated RPC becomes stateful, packet after the binder signed, and we know that signing takes time. 283 00:30:52,130 --> 00:30:54,990 This will break the status of RPC and Torpedoes technique. 284 00:30:55,990 --> 00:31:00,770 We sneaked into Rshark and saw that the NTLM signing adds a major delay. 285 00:31:00,770 --> 00:31:02,990 And we produced the following solution. 286 00:31:03,330 --> 00:31:09,950 Pre-bind, capture the needed values, pre-sign the hard-coded packet and then keep using it. 287 00:31:10,070 --> 00:31:13,370 And that's restored Torpedoes even with authentications. 288 00:31:13,990 --> 00:31:19,670 We tested the impact and we saw that in authenticated cases, Torpedoes is even more relevant. 289 00:31:19,670 --> 00:31:25,270 We exploited the name parameter and with pre-binding and signing, crashed the end point. 290 00:31:37,310 --> 00:31:41,910 Now a single user can crash all Windows machine in a domain . 291 00:31:43,110 --> 00:31:47,670 And without further ado, let's see how to crash Windows 11 with Windows. 292 00:31:48,610 --> 00:31:51,970 So first let's see the target IP of the remote computer. 293 00:31:54,820 --> 00:31:59,040 And now we'll try to ping this IP in order to see that the computer is still alive. 294 00:31:59,720 --> 00:32:01,960 And we can see that the computer is alive. 295 00:32:02,940 --> 00:32:05,280 Now we'll attack the computer with Torpedoes. 296 00:32:05,280 --> 00:32:08,400 We can see the pre-bindings happening right now. 297 00:32:08,700 --> 00:32:10,500 And the computer is still alive. 298 00:32:13,290 --> 00:32:16,810 Now we'll attack it again and fast forward a little bit. 299 00:32:18,070 --> 00:32:21,370 We can see that the computer don't respond to our pings anymore. 300 00:32:26,120 --> 00:32:28,500 And wow, the computer is crashed. 301 00:32:28,620 --> 00:32:30,860 And we reach the blue screen of death. 302 00:32:37,670 --> 00:32:41,130 Here's our final Windows 11, Windows vulnerability. 303 00:32:41,410 --> 00:32:43,210 The last one in this talk. 304 00:32:43,990 --> 00:32:46,650 Let's look up all our denial of service attacks. 305 00:32:46,730 --> 00:32:49,830 We found four new remote trigger denial of service attacks. 306 00:32:50,090 --> 00:32:54,730 The first vulnerability used both for denial of service and distributed denial of service. 307 00:32:54,890 --> 00:32:59,330 We started with this and ended up with any Windows end point. 308 00:32:59,390 --> 00:33:04,950 All the DC attacks are unauthenticated and any domain user can crash any machine in the domain. 309 00:33:05,630 --> 00:33:09,470 Microsoft fixed everything and we want to thank them for cooperation. 310 00:33:10,930 --> 00:33:13,710 We want to emphasize that these attacks are critical. 311 00:33:13,710 --> 00:33:19,190 They can alter organization, damage medical equipment, or even frame governments for cyber attacks. 312 00:33:19,430 --> 00:33:22,650 Now we'll get back to Or for research takeaways. 313 00:33:28,850 --> 00:33:33,990 Thank you Shachak for all of these very interesting technical details. 314 00:33:33,990 --> 00:33:35,930 I hope you enjoyed them. 315 00:33:36,810 --> 00:33:46,390 But we still have one more important thing to talk about when we conduct such a research and see its results. 316 00:33:46,390 --> 00:33:48,130 And that's the takeaways. 317 00:33:48,250 --> 00:34:03,230 So the first takeaway that we have from this research is that if code can be triggered remotely then you should prepare for worst case scenario concurrency and resource usage. 318 00:34:03,290 --> 00:34:06,950 And you should ensure robust security measures. 319 00:34:07,150 --> 00:34:12,470 In MSRPC the most likely scenario is usually one client. 320 00:34:12,470 --> 00:34:20,530 However in the worst case scenario there could be a limitless number of clients causing unexpected loss. 321 00:34:20,550 --> 00:34:25,750 That's also true when talking about the LDAP client in domain controllers. 322 00:34:25,770 --> 00:34:38,510 Their LDAP client can be directly triggered by a remote attacker that aims to exhaust the LDAP client's resources and exhaust the entire machine finally. 323 00:34:39,490 --> 00:34:54,110 Our second takeaway is that organizations must assume that all their servers and end points can be targeted by DDoS attacks whether they are public facing or not. 324 00:34:54,930 --> 00:35:06,350 Therefore they should set up proper mitigations for such attacks in their infrastructures including both defending assets but also quickly identifying a single source creating such attacks. 325 00:35:06,490 --> 00:35:18,850 DDoS attacks or DDoS like attacks can be single sourced and come from within your organization or in our words torpedoes. 326 00:35:20,210 --> 00:35:36,510 And our last and third takeaway is that the fact that some forms of servers can be turned into clients can be leveraged by attackers for crafting and presenting a false image of reality for various types of purposes. 327 00:35:36,510 --> 00:35:41,770 Or alternatively harness resources that they do not possess for malicious purposes. 328 00:35:42,230 --> 00:35:59,310 For example, attackers could use our WIND DDoS vulnerability in order to trigger domain controllers from a certain country to attack a different country in order to incriminate a certain government or organization for political purposes. 329 00:36:01,110 --> 00:36:16,790 And with this last takeaway we want to share with you that we believe that the WIND DDoS epidemic has just begun and we think that these techniques are just the first steps towards many more vulnerabilities in RPC. 330 00:36:16,990 --> 00:36:22,470 We really recommend that you stay tuned for upcoming conferences, wink, wink. 331 00:36:22,690 --> 00:36:36,470 And generally we encourage you to try to implement our ideas to find more of these vulnerabilities so they can be fixed before real attackers take advantage of them. 332 00:36:37,190 --> 00:36:41,170 So thank you everyone for joining us. 333 00:36:41,170 --> 00:36:49,330 This would be the QR code for the WIND DDoS repository that will go live right after this talk. 334 00:36:49,330 --> 00:36:51,990 Just ten minutes and we'll release it. 335 00:36:51,990 --> 00:36:57,430 You can have the social media details of both myself and Shachak. 336 00:36:57,430 --> 00:37:02,030 You can contact us if you like that and we'll be here for questions as well. 337 00:37:02,030 --> 00:37:03,850 So thank you everyone. 338 00:37:06,550 --> 00:37:10,290 And we'd love to take a selfie with you if that's okay. 339 00:37:10,790 --> 00:37:11,850 Cool. 340 00:37:11,850 --> 00:37:12,830 Let's do. 341 00:37:12,850 --> 00:37:13,970 Thank you.