1 00:00:00,000 --> 00:00:01,520 Anyway, are you all ready? 2 00:00:01,900 --> 00:00:05,420 Without further ado, Quentin and Will are going to wow you for the next 45 minutes. 3 00:00:05,420 --> 00:00:06,600 So let's give it up for them. 4 00:00:10,940 --> 00:00:12,260 Thank you. 5 00:00:13,420 --> 00:00:14,480 Hi, everyone. 6 00:00:14,480 --> 00:00:18,460 Welcome to our talk, turning your Active Directory into the attacker C2. 7 00:00:19,800 --> 00:00:25,720 Today we'll talk about group policy, object enumeration and exploitation. 8 00:00:27,000 --> 00:00:28,740 Let's first introduce ourselves. 9 00:00:28,920 --> 00:00:33,140 My name is Wilfred with my colleague Quentin, or Quentin in French. 10 00:00:33,600 --> 00:00:39,800 We do pen tests and red team at SYNACTIVE and this is the first time for us at DEF CON. 11 00:00:41,220 --> 00:00:43,780 So, let's start by a quick introduction. 12 00:00:45,820 --> 00:00:57,120 During an assessment, one of our colleagues said, well, yeah, we have an account that can modify a GPO that applies to domain controllers, but let us check for the ADCS first. 13 00:00:57,720 --> 00:01:03,320 So they enumerate ADCS, they find out they can exploit ESC4 which is a previous escalation. 14 00:01:03,480 --> 00:01:06,980 They exploited it successfully, but at the end, they got detected. 15 00:01:07,540 --> 00:01:14,520 So now we always mess up with them, like next time, maybe don't go straight for ADCS and look at GPO. 16 00:01:15,040 --> 00:01:17,580 So this is why we are talking about GPO today. 17 00:01:18,300 --> 00:01:23,020 Group policy object attack vectors may just be the ugly ducklings of ID exploitation. 18 00:01:23,780 --> 00:01:24,280 Why? 19 00:01:24,280 --> 00:01:30,120 Maybe it's not well known, maybe it's too risky to exploit because you can mess up active directory. 20 00:01:30,340 --> 00:01:32,040 Maybe there's not enough tooling. 21 00:01:32,420 --> 00:01:36,480 So we think it's a shame because attackers don't have such concern. 22 00:01:36,700 --> 00:01:43,340 And also GPO exploitation can be quite powerful because you can manage a lot of things into the active directory. 23 00:01:44,740 --> 00:01:51,300 So today we are going to brief, uh, give you a brief recap on how GPO works, how they are implemented. 24 00:01:51,380 --> 00:01:58,240 And we release four tools that will show that we can enumerate them and also exploit them with different kind of parts. 25 00:01:59,100 --> 00:02:02,400 Okay, so let's start by explaining group policy objects. 26 00:02:03,360 --> 00:02:07,960 A GPO is a collection of misconfiguration that applies to, uh, AD objects. 27 00:02:08,160 --> 00:02:11,220 It's a core feature of active directory. 28 00:02:11,360 --> 00:02:14,180 It deals with device and identity management. 29 00:02:14,580 --> 00:02:18,020 And a GPO can define user settings and computer settings. 30 00:02:18,300 --> 00:02:21,440 I will get into the details of that later. 31 00:02:22,900 --> 00:02:27,760 When you want to configure GPOs, you can open the group policy management console. 32 00:02:28,240 --> 00:02:35,920 And GPO has not directly, uh, not applied directly to user and computers, but most of the time to organizational units. 33 00:02:36,700 --> 00:02:41,840 They can be also applied to different objects such as sites or domains, but is less common. 34 00:02:43,080 --> 00:02:50,860 Something to, important to mention is like when you define settings for GPOs, by default GPO will inherit from the parent container. 35 00:02:50,960 --> 00:02:57,060 For instance here, the default domain policy will apply to all child containers, all child organizational units. 36 00:02:57,060 --> 00:03:01,260 For instance here, workstation, uh, servers and so on. 37 00:03:03,700 --> 00:03:07,660 The implementation of GPO in active directory is bit specific. 38 00:03:08,180 --> 00:03:10,820 They are basically made of two components. 39 00:03:10,980 --> 00:03:15,000 The first one will be the group policy container, which is a LDAP object. 40 00:03:15,080 --> 00:03:20,380 You will find out, you will find, uh, GPO metadata, name, description, version and so on. 41 00:03:20,380 --> 00:03:22,960 I will get some specific details after. 42 00:03:23,680 --> 00:03:32,900 You will also find the group policy template, which is the SMB share, that will contain the GPO files that describe the configuration that will be applied by the clients. 43 00:03:34,400 --> 00:03:44,380 So what you have to remember is basically you have two components, the LDAP parts and the SMB parts, as are tied together by a specific unique identifier, the GUID. 44 00:03:45,060 --> 00:03:53,300 And basically the LDAP part say what the, where the GPO applies and the SMB part said, okay, the GPO does this specific settings. 45 00:03:54,900 --> 00:03:58,280 Okay, so let's try to go into the details of the first part. 46 00:03:58,280 --> 00:04:00,420 The, everything regarding the LDAP. 47 00:04:01,080 --> 00:04:14,200 There are some noteworthy LDAP attributes, such as on GPC objects, the GPC file sys path, it will indicate where the, the UNC path of the GPT, so the SMB parts, where the GPO file located. 48 00:04:14,620 --> 00:04:20,340 You also have more attributes such as flags that will say the status of the user or computer configuration. 49 00:04:20,420 --> 00:04:22,020 It might be enabled or disabled. 50 00:04:22,460 --> 00:04:24,140 I will move on on that later. 51 00:04:24,900 --> 00:04:28,240 You also have specific LDAP attributes on organizational units. 52 00:04:28,620 --> 00:04:34,260 For instance, the GP link, it will say if the GPO is linked to this organizational unit, it can also be enforced. 53 00:04:34,420 --> 00:04:37,040 And you also have options such as inheritance. 54 00:04:39,360 --> 00:04:51,080 And the other part, the SMB part was the GPO templates, so in the SMB share you have multiple uh, configuration file, such as group.xml, received.xml and so on. 55 00:04:51,100 --> 00:04:54,320 When you can specify those, those settings. 56 00:04:54,980 --> 00:05:02,980 If I take a quick example on the bottom, you say group.xml, which is where you can assign uh, group assignments. 57 00:05:03,300 --> 00:05:08,020 Here we can see that the user Jack is added to the remote desktop user group. 58 00:05:09,140 --> 00:05:10,140 Okay. 59 00:05:10,360 --> 00:05:14,380 So, this is the basics, so now let's go into the details of the attributes. 60 00:05:15,080 --> 00:05:18,920 First, we will talk about inheritance on organizational units. 61 00:05:19,540 --> 00:05:24,600 I mentioned previously that by default, GPO will be inherited on the child containers. 62 00:05:24,900 --> 00:05:39,580 What you can do is like, you can avoid this by blocking inheritance, and when you go on the management console, right click on the workstation, and on the organizational unit, you can block inheritance, and what does, what's the change? 63 00:05:39,580 --> 00:05:45,440 On the LDAP you have the GPO option that will switch from 0 to 1, and it will be 1 if inheritance is blocked. 64 00:05:45,620 --> 00:05:52,420 And when you do that, any uh, parent uh, GPO will not apply to the specific organizational units. 65 00:05:54,120 --> 00:06:03,060 We also have the link attributes, so GPO are linked to organizational unit, like I mentioned earlier, and this is done by the GP link attributes. 66 00:06:03,500 --> 00:06:11,120 You will find in this specific attribute the common name of the GPO, and at the end you will find an integer that will describe the link status. 67 00:06:11,860 --> 00:06:18,380 This integer may vary from 0 to 3, and it will say if the GPO is linked, unforced, and so on. 68 00:06:19,620 --> 00:06:24,480 And if the GPO for instance is unforced, it will ignore the inheritance status. 69 00:06:25,640 --> 00:06:37,260 Here we have the, the table that said the configuration, most of the time you will find out that the integer value will be 0, but we also, we can also see unforced GPO, so we will find the integer value of 2. 70 00:06:39,120 --> 00:06:43,300 Move on to other attributes, now it's related to GPOs. 71 00:06:43,600 --> 00:06:52,100 So I mentioned earlier that GPO can apply to a user or computer configuration, and you can change it with the specific flags. 72 00:06:52,260 --> 00:06:56,520 So you can enable everything, which is the default. 73 00:06:56,700 --> 00:07:01,980 You can also choose to apply only computer or user settings, and you can also choose to disable everything. 74 00:07:02,960 --> 00:07:14,300 And what's going on behind the scene is like, we have a specific attribute again on the GPO object, which is called the flags, and we have an integer that will describe which component is enabled. 75 00:07:15,440 --> 00:07:27,960 So the integer, by default the integer value will be 0, so basically computer and user configuration are both applied, but we can see sometimes it's, for instance, if the integer value is 1, only computer settings are applied. 76 00:07:30,940 --> 00:07:43,700 Last part regarding GPO implementation is like, we have by default, the computers that updates their GPO, they are doing a background update every 90 minutes, with a random offset from 0 to 30 minutes. 77 00:07:44,340 --> 00:07:54,280 The setting can be changed, on the eGPO you can change the settings and put the value of 0, and the documentation, if the value is 0, it will try to update the GPO every 7 seconds. 78 00:07:54,520 --> 00:07:59,020 I will not recommend to update your GPO every 7 seconds, but it's technically possible. 79 00:08:00,760 --> 00:08:05,140 And so another thing to mention is like, not all policy are proceed. 80 00:08:05,220 --> 00:08:15,040 For instance, uh, software installation will be only applied when the computer starts, or there are also specific GPO that are triggered when the user logs on on the computer. 81 00:08:17,180 --> 00:08:20,280 So now, how do computers update these GPOs? 82 00:08:20,420 --> 00:08:30,420 So first, it interact with the domain controller, querying for the LDAP, for specific attributes, to know what are the GPO tied to the spe- to the specific computers. 83 00:08:31,080 --> 00:08:35,840 It queries the attributes such as GP link, or GP option, that I mentioned earlier. 84 00:08:36,420 --> 00:08:39,820 And is it now, the computer have a list of which GPO applies. 85 00:08:40,880 --> 00:08:50,860 Then it query the LDAP again for more information, such as GP file sys path, so now the computers know where the, uh, files are located, where the SMB share. 86 00:08:51,120 --> 00:08:54,920 By default it will be on the domain controllers in the CISVOL share. 87 00:08:56,200 --> 00:09:04,200 We also retrieve all the information such as flag, is computer or, uh, user or computer configuration are, are enabled or not. 88 00:09:04,940 --> 00:09:13,720 And now because it have all information regarding the LDAP, it initiate the SMB connection, and it retrieves all the file and applies the GPO. 89 00:09:15,380 --> 00:09:19,200 Okay, so this was, uh, how GPO works. 90 00:09:19,500 --> 00:09:26,160 There's also few, uh, other attributes that we don't have time to talk about, but it's not the main, main important one. 91 00:09:26,740 --> 00:09:34,440 So now, we want to present you a tool that we developed when we want to enumerate GPOs, and also doing like a stealthy way. 92 00:09:35,780 --> 00:09:38,940 We find out that during assessment, GPO enumeration is quite useful. 93 00:09:38,940 --> 00:09:43,500 It reveals valuable insights into the security posture of the system. 94 00:09:43,960 --> 00:09:52,120 And most of the time we will see, uh, interesting stuff like group membership or addition, previous assignment, risk modification and so on. 95 00:09:52,960 --> 00:09:57,680 So it's quite interesting from an offensive perspective and we go into the detail of each one. 96 00:09:58,420 --> 00:10:01,980 The first one will be, the most common one will be group memberships. 97 00:10:02,660 --> 00:10:05,260 Group memberships are frequently defined through GPO. 98 00:10:06,000 --> 00:10:09,720 Information that can prove crucial for lateral movements. 99 00:10:09,840 --> 00:10:19,400 For instance, I want to perform lateral movements, but I don't want to, I have a specific account, I don't want to try this specific account on every computer, it's quite noisy. 100 00:10:19,560 --> 00:10:25,200 And I don't want to perform, uh, wide range scans such as using net exec on large ranges. 101 00:10:25,800 --> 00:10:35,620 So by enumerating this through GPO, I know exactly where this specific user has admi- administrative privilege rights, or where it can do on specific computers. 102 00:10:35,860 --> 00:10:38,420 So I have a better understanding of group assignments. 103 00:10:38,880 --> 00:10:40,940 So, let's do an example. 104 00:10:41,800 --> 00:10:48,820 Here, I'm calling the LDAP, for uh, with a tool that is called LDAP, and I try to enumerate all the GPO. 105 00:10:48,960 --> 00:10:58,960 The first one is called LORGP, which is quite interesting for us because I want to perform lateral movements, uh, and this is also something that we already seen during our assessments. 106 00:10:59,640 --> 00:11:02,760 So, I'm interested in this specific one. 107 00:11:03,480 --> 00:11:16,900 I'm looking at this specific unique ID identifier, which starts with 008, and then I go to the domain controller on the SysVol share, and I try to retrieve all the file dedicated to this specific GPO. 108 00:11:17,300 --> 00:11:26,780 And within those files, I find out there's a group.xml file that say basically, the group domain user is added to the remote desktop user group. 109 00:11:27,200 --> 00:11:30,780 So I know this GPO is adding domain user to remote desktop. 110 00:11:31,040 --> 00:11:33,780 Now I need to find out where, on which computer. 111 00:11:34,800 --> 00:11:41,520 So, like I mentioned earlier, by default GPO, I mean, most of the time GPO are linked to organizational units. 112 00:11:41,660 --> 00:11:50,400 So again, I try to animate all the organizational units, and I can see here that my GPO LORGP is tied to workstation organizational units. 113 00:11:51,260 --> 00:11:59,180 Next step is to find out which computers within this organizational units, and here we have the works, WKS01corp.com. 114 00:11:59,640 --> 00:12:09,800 So, now if I, uh, type everything together, I can, I can know that the domain user group can LGP on the workstation01corp.com. 115 00:12:10,440 --> 00:12:14,520 So now I can move laterally easily without doing any noise. 116 00:12:14,520 --> 00:12:16,320 I don't want, I want to be stealthy. 117 00:12:16,320 --> 00:12:18,300 So it's better to animate GPOs. 118 00:12:19,260 --> 00:12:21,900 What you can do also is privilege assignments. 119 00:12:22,460 --> 00:12:26,080 You can assign, uh, interesting privilege for GPO. 120 00:12:26,320 --> 00:12:35,160 For instance, you can assign the SU debug privilege, which allows to debug any processes that you do not own, and it can be a free privilege escalation. 121 00:12:35,980 --> 00:12:39,580 We found out this is really uncommon, but still possible. 122 00:12:39,980 --> 00:12:42,560 But, in reality, it happens. 123 00:12:42,860 --> 00:12:55,360 Here we have an, uh, a practical example that's, we, the SETCB privilege has been assigned to any user on the, on the machine, and basically it's a free privilege escalation. 124 00:12:55,360 --> 00:13:03,060 With this specific privilege, you can add, uh, arbitrary groups to your token, such as administrator, and compromise the, the computer. 125 00:13:05,940 --> 00:13:10,520 What we see most of the time will be, uh, connection restriction. 126 00:13:11,400 --> 00:13:26,020 When you don't want your domain admin to connect anywhere to, in order to reduce the risk of credential exposure, you can perform connection restriction through, through GPOs, and basically they will deny, uh, access to specific computers. 127 00:13:26,160 --> 00:13:31,400 So it mitigates privilege escalation, and try to preserve the, the tiering model. 128 00:13:32,440 --> 00:13:43,220 So when you do it, when you're performing this kind of enumeration, you know, for instance, that domain admin will never connect to specific workstation, or specific machine to, uh, tie to organizational units. 129 00:13:43,340 --> 00:13:47,100 So, there's no point to go there and waiting for domain admin. 130 00:13:49,300 --> 00:13:53,020 You can also perform registry, registry modification through GPOs. 131 00:13:54,200 --> 00:14:03,280 Legacy name resolution protocols such as LMNA, MD, MDNS, and BNS are, are relative good, uh, exploitation vectors. 132 00:14:03,440 --> 00:14:08,300 It have, it have, it has been exploited since long time with such, with tools such as Responder. 133 00:14:08,760 --> 00:14:12,800 And administrator disable, disable those protocols through GPOs. 134 00:14:13,440 --> 00:14:18,100 Here, we can see that the, uh, MDNS protocol has been disabled through GPOs. 135 00:14:18,100 --> 00:14:24,700 So, by doing this kind of reconnaissance, I know that this, there's no point to exploit it on those specific machines. 136 00:14:26,500 --> 00:14:31,320 So, it helps, it, it helps me to, to choose, uh, re-revalent attack. 137 00:14:33,060 --> 00:14:35,860 Through GPO, you can also gather more information. 138 00:14:35,860 --> 00:14:38,560 For instance, you can go through hardening process. 139 00:14:39,120 --> 00:14:44,380 You can see that, for instance, LDAP or SMB signature has been enforced on which computer. 140 00:14:44,840 --> 00:14:50,900 You can also, so it's, it, it helps you to choose if relay attacks will be revalent or not. 141 00:14:51,520 --> 00:14:56,060 You can also, uh, we often see, uh, credential, um, credential hardening. 142 00:14:56,060 --> 00:15:01,340 For instance, the restrictions such as run SPPL and credential guard has been enabled. 143 00:15:02,560 --> 00:15:08,580 You can get more information regarding, uh, additional software installation such as EDR, so you know what you're dealing with. 144 00:15:11,260 --> 00:15:16,680 At the end, GPO animation can be time consuming and quite complex because there's a lot of things to take into consideration. 145 00:15:16,680 --> 00:15:20,220 You have to check for inheritance, you have to check for enforce link or not. 146 00:15:20,400 --> 00:15:23,880 You have to check if computer or user computer is enabled or disabled. 147 00:15:24,020 --> 00:15:28,560 There's also more specific filters, so we have to automate this. 148 00:15:30,180 --> 00:15:38,720 There's a lot of tools that try to enumerate, uh, GPO, uh, GPO, I mean, group PC objects, such as a well known blow down. 149 00:15:38,840 --> 00:15:43,440 But we, we noticed that it doesn't take every parameter into account. 150 00:15:43,440 --> 00:15:56,380 Here, I, I have an example where, um, within my workstation organizational unit, I have a child container, admin, and admin on the admin container, the original unit, the inheritance is blocked. 151 00:15:57,000 --> 00:16:04,200 I'm using the same GPO, L-O-L-G-P, that I mentioned previously , which allow any domain user to connect on those machines. 152 00:16:04,980 --> 00:16:11,100 So, I have a workstation one, which is within the admin container, and the inheritance is blocked. 153 00:16:11,100 --> 00:16:15,120 And the GPO, L-O-L-G-P, is on the workstation organizational unit. 154 00:16:15,260 --> 00:16:19,780 So basically, it prevents any user to connect to my workstation admin. 155 00:16:20,840 --> 00:16:29,120 On the right, on this, we have a partial command, when I try to, I mean, I update my GPOs, and I enumerate the members of the remote desktop user group. 156 00:16:29,340 --> 00:16:35,560 And the GPO, when the GPO are successfully updated, I can see there's no members, which is quite normal, because inheritance has been disabled. 157 00:16:36,460 --> 00:16:53,200 And when I collect the data with blood on, and I ingest it, blood on doesn't forget to take into consideration that the inheritance has been blocked on the admin container, and it show a path from domain user to workstation one, with the L-O-L-G-P edge, 158 00:16:53,200 --> 00:16:54,540 which is false. 159 00:16:56,840 --> 00:17:08,100 So, we notice there's other tools, but they also don't take every parameter into consideration , so we develop a tool, which is called GPO parser, that could parse all GPO configuration parameter that's presented earlier. 160 00:17:08,500 --> 00:17:13,040 It tries to, it tries to reveal misconfiguration and privileged relationships. 161 00:17:13,760 --> 00:17:20,820 It supports both online and offline analysis, and we, also we try to enrich blood on with useful hedger. 162 00:17:20,820 --> 00:17:29,940 This way we can create admin, the new hedges that we have lost from our GPO collection, such as admin tool, can L-G-P, can PS remote. 163 00:17:30,880 --> 00:17:34,620 You will find the tool on the, on the Synaptic GitHub right after the talk. 164 00:17:35,040 --> 00:17:38,240 So, I will give you a quick demo of this one. 165 00:17:39,700 --> 00:17:53,020 First we'll try to, um, collect it, I will, we'll collect it, uh, sorry, demo, I will, I will first show the, the demo that goes online. 166 00:17:56,810 --> 00:18:01,390 Okay, so basically you have to, here I'm doing the collection on remotely. 167 00:18:01,570 --> 00:18:12,710 You can collect GPO with, uh, a low privilege, uh, user, so I'm specifying the credential, I'm specifying the, the, um, the LDAP, and also the domain controller. 168 00:18:12,950 --> 00:18:17,030 It tries to connect, which is all the, all the file, and it parse. 169 00:18:17,030 --> 00:18:25,270 And here we can see for instance, this specific GPO, which is called Unforced SMB Signing, has been applied, you can see there's, there's some specific connection restriction tied to domain admin. 170 00:18:25,610 --> 00:18:30,530 You can also assign privilege, for instance, SA debug privilege to the developer groups, and so on. 171 00:18:30,530 --> 00:18:36,730 You can, for instance, you can see that the group, all, uh, admin, all over station are workstation admins. 172 00:18:37,990 --> 00:18:40,510 You can also perform this reconnaissance offline. 173 00:18:41,910 --> 00:18:50,350 So what you have to do is you have to collect all the LDAP data, I will do this LDAP, collect few information getting the LDAP. 174 00:18:50,370 --> 00:18:55,010 I will also need to connect the, retrieve the policy, which are by default on the SysVault share. 175 00:18:55,230 --> 00:18:57,110 I'm retrieving everything here. 176 00:18:57,270 --> 00:19:02,330 It can be, we can retrieve all the needed files, but here for the presentation, I just retrieve everything. 177 00:19:03,130 --> 00:19:04,590 And I will pass it locally. 178 00:19:04,630 --> 00:19:08,470 So I have to specify where I find the SysVault share and the LDAP folder. 179 00:19:09,310 --> 00:19:16,430 And what I also want to mention here, like, we can also filter, for instance, we want to know the GPO that's only applied to a specific target. 180 00:19:16,550 --> 00:19:19,530 For instance, the specific computer workstation one. 181 00:19:19,810 --> 00:19:30,110 And here, locally, I can see that all the GPO that's applied to this specific workstation, and now I can see the same information, but tied to this specific workstation. 182 00:19:32,030 --> 00:19:38,850 So basically it's the same, you can see that domain user can, uh, can, can connect through a remote desktop user group. 183 00:19:39,750 --> 00:19:44,050 Now I would like to let my colleague contact, speak about abusing ACLs. 184 00:19:45,130 --> 00:19:46,870 Alright, thank you Wilfred. 185 00:19:46,870 --> 00:19:54,110 So Wilfred explained to you how GPOs are implemented, and how you can abuse them to enumerate some security relevant, uh, configurations. 186 00:19:54,430 --> 00:20:02,710 For my part, I will actually explain to you how we can abuse GPO objects in order to compromise active directory objects, so users and computers. 187 00:20:03,090 --> 00:20:09,890 And the first way I'm going to do that is with the most standard way you would exploit a GPO in an active directory engagement. 188 00:20:09,890 --> 00:20:18,970 So let's say you have, uh, write access to a GPO with a user, um, and this is not an uncommon situation, we encounter it pretty often in engagements. 189 00:20:18,970 --> 00:20:24,050 This can be T1 accounts, this can result from administration, uh, mistakes, et cetera. 190 00:20:24,130 --> 00:20:38,050 And this is actually a very powerful primitive, attack primitive, because when you control a GPO, you can compromise all the objects that are linked, um, that are included in all linked organizational units, including sub-OS. 191 00:20:38,450 --> 00:20:51,130 Um, when you exploit a GPO, what you basically want to do is just leverage some built-in GPO features in order to deploy malicious configurations to the users and computers to which the GPO applies. 192 00:20:51,130 --> 00:20:54,930 And you can really, um, deploy a lot of malicious configurations. 193 00:20:54,930 --> 00:21:07,810 You can deploy some scheduled tasks, you can deploy some immediate tasks, or you can do something like add a user to a local group, you can, uh, transfer files, execute files, setting registry keys, you can define some logon or logoff scripts. 194 00:21:07,990 --> 00:21:16,550 Uh, what I want to, to, to point out is that imagination is really your only limit when you want to exploit a GPO to, in order to compromise the objects to which it applies. 195 00:21:17,530 --> 00:21:22,310 And, uh, we have some, some offensive tooling to exploit GPOs, not so many. 196 00:21:22,650 --> 00:21:28,970 Um, we can have some things like charge GPU abuse, by GPU abuse, GPONs, or the DRST tool suites. 197 00:21:29,070 --> 00:21:36,290 But, uh, during engagements, we found out that these tools have some limitations that made them pretty difficult to exploit. 198 00:21:36,310 --> 00:21:40,370 Uh, the main one is, uh, the stability and exploit safety consideration. 199 00:21:40,710 --> 00:21:43,190 So, GPOs are very critical in active directory. 200 00:21:43,190 --> 00:21:48,570 They are sensitive, uh, architecture components, so you really don't want to screw them up. 201 00:21:48,570 --> 00:21:50,910 So, exploit safety is really important. 202 00:21:51,310 --> 00:21:55,590 Um, there was also some, some lack, some lacking in clean up and revert capabilities. 203 00:21:55,590 --> 00:22:00,370 After we exploited, we want to clean up for stealth or just, just to clean up after yourself. 204 00:22:00,530 --> 00:22:15,830 Um, very often, there was no possibility to create GPOs, to manage links, to target specific objects with your malicious configurations, and more generally, there was a lack of available actions and options that you could configure, uh, to exploit your GPO. 205 00:22:15,910 --> 00:22:19,810 So, we created the group policy backdoor.py, uh, tool. 206 00:22:19,990 --> 00:22:26,750 This is a Python implementation using only LF3 and SMB protocol, so no impact for stealth considerations . 207 00:22:27,010 --> 00:22:30,350 Um, you can do quite a bunch of things with group policy backdoor. 208 00:22:30,350 --> 00:22:33,130 You can create your GPOs, delete them, back up them. 209 00:22:33,130 --> 00:22:34,330 You can manage your links. 210 00:22:34,330 --> 00:22:37,230 You can inject some customizable configurations. 211 00:22:37,510 --> 00:22:46,550 Um, importantly, you can also leverage the item level targeting feature of GPOs in order to only inject your configuration to specific objects. 212 00:22:46,590 --> 00:22:50,550 So, if you want to target a specific computer, you can, with group policy, uh, backdoor. 213 00:22:50,570 --> 00:22:54,550 You can also clean up after yourself and revert the actions you perform on clients. 214 00:22:54,550 --> 00:22:57,390 So, it will be available on GitHub, uh, after DEF CON. 215 00:22:58,470 --> 00:23:04,270 For it to be a little bit more concrete, let's take a real world example that we encountered, like, a few months ago. 216 00:23:04,490 --> 00:23:07,530 So, and let's try to exploit it with group policy backdoor. 217 00:23:07,670 --> 00:23:20,830 So, we compromised an account a few months back, uh, that has, that has, uh, right privileges of a pretty interesting GPO because the GPO was applying to a gem server that was used by domain administrators in order to perform some administrative actions. 218 00:23:20,950 --> 00:23:24,830 We didn't have any kind of privilege other than the rights on the GPO. 219 00:23:24,850 --> 00:23:28,090 We did not even have network access to this gem server. 220 00:23:28,150 --> 00:23:34,310 But what we did was that we exploited the GPO in order to add a scheduled task on this gem server. 221 00:23:34,310 --> 00:23:40,890 We configured this scheduled task to run in a privileged context in the, using the identity of a domain admin. 222 00:23:40,950 --> 00:23:46,650 And the scheduled task only added, uh, an account under our control to the domain admin's group. 223 00:23:46,650 --> 00:23:59,910 And you can see here a pretty interesting thing, is that we are exploiting a GPO that applies to a gem server in order to, let's, so to say, trap the gem server so that the scheduled task will trigger when the domain admin connects to it. 224 00:24:00,210 --> 00:24:02,770 All right, let's see a demonst- a quick demo. 225 00:24:04,490 --> 00:24:12,960 All right, uh, it's, this one, I think it's coming. 226 00:24:13,040 --> 00:24:14,420 All right, all right. 227 00:24:14,440 --> 00:24:18,160 So, let's say that we compromise the user that is called Aloy. 228 00:24:18,160 --> 00:24:21,140 You can see here, I'm authenticated with Kairos, with Aloy. 229 00:24:21,560 --> 00:24:24,780 Um, Aloy has some standard groups. 230 00:24:24,780 --> 00:24:26,300 You can see here I named the groups. 231 00:24:26,300 --> 00:24:29,200 It is part of the IT support group, quite standard. 232 00:24:29,440 --> 00:24:35,180 Uh, let's use group policy backdoor first to enumerate the GPOs of the domain with the enum list GPOs commands. 233 00:24:35,300 --> 00:24:37,300 You can see there is a bunch of GPOs. 234 00:24:37,320 --> 00:24:40,060 The one that interests us is called gem servers handling. 235 00:24:40,860 --> 00:24:46,640 Let's use group policy backdoor to get some more details on this GPO with the, uh, GPO details commands. 236 00:24:47,160 --> 00:24:48,160 All right . 237 00:24:48,360 --> 00:24:54,600 Um, the most important, uh, thing that we notice is that our current user, Aloy, has right permission of the GPO. 238 00:24:54,600 --> 00:24:55,440 This is pretty good. 239 00:24:55,440 --> 00:24:58,080 This means that we will be able to exploit it. 240 00:24:58,360 --> 00:25:03,200 And this GPO is, is tied to an organization unit that is called gem servers. 241 00:25:03,340 --> 00:25:08,420 In this gem servers organization unit, we have the gem server that we are trying to compromise. 242 00:25:08,420 --> 00:25:13,680 As you can see here, the AD01 bastion, which is the gem server that we are trying to exploit. 243 00:25:13,720 --> 00:25:14,120 All right. 244 00:25:14,120 --> 00:25:17,700 So, let's inject our malicious schedule task into the gem server. 245 00:25:17,800 --> 00:25:33,860 In order to do that, with group policy backdoor, you define a configuration through a .ini file that, uh, specifies what configuration you want to inject into the GPO and what option you want to, uh, configure your, uh, your malicious configuration with. 246 00:25:33,860 --> 00:25:38,000 So you can see here, quite standard, we want to inject a schedule task. 247 00:25:38,020 --> 00:25:41,140 Uh, we want it to run the cmd.exe program. 248 00:25:41,140 --> 00:25:44,320 We want it to add our user, Aloy, to the domain admins group. 249 00:25:44,580 --> 00:25:49,780 Uh, we want to impersonate ADM, which is a domain admin that connects to the gem server. 250 00:25:49,860 --> 00:25:54,180 And we want to repeat this, uh, schedule task every minute because we don't want to wait. 251 00:25:54,660 --> 00:25:56,720 Additionally, you can provide some filters. 252 00:25:56,720 --> 00:26:03,140 Here I say, I only want this schedule task to be defined on the AD01 bastion.com.com computer and not on anything else. 253 00:26:03,140 --> 00:26:04,300 For stealth, for instance. 254 00:26:04,300 --> 00:26:10,580 And you just, uh, provide a filter with a computer, computer name, um, uh, title. 255 00:26:10,980 --> 00:26:17,180 So let's run group policy backdoor with this configuration file, and this will inject our malicious schedule task into the GPO. 256 00:26:17,180 --> 00:26:25,700 You can see here, we provide the modify commands, and we provide the .ini file that I just, uh, showed, uh, to the gem server's hardening GPO on which we have write access. 257 00:26:25,840 --> 00:26:27,780 So we execute group policy backdoor. 258 00:26:27,860 --> 00:26:29,120 It does a bunch of stuff. 259 00:26:29,120 --> 00:26:32,800 I won't go into details, but it, uh, modifies the group policy container. 260 00:26:32,800 --> 00:26:36,080 It modifies the group policy templates in order to inject your configuration. 261 00:26:36,160 --> 00:26:41,120 In bub, it also bumps the GPO version so that clients will actually update the GPO. 262 00:26:41,120 --> 00:26:52,520 And now, all we have to do is, you, we can see on the domain controller here that, uh, the gem server's hardening GPO defines the schedule task with the group policy management console, just for illustration. 263 00:26:52,820 --> 00:26:55,120 So you can see here, our schedule task is there. 264 00:26:55,260 --> 00:27:03,400 It is configured to run with a trigger , with an action that adds our user to domain admin, some item level targeting in order to only be defined on the bastion. 265 00:27:03,760 --> 00:27:04,460 All right. 266 00:27:04,820 --> 00:27:12,240 So at this point, we would just wait for the bastion to refresh, uh, its GPOs, define the schedule task, and then add our user to the domain admins group. 267 00:27:12,280 --> 00:27:13,780 So that's what we're going to do. 268 00:27:13,940 --> 00:27:20,100 We will force the GPO refresh with GPO updates, because we don't have time to, to wait for 90 minutes. 269 00:27:20,480 --> 00:27:23,160 Um, so yeah, the GPO update command is executed. 270 00:27:23,160 --> 00:27:33,620 And you can see right after, that, uh, our schedule task will be defined on the gem server, and then the domain admin at the MQL will execute it, and add our user to the domain admins group. 271 00:27:33,620 --> 00:27:39,160 You can see here, we have the schedule task defined, running as MQL, and then it's all set. 272 00:27:39,160 --> 00:27:44,560 We just have to wait one minute, and our user will be actually added to the domain admins group. 273 00:27:44,600 --> 00:27:51,980 So I just cut the minute out, but, uh, you can see here with an LDIP command, that alloy is now part of the domain admins group. 274 00:27:52,340 --> 00:27:53,160 All right. 275 00:27:53,160 --> 00:27:56,560 So, you, you did your exploitation, that's great. 276 00:27:56,680 --> 00:27:59,360 What you want to do then, is clean up after yourself. 277 00:27:59,360 --> 00:28:04,500 You want, uh, to, to, to remove this configuration you injected into the GPO. 278 00:28:04,600 --> 00:28:19,640 And group policy backdoor makes it pretty easy, because each time it runs, it creates a state folder, that has many information about what it did, and you just have to provide the state folder to the clean commands, in order to, um, to clean up after yourself, 279 00:28:19,640 --> 00:28:23,400 and to, to remove the configuration that you injected from the GPO. 280 00:28:23,400 --> 00:28:34,420 So you can see here, I provide the state folder into the clean commands, I execute the commands, and it just, again, does a bunch of stuff, I won't go into details, but just removes the configuration from the GPO. 281 00:28:35,320 --> 00:28:36,080 All right. 282 00:28:38,560 --> 00:28:45,720 So that was, uh, I mean, we have a lot more examples of how we exploit the GPO during engagements. 283 00:28:45,780 --> 00:28:51,060 We used it to reach some network isolated workstations that we could not, uh, even pivot to. 284 00:28:51,060 --> 00:28:54,880 Uh, we used it to enable winarium, and add some firewall exceptions. 285 00:28:54,940 --> 00:28:59,620 We also used it to persist in the active, uh, directory environments after detection. 286 00:28:59,620 --> 00:29:07,500 So, the good news is that you can just extend group policy backdoor to your use cases, to, to add some more configurations that you want to inject into GPOs. 287 00:29:07,500 --> 00:29:10,600 You can do this pretty easily, so, don't hesitate to do so . 288 00:29:11,440 --> 00:29:15,760 All right, so this was kind of the standard GPO exploitation vector. 289 00:29:15,800 --> 00:29:24,060 We are going to dig a little bit deeper, and we're going to see how we can exploit group policy objects via, uh, NTLM relaying. 290 00:29:24,320 --> 00:29:28,080 A little, a little, um, context about this research. 291 00:29:28,080 --> 00:29:34,260 We were doing an engagement, uh , we were able to perform some NTLM relaying to the LDAP service, which is often the case . 292 00:29:34,260 --> 00:29:39,080 For instance, uh, you, you are able to relay HTTP to LDAP, right, in different configurations. 293 00:29:39,400 --> 00:29:47,420 And we were able to, uh, relay an interesting user that had right privileges of very interesting GPO, and this GPO applied to domain controllers. 294 00:29:47,800 --> 00:29:57,420 So, because we were relaying to the LDAP service, we had, we, we had the possibility to modify the group policy container, the LDAP, if you remember what Wilfred explains. 295 00:29:57,420 --> 00:30:04,960 But we had absolutely no privileges over this, the SMB share, so the group policy templates, on which the GPO configuration files are located. 296 00:30:05,120 --> 00:30:08,160 And we were wondering, is this even exploitable? 297 00:30:08,440 --> 00:30:11,140 Um, and it turns out that yes, it is. 298 00:30:11,360 --> 00:30:21,080 Because, uh, Wilfred mentioned it also a little bit earlier, but in the group policy, uh, container, you have an interesting attribute that is called the GPC file sys path. 299 00:30:21,080 --> 00:30:26,080 And it specifies the location of the G, the group policy templates as a UNC path. 300 00:30:26,120 --> 00:30:29,180 And by default, this will be simply the sys vault share , right. 301 00:30:29,820 --> 00:30:35,200 But, uh, it is actually possible to specify an arbitrary SMB share location in this attribute. 302 00:30:35,200 --> 00:30:36,380 Anything goes. 303 00:30:36,480 --> 00:30:43,460 And for, for Microsoft, this is a legitimate feature, this is expected, but not so much because it crushes the group policy management console. 304 00:30:43,460 --> 00:30:45,680 So, I guess this is kind of a gray area. 305 00:30:46,460 --> 00:30:53,660 Um, so you can see here, I just modify, uh, in, uh, in Windows, the GPC file sys path to a random IP address, right. 306 00:30:53,660 --> 00:31:00,300 And after 90 minutes, I start to see some objects that are trying to actually authenticate to me, in order to fetch the GPT files. 307 00:31:00,300 --> 00:31:03,980 So you can just specify anything in the GPC file sys path attributes. 308 00:31:04,700 --> 00:31:14,160 And so, if you pay attention, we now have, uh, an attack vector that is, uh, that you can implement through only NTM reading, by only modifying the group policy container. 309 00:31:14,260 --> 00:31:20,960 The first two steps are pretty standard, so you relay your user, uh, to the LDAP service, you interact with the LDAP service as the user. 310 00:31:21,180 --> 00:31:26,180 Um, this, the next step is to modify the GPC file sys path to point to your server. 311 00:31:26,180 --> 00:31:29,340 You say basically, yeah, the group policy template is on my machine. 312 00:31:29,420 --> 00:31:38,540 You implement an SMB server on your machine that serves malicious, uh, group policy template files, for instance, uh, defining a schedule task that you want to run on the victim. 313 00:31:38,540 --> 00:31:47,800 And now you just wait for the objects to try to apply the GPO, realize that the, the configuration files are on your system, and fetch it, fetch the files on your system. 314 00:31:47,800 --> 00:31:49,140 And it will work. 315 00:31:49,460 --> 00:31:54,840 So we created a tool that is already available, that is called GPODT, and that does just that. 316 00:31:55,300 --> 00:32:13,880 Um, I won't, I also won't go into details, but there was a main implementation challenge was to implement a working domain joined SMB server, because you can't just, uh, provide anonymous access to the object, so we refuse, modern, uh, Windows SMB clients will refuse to actually connect anonymously to, 317 00:32:13,880 --> 00:32:14,660 to a server. 318 00:32:14,660 --> 00:32:19,160 So, GPODT performs a net logon to overcome this, uh, this difficulty. 319 00:32:19,720 --> 00:32:21,380 Alright, time for another demo. 320 00:32:21,800 --> 00:32:24,060 Uh, with the GPODT tool. 321 00:32:25,320 --> 00:32:26,260 Alright. 322 00:32:26,300 --> 00:32:40,000 So, we have a domain , uh, we have the domain controllers, organizational units, with a GPO that applies to it , which is the DC corp hardening, uh, group policy objects, which is a standard group policy object, you have the GUID here. 323 00:32:40,000 --> 00:32:45,360 But what is interesting is that the ADOV user has some rights over this GPO. 324 00:32:45,660 --> 00:32:54,720 And, let's say that we relate the ADOV user to the LDAP service, we can see here, I've spinned off my NTM memory leaks, and I relate this user to the LDAP service. 325 00:32:54,720 --> 00:32:58,220 And I am interacting with the LDAP service as an ADOV user. 326 00:32:58,300 --> 00:32:59,340 Pretty standard. 327 00:32:59,840 --> 00:33:07,220 Um, so, I spin off the impact, uh, LDAP shell in order to execute LDAP commands, uh, as an ADOV user. 328 00:33:07,480 --> 00:33:20,140 Um, to be a little bit more comfortable, I will create a machine account, uh, with this LDAP shell that is called GPODT, and I will give all the rights over the group policy container for this machine account with the LDAP shell. 329 00:33:20,140 --> 00:33:29,540 So now I miss situation that I described earlier, that is to say the GPODT account has privileges over the group policy container, but nothing over the group policy templates. 330 00:33:29,540 --> 00:33:31,320 And we'll try to exploit this. 331 00:33:31,920 --> 00:33:42,740 We'll try to exploit this to add a local admin to the domain controller, and most specifically we will add the GPODT machine account that we created to the local admin group of the domain controller. 332 00:33:42,880 --> 00:33:51,160 We can see first that our GPODT account is not yet part of the domain, of the local admin group of the domain controller, within the same big client commands. 333 00:33:51,160 --> 00:33:54,760 You can see here I tried to connect to the CDOR share with GPODT. 334 00:33:54,760 --> 00:33:56,180 I got an access denied. 335 00:33:56,180 --> 00:33:57,440 This is quite expected. 336 00:33:57,620 --> 00:34:01,600 Now let's exploit, uh, let's exploit this situation with GPODT. 337 00:34:01,780 --> 00:34:04,360 So the command will look something like this. 338 00:34:04,360 --> 00:34:07,640 You specify the GUID of the GPO you want to exploit. 339 00:34:07,820 --> 00:34:12,700 You specify the user name and password of the user that has rights over the group, the group policy container. 340 00:34:12,700 --> 00:34:16,020 You specify the command that we want to execute. 341 00:34:16,020 --> 00:34:20,660 Here I want to add my GPODT computer account to the local admin group of the domain controller. 342 00:34:20,740 --> 00:34:22,860 And then you just press enter. 343 00:34:23,620 --> 00:34:35,300 The policy, uh, GPODT will do some, a lot of things, but the most important thing is that it will modify the GPC5 attributes to, uh, my, uh, my attacker machine, as you can see here. 344 00:34:35,740 --> 00:34:43,340 And now I just have to wait for the domain controller to update, update, uh, their GPOs and fetch the GPT files on my machine. 345 00:34:43,380 --> 00:34:52,600 And you can see on the right, I just, uh, execute GP updates and as soon as I execute GP updates, I have the domain controller trying to authenticate to me to fetch the GPT files, right? 346 00:34:52,600 --> 00:35:05,920 And I authenticate it with NetLogon and I provide, uh, the malicious, uh, GPT files to the domain controller and it will execute my immediate task that adds my GPODT machine accounts to the local admin group of the domain controller. 347 00:35:06,040 --> 00:35:12,460 As you can see, uh, then now I can SMB clients, uh, into the C, C dollar share of the domain controller. 348 00:35:12,460 --> 00:35:16,800 So yeah, I am local admin of the domain controller, which is, uh, good news. 349 00:35:19,200 --> 00:35:20,120 Thanks. 350 00:35:23,680 --> 00:35:25,160 Alright, last, last part. 351 00:35:25,160 --> 00:35:37,380 We'll dig even deeper, uh, and it will be the last, uh, organizational units, uh, by poisoning the GPO link attributes. 352 00:35:37,380 --> 00:35:45,160 A little bit, uh, a little bit of context, uh, we should explain to you that GPOs are linked right to organizational units through the GP link attributes. 353 00:35:45,160 --> 00:35:48,280 That looks something like, uh, what I put on the slide. 354 00:35:48,560 --> 00:36:06,400 Um, and when you have right access to an organizational unit, uh, Petros Petroupis showed a few years back that it is possible to add a GP link item in order to, um, simulate a many, a GPO that, uh, objects of the organizational units would try to apply. 355 00:36:06,420 --> 00:36:08,480 And why is it interesting? 356 00:36:08,480 --> 00:36:14,000 It is interesting in comparison with, uh, other organizational units at that vector that we previously have. 357 00:36:14,160 --> 00:36:21,180 So previously we only had one attack vector that was targeting organizational units that relied on ACL inheritance. 358 00:36:21,740 --> 00:36:36,040 And what you, what you did was basically to add a generic call, for instance, ACL to the organizational unit container, and it was by default inherited to, by all the objects of the OU, which was quite neat and simple and also reliable. 359 00:36:36,140 --> 00:36:40,160 But, uh, this attack vector had some pretty heavy limitations. 360 00:36:40,160 --> 00:36:58,020 It necessitated, uh, some high privileges, so write the ACL, and most importantly, it could not be used against what we call in active directory protected objects that has the admin counts equal to one and that attributes, because for these objects, ACL inheritance from the parent container is disabled. 361 00:36:58,420 --> 00:37:05,960 So GP link poisoning is pretty interesting because it can be exploited with very limited privileges over the organizational units. 362 00:37:05,960 --> 00:37:13,320 You only need to be able to write the GP link attributes, and it also works for privileged objects such as domain admins, right? 363 00:37:14,140 --> 00:37:15,520 So how does it work? 364 00:37:15,520 --> 00:37:17,840 What, what is, uh, precisely this attack? 365 00:37:17,840 --> 00:37:25,460 So what you do is that you modify the GP link attributes in order, as I said, to inject an additional GPO link to the OU. 366 00:37:25,460 --> 00:37:33,600 And as you can see here, uh, your injected item will not point to the domain, but to a domain name that resolves to your machine. 367 00:37:33,600 --> 00:37:39,320 Here, I added a GP link item that points to attacker.cop.com instead of cop.com. 368 00:37:39,340 --> 00:37:56,240 And when the objects are fetching the GPOs they should apply, because they are linked to their OUs, they will try to, to apply this GPO, and then the attacker should only simulate a group PC container, a simulator group PC template, and just execute malicious configurations through this, 369 00:37:56,240 --> 00:37:58,280 uh, injected GPO. 370 00:37:58,340 --> 00:38:02,720 So we created a tool that we called Unet, uh, to automate the attack. 371 00:38:02,720 --> 00:38:04,260 It is available on GitHub. 372 00:38:04,260 --> 00:38:15,240 We also added two edges to Bloodhound, so the right GP link, and then the right, uh, edges on organizational units, because they are exploitable through the, through the, um, attack vector I just described. 373 00:38:15,400 --> 00:38:19,860 All right, if I, let's just, uh, uh, describe it more visually. 374 00:38:19,860 --> 00:38:24,760 So first, you have a user that can modify, that can write the GP link of an OU, right, first step. 375 00:38:24,820 --> 00:38:28,980 Then you poison the GP link, you add an, an item to the GP link. 376 00:38:29,040 --> 00:38:35,000 Third, you, objects will try to fetch their group PC container on your machine, you simulate a group PC container. 377 00:38:35,020 --> 00:38:43,700 And finally, fourth, uh, the, the objects will also try to fetch the group PC template on your machine, you simulate a group PC template, and they apply your malicious configurations. 378 00:38:44,160 --> 00:38:49,200 All right, let's, uh, let's have the last demonstration of the session with the UNET tool. 379 00:38:50,480 --> 00:38:51,320 All right. 380 00:38:51,740 --> 00:38:54,860 So, we have a, we have a domain here. 381 00:38:55,200 --> 00:38:57,060 All right, does it work? 382 00:38:57,180 --> 00:38:59,820 Uh, I mean, it's weird. 383 00:39:01,180 --> 00:39:03,400 All right, just a second. 384 00:39:05,640 --> 00:39:13,160 Okay, so we have our domain, we have the PKI service, our UNET, that contains a, um, computer that is called 8001 PKI. 385 00:39:14,020 --> 00:39:19,760 So we'll try to, so on this PKI service, our UNET, we have a user that we dubbed N. 386 00:39:19,760 --> 00:39:22,920 Augustine, that will have some limited rights. 387 00:39:22,920 --> 00:39:31,200 Uh, she will only have the rights that is called managed GP link, which, uh, allows her to, as you can see here, manage group policy links on this OU. 388 00:39:31,400 --> 00:39:35,200 And so, we'll assume that we compromise the N. 389 00:39:35,200 --> 00:39:42,940 Augustine user, and we'll try to abuse this privilege, uh, she have, she has, sorry, on the, on the OU of PKI service. 390 00:39:43,520 --> 00:39:44,120 All right. 391 00:39:44,120 --> 00:39:46,900 So, we'll try to exploit it, in order to add the N. 392 00:39:46,900 --> 00:39:53,380 Augustine user to the local admin group of, um, of, uh, PKI, of the PKI server, 8001 PKI. 393 00:39:53,620 --> 00:40:02,340 So you can see here first, uh, the, uh, the PKI service OU only have one, has one GP link, uh, legitimate GPO. 394 00:40:02,780 --> 00:40:03,620 All right. 395 00:40:03,900 --> 00:40:04,900 And the N. 396 00:40:04,900 --> 00:40:11,140 Augustine user is not, uh, local admin of, uh, the 8001 PKI, uh, computer. 397 00:40:11,140 --> 00:40:12,360 As you can see here, access denied. 398 00:40:12,360 --> 00:40:12,860 All right. 399 00:40:12,860 --> 00:40:16,420 So, let's exploit, uh, this privilege with UNET. 400 00:40:16,500 --> 00:40:21,880 UNET takes, uh, config.ini file, that specifies some, some configurations. 401 00:40:22,060 --> 00:40:27,900 Uh, there are a bunch of them, but, uh, most importantly, you specify the target Augustine units. 402 00:40:28,140 --> 00:40:36,160 You specify the user that has the right to modify the GP link attributes, and you specify the command you want to run on child objects. 403 00:40:36,480 --> 00:40:38,220 As you can see here, I'm adding the N. 404 00:40:38,220 --> 00:40:42,940 Augustine user to the, um, to the local admin group of, uh, my targets. 405 00:40:43,040 --> 00:40:46,300 There are a bunch of other configurations that doesn't matter. 406 00:40:46,380 --> 00:40:51,720 Uh, we are spinning off a fake DC in order to simulate a good PC container, uh, but I won't go into details here. 407 00:40:53,320 --> 00:40:54,300 All right. 408 00:40:54,900 --> 00:40:58,720 So, let's execute, uh, UNET with this configuration. 409 00:40:59,000 --> 00:41:02,520 And you can see that there are a bunch of things that UNET does. 410 00:41:02,700 --> 00:41:05,860 Uh, it sets up fast forwarding to, to simulate a GPC. 411 00:41:05,860 --> 00:41:06,780 It doesn't matter. 412 00:41:06,780 --> 00:41:11,820 The most important thing is that it adds a GP link attributes into the Augustine units. 413 00:41:11,820 --> 00:41:20,720 As you can see here, if I do some LDIP, I have another, um, GP link that was added here that points to UNET.com.com, right? 414 00:41:20,720 --> 00:41:23,480 And UNET.com.com points to my machine. 415 00:41:23,480 --> 00:41:26,740 And so, what happens is what I described earlier. 416 00:41:26,740 --> 00:41:34,440 The objects will try to fetch, to apply the GPO by thinking that I am the LDAP server and I will simulate a good PC container. 417 00:41:34,780 --> 00:41:39,660 So, on the right, on the ID01 PKI server, I will just execute the GP update commands. 418 00:41:39,660 --> 00:41:49,600 And as soon as I do that, you can see on the left, on the UNET side, that I will have a communication from the ID01 PKI server that tries to authenticate to me. 419 00:41:49,600 --> 00:41:54,540 First, to fetch the GPC, so the LDAP parts, and I will answer to, to the computer. 420 00:41:54,540 --> 00:42:02,580 And then for the GPT, the good PC templates, and I will again authenticate it and respond with the, the appropriate files. 421 00:42:02,800 --> 00:42:11,080 And finally, we can see that the attack works because the end-of-use end-user is now local admin of the ID01 PKI computer. 422 00:42:11,080 --> 00:42:15,580 As you can see, I'm connecting to the C-dollar share and I am local admin of this computer. 423 00:42:15,580 --> 00:42:19,240 So we have used this GP link write permission. 424 00:42:20,200 --> 00:42:21,080 Thanks. 425 00:42:24,730 --> 00:42:28,130 All right, just a few words to conclude. 426 00:42:28,130 --> 00:42:33,730 So, we are, we believe that risk associated with GPUs are pretty much underestimated today. 427 00:42:33,970 --> 00:42:39,610 GPUs are very powerful just for enumeration, as Wilfried showed you, but also for exploitation primitives. 428 00:42:39,610 --> 00:42:44,230 There are a lot of exploitation primitives on GPUs, but also on the organizational units. 429 00:42:44,330 --> 00:42:58,610 And of course, we aim to, to, to provide a better understanding of how GPUs work, how you can enumerate stuff from them, how you can exploit objects from them, and GPUs are just, just fun and don't, don't hesitate to, to research on it. 430 00:42:58,610 --> 00:42:59,170 Thank you.