1 00:00:00,080 --> 00:00:03,280 next up we've got Eric Woodruff a senior 2 00:00:03,280 --> 00:00:05,560 security researcher at s peris and today 3 00:00:05,560 --> 00:00:07,759 Eric's going to explore and speak about 4 00:00:07,759 --> 00:00:09,440 a novel discovery that resulted in 5 00:00:09,440 --> 00:00:12,799 pesque to Global admin in Azure ad um 6 00:00:12,799 --> 00:00:15,480 the title of his talk is unauthorized I 7 00:00:15,480 --> 00:00:17,439 see what you did there uh discovering 8 00:00:17,439 --> 00:00:19,199 the path to privilege elevation to 9 00:00:19,199 --> 00:00:23,720 Global administrator please welcome 10 00:00:23,800 --> 00:00:27,320 Eric all right uh you know thank you and 11 00:00:27,320 --> 00:00:29,800 you might say this is a foreshadowing 12 00:00:29,800 --> 00:00:33,079 and uh some parts of this so uh talk 13 00:00:33,079 --> 00:00:34,719 probably will run right up to the end so 14 00:00:34,719 --> 00:00:36,719 if there's any questions afterwards uh 15 00:00:36,719 --> 00:00:39,520 you can sort of find me out there we'll 16 00:00:39,520 --> 00:00:41,800 just jump right into it again that is me 17 00:00:41,800 --> 00:00:44,440 I a blue background so erican identity 18 00:00:44,440 --> 00:00:46,559 it's easy to remember it's boring from 19 00:00:46,559 --> 00:00:48,480 like a sort of hackery perspective but 20 00:00:48,480 --> 00:00:50,239 you know feel free to reach out if you 21 00:00:50,239 --> 00:00:53,039 have any questions and right as far as 22 00:00:53,039 --> 00:00:56,480 the name goes right so if we have 23 00:00:56,480 --> 00:00:59,600 unauthorized and O 2.0 right the sort of 24 00:00:59,600 --> 00:01:01,160 Moder standard out there for 25 00:01:01,160 --> 00:01:03,680 authorization and all sorts of cloud 26 00:01:03,680 --> 00:01:06,680 stuff right you end up with 27 00:01:06,680 --> 00:01:09,240 unauthorized and uh neither marketing 28 00:01:09,240 --> 00:01:12,960 nor AI uh help with the name right so as 29 00:01:12,960 --> 00:01:15,400 far as the background here there's been 30 00:01:15,400 --> 00:01:18,600 a lot of research on uh service 31 00:01:18,600 --> 00:01:20,479 principles registrations and 32 00:01:20,479 --> 00:01:22,479 applications and all their Integrations 33 00:01:22,479 --> 00:01:26,280 right in azer and tri uh so you know 34 00:01:26,280 --> 00:01:28,119 some aspects of this aren't really novel 35 00:01:28,119 --> 00:01:29,600 in the sense that I was following a lot 36 00:01:29,600 --> 00:01:33,040 of similar paths that others have um but 37 00:01:33,040 --> 00:01:35,200 there's a Twist on it here right and you 38 00:01:35,200 --> 00:01:38,000 know ultimately this this research uh 39 00:01:38,000 --> 00:01:39,680 area in general I would just say there's 40 00:01:39,680 --> 00:01:41,439 still probably a lot to be explored 41 00:01:41,439 --> 00:01:43,280 right after the whole midnight blizzard 42 00:01:43,280 --> 00:01:45,759 thing with Microsoft and uh in general a 43 00:01:45,759 --> 00:01:48,119 lot of Enterprises Defenders it Pros 44 00:01:48,119 --> 00:01:50,040 don't really understand all the sort of 45 00:01:50,040 --> 00:01:52,920 nuances around service principles um 46 00:01:52,920 --> 00:01:54,680 right so it's kind of a nice area for 47 00:01:54,680 --> 00:01:57,159 for exploration and finding interesting 48 00:01:57,159 --> 00:01:59,320 stuff right because ultimately if you 49 00:01:59,320 --> 00:02:01,759 want to sort to own right Cloud 50 00:02:01,759 --> 00:02:04,360 ecosystems as as we may or may not know 51 00:02:04,360 --> 00:02:06,039 right Global admin is is sort of the 52 00:02:06,039 --> 00:02:08,199 thing or Global admin equivalent is what 53 00:02:08,199 --> 00:02:10,440 we're looking to uh to sort of grab out 54 00:02:10,440 --> 00:02:14,680 there in uh Azure ad and and and ID so 55 00:02:14,680 --> 00:02:17,519 um we're going to just sort of level set 56 00:02:17,519 --> 00:02:19,000 some knowledge here because there's a 57 00:02:19,000 --> 00:02:21,760 lot of sort of moving parts and aspects 58 00:02:21,760 --> 00:02:23,720 to this especially if you're not super 59 00:02:23,720 --> 00:02:25,760 familiar with service principles and app 60 00:02:25,760 --> 00:02:28,879 registrations and and whatnot in uh in 61 00:02:28,879 --> 00:02:30,680 entra so first off just want to talk 62 00:02:30,680 --> 00:02:32,959 about the application administrator Ri 63 00:02:32,959 --> 00:02:35,560 so if we have entra ID right and we have 64 00:02:35,560 --> 00:02:37,640 this rooll app administrator or Cloud 65 00:02:37,640 --> 00:02:39,599 application administrator um they're 66 00:02:39,599 --> 00:02:41,480 both in scope for the finding but sort 67 00:02:41,480 --> 00:02:43,760 of to keep things short just going to 68 00:02:43,760 --> 00:02:45,400 refer to both AS application 69 00:02:45,400 --> 00:02:47,680 administrator in the the talk here right 70 00:02:47,680 --> 00:02:51,159 and so we assign that role to a user and 71 00:02:51,159 --> 00:02:52,959 the role generally is used for the life 72 00:02:52,959 --> 00:02:55,680 cycle of applications tied to entra 73 00:02:55,680 --> 00:02:57,120 right so that's going to be you know 74 00:02:57,120 --> 00:02:58,879 whether it's multicloud or your SE 75 00:02:58,879 --> 00:03:01,200 applications open ID connect Amo all 76 00:03:01,200 --> 00:03:02,800 that sort of stuff right your app and 77 00:03:02,800 --> 00:03:05,319 then manages but but if you think of 78 00:03:05,319 --> 00:03:07,120 rols as basically swim Lanes you're 79 00:03:07,120 --> 00:03:08,840 driving on the highway and you have a 80 00:03:08,840 --> 00:03:10,400 you know solid lines right you're 81 00:03:10,400 --> 00:03:11,840 basically supposed to stick within that 82 00:03:11,840 --> 00:03:14,400 swim Lane so if an app administrator was 83 00:03:14,400 --> 00:03:16,879 to say go manage roles right in like a 84 00:03:16,879 --> 00:03:18,840 green field enter tenant they're they're 85 00:03:18,840 --> 00:03:20,959 going to get blocked and again if you're 86 00:03:20,959 --> 00:03:22,239 familiar with this right you may know 87 00:03:22,239 --> 00:03:23,280 that there's lots of ways for 88 00:03:23,280 --> 00:03:25,200 organizations to shoot themselves in the 89 00:03:25,200 --> 00:03:27,280 foot essentially and set up pass for 90 00:03:27,280 --> 00:03:30,000 priv escalation but in a Greenfield 91 00:03:30,000 --> 00:03:32,000 write this this shouldn't be 92 00:03:32,000 --> 00:03:33,799 possible and also speaking of 93 00:03:33,799 --> 00:03:35,000 applications right if you've been around 94 00:03:35,000 --> 00:03:36,480 the block you're probably familiar with 95 00:03:36,480 --> 00:03:39,680 you know Services control panel and this 96 00:03:39,680 --> 00:03:41,120 is really like there's a lot of things 97 00:03:41,120 --> 00:03:43,280 within windows that keep it mostly 98 00:03:43,280 --> 00:03:45,000 running as long as these services are 99 00:03:45,000 --> 00:03:46,840 running and you know from a consumer 100 00:03:46,840 --> 00:03:48,400 perspective we don't really care about 101 00:03:48,400 --> 00:03:50,680 these things right and the cloud is very 102 00:03:50,680 --> 00:03:51,879 similar right there's there's going to 103 00:03:51,879 --> 00:03:53,760 be some services and service principles 104 00:03:53,760 --> 00:03:55,879 and applications that we may you know 105 00:03:55,879 --> 00:03:57,920 know like exchange online SharePoint 106 00:03:57,920 --> 00:04:00,640 online teams you know portal all that 107 00:04:00,640 --> 00:04:02,319 sort of stuff but there's actually 108 00:04:02,319 --> 00:04:04,519 hundreds and hundreds of others out 109 00:04:04,519 --> 00:04:07,200 there right and again uh you know blue 110 00:04:07,200 --> 00:04:09,680 folks it Pros whatnot don't really need 111 00:04:09,680 --> 00:04:11,480 to know or care about this stuff just 112 00:04:11,480 --> 00:04:13,480 it's it's stuff Microsoft provides right 113 00:04:13,480 --> 00:04:16,399 to kind of keep Cloud ecosystem and the 114 00:04:16,399 --> 00:04:19,040 the state for the Enterprise of 115 00:04:19,040 --> 00:04:21,839 flat so you know jumping into this a bit 116 00:04:21,839 --> 00:04:24,280 deeper and talking about applications in 117 00:04:24,280 --> 00:04:26,440 particular multi-tenant applications 118 00:04:26,440 --> 00:04:29,120 here right and just um going to look at 119 00:04:29,120 --> 00:04:31,039 how multi tendent applications work and 120 00:04:31,039 --> 00:04:32,440 again this is sort of critical to 121 00:04:32,440 --> 00:04:34,680 understand the discovery here right so 122 00:04:34,680 --> 00:04:36,360 pretend I'm a software developer right 123 00:04:36,360 --> 00:04:39,360 and I have my publisher tenant and then 124 00:04:39,360 --> 00:04:41,199 I also have an app registration that I 125 00:04:41,199 --> 00:04:43,000 create right and so an app registration 126 00:04:43,000 --> 00:04:44,800 as a developer is me essentially 127 00:04:44,800 --> 00:04:47,080 defining all the things I need for my 128 00:04:47,080 --> 00:04:49,360 application to function in my publisher 129 00:04:49,360 --> 00:04:51,000 tenant right so I'm going to give it 130 00:04:51,000 --> 00:04:52,759 some name and there's going to be some 131 00:04:52,759 --> 00:04:54,400 other characteristics I assigned or 132 00:04:54,400 --> 00:04:56,320 attributes I should say to it um I'm 133 00:04:56,320 --> 00:04:57,600 also going to give it permissions right 134 00:04:57,600 --> 00:04:59,160 so here I have user read WR all 135 00:04:59,160 --> 00:05:01,479 directory read WR all and group read all 136 00:05:01,479 --> 00:05:03,440 and effectively I'm saying as a Dev 137 00:05:03,440 --> 00:05:04,840 right this is a stuff for whatever my 138 00:05:04,840 --> 00:05:07,080 application is you know needs to 139 00:05:07,080 --> 00:05:08,680 function for whoever is going to consume 140 00:05:08,680 --> 00:05:10,440 it right so we we assign those 141 00:05:10,440 --> 00:05:12,320 permissions then we Grant credentials to 142 00:05:12,320 --> 00:05:14,600 it these can either be a secret which is 143 00:05:14,600 --> 00:05:17,600 effectively a password or a certificate 144 00:05:17,600 --> 00:05:19,960 right asymmetric key pair so I Define 145 00:05:19,960 --> 00:05:22,280 this in entra right and then effectively 146 00:05:22,280 --> 00:05:25,240 I go publish my app or I go build my 147 00:05:25,240 --> 00:05:26,639 application and it doesn't matter where 148 00:05:26,639 --> 00:05:28,080 it's running it's not really sort of 149 00:05:28,080 --> 00:05:30,759 relevant here but but I that application 150 00:05:30,759 --> 00:05:32,880 whether it's running azzure AWS 151 00:05:32,880 --> 00:05:34,880 kubernetes Pas right doesn't really 152 00:05:34,880 --> 00:05:36,400 matter um but there's going to be a 153 00:05:36,400 --> 00:05:38,520 relationship between the application and 154 00:05:38,520 --> 00:05:40,280 the app registration because effectively 155 00:05:40,280 --> 00:05:42,560 I give it the client ID and the Tenant 156 00:05:42,560 --> 00:05:44,919 ID and the credential right and now that 157 00:05:44,919 --> 00:05:48,840 application can authenticate to uh entro 158 00:05:48,840 --> 00:05:51,160 but I need customers right so customer 159 00:05:51,160 --> 00:05:53,520 comes along with the customer attendant 160 00:05:53,520 --> 00:05:55,039 and sort of high level here right a 161 00:05:55,039 --> 00:05:57,520 global admin generally comes in and they 162 00:05:57,520 --> 00:06:00,319 perform a uh flow called an admin 163 00:06:00,319 --> 00:06:02,479 consent or an admin consent Grant we 164 00:06:02,479 --> 00:06:04,240 effectively the the global admin is 165 00:06:04,240 --> 00:06:06,319 saying hey it's cool right we want and 166 00:06:06,319 --> 00:06:08,240 need to use this application so we're 167 00:06:08,240 --> 00:06:10,280 going to aboard it into our tenant and 168 00:06:10,280 --> 00:06:12,000 when this happens a service principle is 169 00:06:12,000 --> 00:06:13,919 created right and a service principle is 170 00:06:13,919 --> 00:06:16,840 a security principle uh within entra or 171 00:06:16,840 --> 00:06:19,039 Azure ad that you can assign permissions 172 00:06:19,039 --> 00:06:21,319 and roles to like users are also 173 00:06:21,319 --> 00:06:23,680 security principles right if uh you know 174 00:06:23,680 --> 00:06:25,280 you feel more familiar in that area 175 00:06:25,280 --> 00:06:26,960 right and so again this is going to have 176 00:06:26,960 --> 00:06:29,039 this this tie to the app registration 177 00:06:29,039 --> 00:06:30,520 where it's going to have the name and 178 00:06:30,520 --> 00:06:32,360 more importantly the permissions right 179 00:06:32,360 --> 00:06:33,919 that the developer sort of said are 180 00:06:33,919 --> 00:06:36,080 needed and so we ultimately end up with 181 00:06:36,080 --> 00:06:38,039 this relationship and again if I had 100 182 00:06:38,039 --> 00:06:40,160 customers they'd have a you know 100 183 00:06:40,160 --> 00:06:44,199 service principles um to that one app 184 00:06:44,199 --> 00:06:46,039 registration but I mean my application 185 00:06:46,039 --> 00:06:48,120 is still be able to do stuff right so 186 00:06:48,120 --> 00:06:50,520 then graph API again is generally the 187 00:06:50,520 --> 00:06:52,599 way that right Microsoft would recommend 188 00:06:52,599 --> 00:06:56,400 that you interact with ENT ID these days 189 00:06:56,400 --> 00:06:57,800 right so my application is actually 190 00:06:57,800 --> 00:06:59,960 going to use the credentials that assign 191 00:06:59,960 --> 00:07:01,599 to it authenticate to the customer's 192 00:07:01,599 --> 00:07:04,360 tenant it's going to get an access token 193 00:07:04,360 --> 00:07:06,440 back right and we pass that access token 194 00:07:06,440 --> 00:07:08,479 for authorization along to graph and as 195 00:07:08,479 --> 00:07:10,360 long as graph's cool with it right we're 196 00:07:10,360 --> 00:07:11,800 going to be able to do stuff and again 197 00:07:11,800 --> 00:07:13,599 the stuff is whatever the app developer 198 00:07:13,599 --> 00:07:16,960 has has defined here so Microsoft 199 00:07:16,960 --> 00:07:18,800 applications right they they function 200 00:07:18,800 --> 00:07:21,400 very similar um sometimes this you have 201 00:07:21,400 --> 00:07:23,639 to infer things right because we can't 202 00:07:23,639 --> 00:07:25,680 see sort of behind the the covers right 203 00:07:25,680 --> 00:07:27,479 or behind the the blinds and how 204 00:07:27,479 --> 00:07:30,080 Microsoft uh you know builds things but 205 00:07:30,080 --> 00:07:32,000 there is a Microsoft tenant right they 206 00:07:32,000 --> 00:07:33,720 have their own entro tenant they have 207 00:07:33,720 --> 00:07:36,080 app registrations for exchange online 208 00:07:36,080 --> 00:07:38,560 SharePoint online and all Microsoft 209 00:07:38,560 --> 00:07:40,759 customers have service principles for 210 00:07:40,759 --> 00:07:42,560 all these right and again so there's 211 00:07:42,560 --> 00:07:44,000 that relationship and here in the 212 00:07:44,000 --> 00:07:45,680 example we have device registration 213 00:07:45,680 --> 00:07:47,319 service right and again it has the 214 00:07:47,319 --> 00:07:49,879 client ID Microsoft tenant ID and some 215 00:07:49,879 --> 00:07:52,599 credentials here right and if in theory 216 00:07:52,599 --> 00:07:54,720 right graph or in theory if device 217 00:07:54,720 --> 00:07:56,080 registration 218 00:07:56,080 --> 00:07:59,639 services wanted to um 219 00:07:59,639 --> 00:08:02,240 do things against graph API right it can 220 00:08:02,240 --> 00:08:03,919 authenticate to the customer's tenant 221 00:08:03,919 --> 00:08:06,000 with those credentials right get an 222 00:08:06,000 --> 00:08:08,360 access token back and sort of the same 223 00:08:08,360 --> 00:08:10,199 flow right it's authorized to go do 224 00:08:10,199 --> 00:08:12,360 whatever graph stuff again that it is 225 00:08:12,360 --> 00:08:14,759 supposed to be allowed to do um but note 226 00:08:14,759 --> 00:08:16,919 that there are other uh apis out there 227 00:08:16,919 --> 00:08:19,440 as well that Microsoft um uses it's it's 228 00:08:19,440 --> 00:08:23,240 not just graph right so bringing this 229 00:08:23,240 --> 00:08:26,080 into the research um you know basically 230 00:08:26,080 --> 00:08:28,639 I was I was curious to impersonate 231 00:08:28,639 --> 00:08:30,960 Microsoft applic ations but really what 232 00:08:30,960 --> 00:08:33,440 I want to do is act as Microsoft service 233 00:08:33,440 --> 00:08:35,679 principles for multi-tenant applications 234 00:08:35,679 --> 00:08:37,958 right that that's like a mouthful um but 235 00:08:37,958 --> 00:08:39,559 essentially like right impersonate the 236 00:08:39,559 --> 00:08:41,159 applications you know borrow their 237 00:08:41,159 --> 00:08:43,679 identity right from a entra perspective 238 00:08:43,679 --> 00:08:46,399 I want entra to think I'm the Microsoft 239 00:08:46,399 --> 00:08:48,680 application that's doing whatever it is 240 00:08:48,680 --> 00:08:51,720 I'm hoping to do within graph right so 241 00:08:51,720 --> 00:08:53,519 if we want to impersonate a Microsoft 242 00:08:53,519 --> 00:08:54,760 application again right there's this 243 00:08:54,760 --> 00:08:57,800 relationship here um and and again this 244 00:08:57,800 --> 00:08:59,480 isn't like unique and that others have 245 00:08:59,480 --> 00:09:00,880 have have written about this stuff and 246 00:09:00,880 --> 00:09:02,600 researched this in the past this this 247 00:09:02,600 --> 00:09:05,160 piece of things but what I still think 248 00:09:05,160 --> 00:09:07,120 is interesting is that within service 249 00:09:07,120 --> 00:09:09,279 principles on the customer tenant we can 250 00:09:09,279 --> 00:09:12,040 assign a credential to this right so the 251 00:09:12,040 --> 00:09:14,760 app developer knows their credential we 252 00:09:14,760 --> 00:09:16,560 can also assign credentials onto the 253 00:09:16,560 --> 00:09:18,680 service principal right and once we have 254 00:09:18,680 --> 00:09:20,160 that credential assigned to the service 255 00:09:20,160 --> 00:09:22,320 principal because we know it right we 256 00:09:22,320 --> 00:09:24,440 can have some impersonating application 257 00:09:24,440 --> 00:09:26,079 and in this case as we'll see I was just 258 00:09:26,079 --> 00:09:28,399 using Powershell right where we can 259 00:09:28,399 --> 00:09:30,399 essentially give it that client ID our 260 00:09:30,399 --> 00:09:32,519 tenant ID and the credential right and 261 00:09:32,519 --> 00:09:34,480 now we have graph we authenticate with 262 00:09:34,480 --> 00:09:36,560 our service principal credentials get 263 00:09:36,560 --> 00:09:39,399 our access token back and we're off 264 00:09:39,399 --> 00:09:40,959 right in the graph doing whatever the 265 00:09:40,959 --> 00:09:43,959 stuff is that we're looking to do and in 266 00:09:43,959 --> 00:09:46,120 particular right this is using an O2 267 00:09:46,120 --> 00:09:48,480 client credential Grant flow uh which I 268 00:09:48,480 --> 00:09:50,640 sort of Shand a ccgf in a few of the 269 00:09:50,640 --> 00:09:52,519 slides just because like you know it 270 00:09:52,519 --> 00:09:55,160 it's a mouth wall here right um but 271 00:09:55,160 --> 00:09:56,560 effectively we're kind of almost like 272 00:09:56,560 --> 00:09:58,360 authenticating the same way a user would 273 00:09:58,360 --> 00:10:00,320 with like a username and password write 274 00:10:00,320 --> 00:10:02,760 to graph here and just you know walking 275 00:10:02,760 --> 00:10:04,839 through a few nuances with the flow here 276 00:10:04,839 --> 00:10:06,360 but sort of abstracting it away from 277 00:10:06,360 --> 00:10:08,279 enter again write that effectively if 278 00:10:08,279 --> 00:10:09,920 we're performing an OA to client 279 00:10:09,920 --> 00:10:12,079 credential Grand flow the application is 280 00:10:12,079 --> 00:10:13,519 going to request an access token from 281 00:10:13,519 --> 00:10:15,640 entro ID with the client ID and the 282 00:10:15,640 --> 00:10:17,880 secret or credential right entro returns 283 00:10:17,880 --> 00:10:20,519 that access token the application sends 284 00:10:20,519 --> 00:10:23,680 that access token off to gra um right 285 00:10:23,680 --> 00:10:26,200 and if the access token is is valid 286 00:10:26,200 --> 00:10:27,920 again we're going to get whatever data 287 00:10:27,920 --> 00:10:29,560 back that we requested from graph right 288 00:10:29,560 --> 00:10:31,440 and it's an API so if we're reading data 289 00:10:31,440 --> 00:10:33,440 to get right if we're trying to put data 290 00:10:33,440 --> 00:10:35,560 it's a post or update data it's usually 291 00:10:35,560 --> 00:10:39,160 a patch operation out there um and a few 292 00:10:39,160 --> 00:10:40,320 notes on this so right in a client 293 00:10:40,320 --> 00:10:42,440 credential Grant flow the default scope 294 00:10:42,440 --> 00:10:44,320 is the only scope permitted by Microsoft 295 00:10:44,320 --> 00:10:46,480 graph and you may I bring this up 296 00:10:46,480 --> 00:10:48,240 because you may see other research where 297 00:10:48,240 --> 00:10:50,600 right people try to influence uh the 298 00:10:50,600 --> 00:10:52,440 Scopes available but within a client 299 00:10:52,440 --> 00:10:54,240 credential Grant flow you have no way to 300 00:10:54,240 --> 00:10:56,440 sort of change the scope right and you 301 00:10:56,440 --> 00:10:58,240 may say well what the hell is a scope 302 00:10:58,240 --> 00:11:00,440 and the scope is the application 303 00:11:00,440 --> 00:11:03,200 permissions right so within oo Scopes 304 00:11:03,200 --> 00:11:05,200 are how they Define the the term for 305 00:11:05,200 --> 00:11:07,040 permissions right so if you see scope 306 00:11:07,040 --> 00:11:09,279 permission it's all sort of 307 00:11:09,279 --> 00:11:11,720 interchangeable um but and this is also 308 00:11:11,720 --> 00:11:13,920 foreshadowing the default scope does not 309 00:11:13,920 --> 00:11:16,680 indicate additional permissions uh 310 00:11:16,680 --> 00:11:19,880 provided by other authorization 311 00:11:19,880 --> 00:11:22,040 systems right so you know we kind of 312 00:11:22,040 --> 00:11:23,040 have our Theory here and then we're 313 00:11:23,040 --> 00:11:24,440 trying to find applications to 314 00:11:24,440 --> 00:11:26,360 impersonate and then you know some 315 00:11:26,360 --> 00:11:28,600 pretty uh I'd say crappy power Shell 316 00:11:28,600 --> 00:11:30,440 Code here where I'm just getting all the 317 00:11:30,440 --> 00:11:32,560 service principles in the tenant and 318 00:11:32,560 --> 00:11:33,959 then after I get all the service 319 00:11:33,959 --> 00:11:36,560 principles in my tenant and actually I I 320 00:11:36,560 --> 00:11:38,240 add a little box here to highlight this 321 00:11:38,240 --> 00:11:40,600 but apparently it's falling off my slide 322 00:11:40,600 --> 00:11:42,120 um we're actually searching by the 323 00:11:42,120 --> 00:11:44,240 Microsoft tenant ID right so this is an 324 00:11:44,240 --> 00:11:45,600 attribute that's stamped on every 325 00:11:45,600 --> 00:11:47,440 service principal so it's relatively 326 00:11:47,440 --> 00:11:49,600 easy for any organization to go see all 327 00:11:49,600 --> 00:11:52,120 the applications in their tenant or the 328 00:11:52,120 --> 00:11:53,639 service principles I should say that are 329 00:11:53,639 --> 00:11:55,920 from Microsoft um so then we just take 330 00:11:55,920 --> 00:11:58,240 them dump them into a 4 each uh right 331 00:11:58,240 --> 00:12:00,600 create a a cred object here where we're 332 00:12:00,600 --> 00:12:03,440 just um adding a password credential to 333 00:12:03,440 --> 00:12:05,959 a service principle and then very poorly 334 00:12:05,959 --> 00:12:08,399 just outputting it into a CSV um we 335 00:12:08,399 --> 00:12:10,160 don't have a way of setting what we want 336 00:12:10,160 --> 00:12:12,320 the password or secret here so you know 337 00:12:12,320 --> 00:12:14,720 just capturing it to to reuse this stuff 338 00:12:14,720 --> 00:12:17,839 and then just kind of uh moving on here 339 00:12:17,839 --> 00:12:19,519 oh there it is it's a little little late 340 00:12:19,519 --> 00:12:21,839 to the show 341 00:12:21,839 --> 00:12:24,279 but right now as I mentioned earlier so 342 00:12:24,279 --> 00:12:26,040 it may be hard to see here but in this 343 00:12:26,040 --> 00:12:29,519 one tenant I was using I have 573 344 00:12:29,519 --> 00:12:31,839 service principles from Microsoft uh in 345 00:12:31,839 --> 00:12:33,199 a tenant that's a couple years old that 346 00:12:33,199 --> 00:12:35,680 has Azure and Microsoft 365 and all this 347 00:12:35,680 --> 00:12:37,279 sort of stuff right I've seen tenants 348 00:12:37,279 --> 00:12:39,040 with more I've seen tenants with less 349 00:12:39,040 --> 00:12:40,639 but right back to the point that there's 350 00:12:40,639 --> 00:12:42,760 a lot of service principles and things 351 00:12:42,760 --> 00:12:44,240 sort of running out there doing all 352 00:12:44,240 --> 00:12:46,199 sorts of stuff right to keep that 353 00:12:46,199 --> 00:12:47,880 Microsoft ecosystem 354 00:12:47,880 --> 00:12:50,240 afloat but so again back to some poor 355 00:12:50,240 --> 00:12:51,680 code here where I'm just taking all the 356 00:12:51,680 --> 00:12:54,040 service principles another for each and 357 00:12:54,040 --> 00:12:55,560 essentially just stuffing it into a 358 00:12:55,560 --> 00:12:57,839 Powershell cred object here and just 359 00:12:57,839 --> 00:12:59,800 connect to Microsoft grab 360 00:12:59,800 --> 00:13:02,279 and then running this command get mg 361 00:13:02,279 --> 00:13:05,040 context which effectively will show you 362 00:13:05,040 --> 00:13:06,440 what permissions you're supposed to have 363 00:13:06,440 --> 00:13:07,880 and some other details and again we'll 364 00:13:07,880 --> 00:13:09,720 we'll take a look at that at the second 365 00:13:09,720 --> 00:13:11,360 um and again I was just piping it out to 366 00:13:11,360 --> 00:13:13,480 a text file just so I could sort of 367 00:13:13,480 --> 00:13:16,480 further look at the the output of this 368 00:13:16,480 --> 00:13:18,279 wow my animations are are really messed 369 00:13:18,279 --> 00:13:20,519 up there today so um because that tenant 370 00:13:20,519 --> 00:13:22,440 ID that we're using is is the customer 371 00:13:22,440 --> 00:13:25,320 tenant or my tenant it is not um the 372 00:13:25,320 --> 00:13:29,320 Microsoft tenant in this case 373 00:13:29,320 --> 00:13:30,279 that all 374 00:13:30,279 --> 00:13:32,600 right so as far as the applications 375 00:13:32,600 --> 00:13:35,160 right there was 573 out there but 376 00:13:35,160 --> 00:13:37,880 actually only found um nine applications 377 00:13:37,880 --> 00:13:39,760 that actually support the O2 client 378 00:13:39,760 --> 00:13:41,519 credential Grant flow and again if if 379 00:13:41,519 --> 00:13:42,680 you're familiar with some of this 380 00:13:42,680 --> 00:13:45,680 research if you go back 3 four years 381 00:13:45,680 --> 00:13:47,480 this list was like hundreds longer and 382 00:13:47,480 --> 00:13:50,440 Microsoft sort of uh whittel it down and 383 00:13:50,440 --> 00:13:52,360 um right when I reported the case to 384 00:13:52,360 --> 00:13:54,600 them uh initially uh there were still 385 00:13:54,600 --> 00:13:56,959 these nine that supported the o to 386 00:13:56,959 --> 00:13:59,320 client credential Grant flow um but 387 00:13:59,320 --> 00:14:00,920 still you know this in itself it's like 388 00:14:00,920 --> 00:14:03,800 well who cares right you can connect um 389 00:14:03,800 --> 00:14:05,759 right and I in particular was interested 390 00:14:05,759 --> 00:14:08,440 in right Scopes right being able to have 391 00:14:08,440 --> 00:14:10,600 permissions to do things uh within the 392 00:14:10,600 --> 00:14:12,560 Tenon try to move laterally priv 393 00:14:12,560 --> 00:14:14,839 escalation uh gain persistence things 394 00:14:14,839 --> 00:14:16,720 like that and so amongst these right I 395 00:14:16,720 --> 00:14:18,519 found some did have some right Scopes 396 00:14:18,519 --> 00:14:20,480 available but uh if you really look at 397 00:14:20,480 --> 00:14:22,680 the details um that are documented 398 00:14:22,680 --> 00:14:24,680 anyways about these uh permissions or 399 00:14:24,680 --> 00:14:26,399 Scopes there's nothing actually too 400 00:14:26,399 --> 00:14:27,720 interesting even if some of the names 401 00:14:27,720 --> 00:14:29,600 look juicy if you actually look at what 402 00:14:29,600 --> 00:14:31,120 you know is documented and what they're 403 00:14:31,120 --> 00:14:32,959 supposed to be able to provide uh it's 404 00:14:32,959 --> 00:14:35,279 not a whole lot um Rights Management 405 00:14:35,279 --> 00:14:38,720 Services had uh a read scope available 406 00:14:38,720 --> 00:14:40,519 but no write Scopes right and then there 407 00:14:40,519 --> 00:14:42,279 were four applications or service 408 00:14:42,279 --> 00:14:44,680 principles that had no scopes uh 409 00:14:44,680 --> 00:14:46,839 whatsoever right so effectively these 410 00:14:46,839 --> 00:14:48,839 bottom four if I try to do anything I 411 00:14:48,839 --> 00:14:51,240 expected to get a 403 unauthorized 412 00:14:51,240 --> 00:14:53,600 effectively return back from graph and 413 00:14:53,600 --> 00:14:56,120 this is again like this list um in you 414 00:14:56,120 --> 00:14:57,839 know looking at other research and 415 00:14:57,839 --> 00:14:59,720 talking with other researchers is like 416 00:14:59,720 --> 00:15:01,519 this list is kind of not unique and that 417 00:15:01,519 --> 00:15:04,199 a lot of people had it um but they all 418 00:15:04,199 --> 00:15:05,120 kind of were like oh well there's 419 00:15:05,120 --> 00:15:07,480 nothing really good here but it's where 420 00:15:07,480 --> 00:15:09,759 you know I decided to basically try 421 00:15:09,759 --> 00:15:13,759 privilege things anyways so right uh as 422 00:15:13,759 --> 00:15:15,880 far as a Tesco we basically have I I was 423 00:15:15,880 --> 00:15:17,720 looking to disable regular privilege 424 00:15:17,720 --> 00:15:20,120 user change a user privilege user's 425 00:15:20,120 --> 00:15:22,600 password manage rooll assignments create 426 00:15:22,600 --> 00:15:24,800 a user delete a user delete a privileged 427 00:15:24,800 --> 00:15:26,920 user permanently delete a privileged 428 00:15:26,920 --> 00:15:29,560 user um you know group eligible Ro 429 00:15:29,560 --> 00:15:31,440 assignments managing those creating an 430 00:15:31,440 --> 00:15:34,160 administrative unit and managing Ro 431 00:15:34,160 --> 00:15:35,639 assigned group membership right and 432 00:15:35,639 --> 00:15:37,759 again I have mostly blue sort of 433 00:15:37,759 --> 00:15:39,880 background uh so trying to think of all 434 00:15:39,880 --> 00:15:42,519 the ways right that organizations manage 435 00:15:42,519 --> 00:15:44,440 privilege or that you can gain privilege 436 00:15:44,440 --> 00:15:47,079 within entra um right basically sort of 437 00:15:47,079 --> 00:15:49,360 thre this mattering at all these uh nine 438 00:15:49,360 --> 00:15:50,920 service 439 00:15:50,920 --> 00:15:53,040 principles right and so the results so 440 00:15:53,040 --> 00:15:54,639 obviously this probably wouldn't have 441 00:15:54,639 --> 00:15:56,880 been accepted as a talk if like I was 442 00:15:56,880 --> 00:15:59,199 like nothing was found right and again 443 00:15:59,199 --> 00:16:00,360 you could probably sort of guess from 444 00:16:00,360 --> 00:16:03,079 the name that um found a few things 445 00:16:03,079 --> 00:16:05,079 including if we go back to this sort of 446 00:16:05,079 --> 00:16:06,800 diagram here for the application 447 00:16:06,800 --> 00:16:09,319 administrator role right where we don't 448 00:16:09,319 --> 00:16:10,759 have the ability to manage Ro 449 00:16:10,759 --> 00:16:13,040 assignments well if we actually take 450 00:16:13,040 --> 00:16:15,079 device registration service again which 451 00:16:15,079 --> 00:16:16,639 you know had no scope so it should have 452 00:16:16,639 --> 00:16:18,519 no permission to do anything right we 453 00:16:18,519 --> 00:16:21,000 sort of go out and we add a credential 454 00:16:21,000 --> 00:16:23,720 right a secret password whatnot to it 455 00:16:23,720 --> 00:16:25,319 again just hop out to Powershell with 456 00:16:25,319 --> 00:16:27,759 that client ID the credential our tenant 457 00:16:27,759 --> 00:16:29,440 ID right and found that we could 458 00:16:29,440 --> 00:16:31,800 actually manage roles uh in entra 459 00:16:31,800 --> 00:16:34,160 including any any role out there uh but 460 00:16:34,160 --> 00:16:36,240 the focus was primarily on on global 461 00:16:36,240 --> 00:16:38,720 admin so you know just walking through 462 00:16:38,720 --> 00:16:42,199 so unfortunately um uh this is kind of 463 00:16:42,199 --> 00:16:43,560 another walkthrough of the research but 464 00:16:43,560 --> 00:16:45,519 like Microsoft I was hoping to record a 465 00:16:45,519 --> 00:16:47,240 nice like pretty video of it but they 466 00:16:47,240 --> 00:16:48,680 fixed it before I could actually get 467 00:16:48,680 --> 00:16:50,759 that so all I'm left with are some some 468 00:16:50,759 --> 00:16:52,680 crappy screenshots here 469 00:16:52,680 --> 00:16:55,000 but um 470 00:16:55,000 --> 00:16:57,360 effectively here we go so we're again 471 00:16:57,360 --> 00:16:58,600 just going to walk through things here 472 00:16:58,600 --> 00:17:00,079 so we're assigning right those 473 00:17:00,079 --> 00:17:01,880 credentials to our service principle 474 00:17:01,880 --> 00:17:04,160 here right we're stuffing them into a 475 00:17:04,160 --> 00:17:07,400 Powershell credential object and after 476 00:17:07,400 --> 00:17:09,640 this we're connecting to graph right and 477 00:17:09,640 --> 00:17:11,839 this is where we run that g mg 478 00:17:11,839 --> 00:17:14,280 context and we can see connected as 479 00:17:14,280 --> 00:17:15,959 device registration service so if we 480 00:17:15,959 --> 00:17:17,959 went and looked at you know audit logs 481 00:17:17,959 --> 00:17:20,000 signin logs stuff like that in entra 482 00:17:20,000 --> 00:17:21,160 right it would think we're device 483 00:17:21,160 --> 00:17:23,359 registration service and then particular 484 00:17:23,359 --> 00:17:24,599 this is where we see that we have no 485 00:17:24,599 --> 00:17:26,000 scopes right so we shouldn't be able to 486 00:17:26,000 --> 00:17:28,520 do anything but I did find we have some 487 00:17:28,520 --> 00:17:30,400 read ACC here so you know I was running 488 00:17:30,400 --> 00:17:32,320 get mg directory role right to just get 489 00:17:32,320 --> 00:17:34,360 all the the directory roles available to 490 00:17:34,360 --> 00:17:36,520 me um and again with the focus on global 491 00:17:36,520 --> 00:17:38,840 admin and also able to look up the 492 00:17:38,840 --> 00:17:41,120 directory role members here right so we 493 00:17:41,120 --> 00:17:42,760 can see right now that there's basically 494 00:17:42,760 --> 00:17:44,880 two of me as as the two Global admins 495 00:17:44,880 --> 00:17:47,679 and this this sort of test tenant 496 00:17:47,679 --> 00:17:50,360 here so kind of moving on um you know 497 00:17:50,360 --> 00:17:51,559 then I was like well let me find a 498 00:17:51,559 --> 00:17:53,480 Target user right because I I have some 499 00:17:53,480 --> 00:17:55,360 read access let's see what else we have 500 00:17:55,360 --> 00:17:58,039 so you know Megan Bowen here uh again is 501 00:17:58,039 --> 00:18:00,039 sort of the the target Target user so 502 00:18:00,039 --> 00:18:02,200 run get mg user right basically to just 503 00:18:02,200 --> 00:18:04,919 get her object ID and then we're just 504 00:18:04,919 --> 00:18:07,120 splatting it into an array here where 505 00:18:07,120 --> 00:18:09,120 we're effectively taking the global 506 00:18:09,120 --> 00:18:12,039 admin Ro definition ID um taking her 507 00:18:12,039 --> 00:18:15,600 object ID and um the directory scope ID 508 00:18:15,600 --> 00:18:16,880 which has to be the root because you 509 00:18:16,880 --> 00:18:18,400 can't assign Global admin to an 510 00:18:18,400 --> 00:18:19,960 administrative 511 00:18:19,960 --> 00:18:22,919 unit and then we run another mouthful 512 00:18:22,919 --> 00:18:25,120 new mg Ro management directory Ro 513 00:18:25,120 --> 00:18:27,640 assignment with that array as the 514 00:18:27,640 --> 00:18:30,400 parameters right and and surprisingly we 515 00:18:30,400 --> 00:18:32,919 don't get a 403 response we actually get 516 00:18:32,919 --> 00:18:35,640 a real result back um you know at first 517 00:18:35,640 --> 00:18:37,039 I thought well maybe like this test 518 00:18:37,039 --> 00:18:39,520 tenant I have is like a dumpster fire um 519 00:18:39,520 --> 00:18:41,520 so ran through this in like four or five 520 00:18:41,520 --> 00:18:43,480 other tenants just to sort of you know 521 00:18:43,480 --> 00:18:45,240 reproduce this work and was finding each 522 00:18:45,240 --> 00:18:47,320 time that that this worked right and 523 00:18:47,320 --> 00:18:49,280 again I'd run get mg context and still 524 00:18:49,280 --> 00:18:50,880 see that I'm operating as device 525 00:18:50,880 --> 00:18:52,960 registration service and still had no 526 00:18:52,960 --> 00:18:54,760 scopes 527 00:18:54,760 --> 00:18:56,880 available and also found that you could 528 00:18:56,880 --> 00:18:59,159 actually um well actually here we're 529 00:18:59,159 --> 00:19:01,880 showing right that now Megan is uh also 530 00:19:01,880 --> 00:19:04,840 a global admin right and similarly could 531 00:19:04,840 --> 00:19:08,360 also remove role assignments um right so 532 00:19:08,360 --> 00:19:10,919 now I I remove one of my other uh you 533 00:19:10,919 --> 00:19:13,360 know Eric Woodruff Global admins here 534 00:19:13,360 --> 00:19:14,840 right and I get directory role members 535 00:19:14,840 --> 00:19:17,640 and again it it's just down to uh one of 536 00:19:17,640 --> 00:19:20,240 me and and Megan now and um 537 00:19:20,240 --> 00:19:21,480 interestingly found that you can 538 00:19:21,480 --> 00:19:23,280 actually you know get rid of all the 539 00:19:23,280 --> 00:19:25,880 global admins at ATT tenant if you have 540 00:19:25,880 --> 00:19:27,520 uh role management permissions assigned 541 00:19:27,520 --> 00:19:29,280 to an application it is not not specific 542 00:19:29,280 --> 00:19:31,559 to this finding but uh was also kind of 543 00:19:31,559 --> 00:19:32,679 interesting in the way that you could 544 00:19:32,679 --> 00:19:34,880 have used this to evict all all G and 545 00:19:34,880 --> 00:19:36,880 the Tenant right and then again we go 546 00:19:36,880 --> 00:19:38,440 look at our ENT logs and just another 547 00:19:38,440 --> 00:19:40,120 way to sort of verify things right 548 00:19:40,120 --> 00:19:42,880 finding that a had member to role right 549 00:19:42,880 --> 00:19:45,840 um was successful for Global admin uh 550 00:19:45,840 --> 00:19:48,120 coming from device registration 551 00:19:48,120 --> 00:19:50,400 service so as far as the findings go 552 00:19:50,400 --> 00:19:52,159 right this was really the the juiciest 553 00:19:52,159 --> 00:19:54,799 thing um but also found that vet engage 554 00:19:54,799 --> 00:19:57,280 or formerly known as Yammer for the two 555 00:19:57,280 --> 00:19:59,600 people that used it write that uh it's 556 00:19:59,600 --> 00:20:01,559 delete and permanently delete privileged 557 00:20:01,559 --> 00:20:05,559 users uh were available to uh Yammer and 558 00:20:05,559 --> 00:20:07,240 Rights Management Services had the 559 00:20:07,240 --> 00:20:10,280 ability to create users in the 560 00:20:10,280 --> 00:20:13,159 tenant so right the this was all 561 00:20:13,159 --> 00:20:15,240 reported to Microsoft back uh the 562 00:20:15,240 --> 00:20:18,159 beginning of uh 2024 and their response 563 00:20:18,159 --> 00:20:20,000 around this was basically right so 564 00:20:20,000 --> 00:20:21,440 device registration service they 565 00:20:21,440 --> 00:20:23,400 classified as an important severity for 566 00:20:23,400 --> 00:20:25,360 privilege elevation uh and this was 567 00:20:25,360 --> 00:20:27,679 resolved back in around the March time 568 00:20:27,679 --> 00:20:30,480 frame of things uh Viva engage uh Yammer 569 00:20:30,480 --> 00:20:32,360 they marked as medium severity and again 570 00:20:32,360 --> 00:20:34,559 this is resolved and Rights Management 571 00:20:34,559 --> 00:20:36,880 Services flaged as low severity I mean 572 00:20:36,880 --> 00:20:38,960 with these I did argue to them that 573 00:20:38,960 --> 00:20:40,039 right if you were to look at the 574 00:20:40,039 --> 00:20:42,440 principles of authorization having the 575 00:20:42,440 --> 00:20:44,039 ability to do anything that is not 576 00:20:44,039 --> 00:20:46,120 defined right within your permissions or 577 00:20:46,120 --> 00:20:48,720 roles to me is still privilege elevation 578 00:20:48,720 --> 00:20:51,240 or some sort of bypass um right the most 579 00:20:51,240 --> 00:20:52,480 important thing here is that these 580 00:20:52,480 --> 00:20:54,600 things were resolved but of course I 581 00:20:54,600 --> 00:20:56,679 asked right well like why did this work 582 00:20:56,679 --> 00:20:59,600 right like I had no scope so sort of 583 00:20:59,600 --> 00:21:02,799 what was going on um but there's some 584 00:21:02,799 --> 00:21:04,200 stuff that they wouldn't really reveal 585 00:21:04,200 --> 00:21:05,440 and you know they're keeping close to 586 00:21:05,440 --> 00:21:06,919 their chest about it but effectively 587 00:21:06,919 --> 00:21:08,360 what they ended up telling me right is 588 00:21:08,360 --> 00:21:10,240 that you have you know your Microsoft 589 00:21:10,240 --> 00:21:12,159 applications you have graph that's 590 00:21:12,159 --> 00:21:14,640 accessing you know these applications uh 591 00:21:14,640 --> 00:21:16,400 sort of from the the front end right you 592 00:21:16,400 --> 00:21:18,559 have ENT ID on the back and there's 593 00:21:18,559 --> 00:21:20,400 effectively multiple authorization 594 00:21:20,400 --> 00:21:22,360 systems and right as an external 595 00:21:22,360 --> 00:21:25,960 application developer oos Scopes putting 596 00:21:25,960 --> 00:21:27,960 aside roles and entra are sort of 597 00:21:27,960 --> 00:21:29,480 absolute they're like the thing you have 598 00:21:29,480 --> 00:21:32,120 to believe um they're like yes or no 599 00:21:32,120 --> 00:21:33,760 sort of scenario right where whatever 600 00:21:33,760 --> 00:21:35,960 those Scopes are are what you believe 601 00:21:35,960 --> 00:21:38,679 but Microsoft has other authorization 602 00:21:38,679 --> 00:21:40,799 systems um in play they wouldn't really 603 00:21:40,799 --> 00:21:43,400 talk too much about what those things 604 00:21:43,400 --> 00:21:45,720 were um but effectively they're saying 605 00:21:45,720 --> 00:21:47,039 right so even though I didn't have a 606 00:21:47,039 --> 00:21:49,480 scope to allow these things like role 607 00:21:49,480 --> 00:21:51,360 management that there's some other 608 00:21:51,360 --> 00:21:53,120 authorization system in there that 609 00:21:53,120 --> 00:21:54,960 basically permitted these 610 00:21:54,960 --> 00:21:56,919 things and right so if we go back to 611 00:21:56,919 --> 00:21:58,960 this app that supported the o to client 612 00:21:58,960 --> 00:22:00,440 credential ramp flow if you were to go 613 00:22:00,440 --> 00:22:01,760 sort of take this work and try to 614 00:22:01,760 --> 00:22:03,279 reproduce it you're actually going to 615 00:22:03,279 --> 00:22:05,760 find that this list is sort of no longer 616 00:22:05,760 --> 00:22:07,760 valid on they've continued to whittle 617 00:22:07,760 --> 00:22:09,880 this stuff down further right so 618 00:22:09,880 --> 00:22:12,400 actually now if you try to go connect to 619 00:22:12,400 --> 00:22:14,679 um you know graph as device registration 620 00:22:14,679 --> 00:22:16,120 service you get this sort of cryptic 621 00:22:16,120 --> 00:22:19,279 error message uh about um the secret 622 00:22:19,279 --> 00:22:21,080 being incorrect or like in the wrong 623 00:22:21,080 --> 00:22:23,200 field but effectively this is their way 624 00:22:23,200 --> 00:22:25,400 of using something that is similar to a 625 00:22:25,400 --> 00:22:27,039 function called app instance property 626 00:22:27,039 --> 00:22:28,919 lock where they're blocking your ability 627 00:22:28,919 --> 00:22:31,360 to get an access token again I sort of 628 00:22:31,360 --> 00:22:33,080 tried to press them to like find out 629 00:22:33,080 --> 00:22:35,159 like well does device registration 630 00:22:35,159 --> 00:22:37,600 service have some like need to manage 631 00:22:37,600 --> 00:22:39,960 roles uh but so far haven't really been 632 00:22:39,960 --> 00:22:42,640 able to get a an answer from them so 633 00:22:42,640 --> 00:22:45,320 right it's kind of like to to me the the 634 00:22:45,320 --> 00:22:47,320 lock on you know the uh safe in the 635 00:22:47,320 --> 00:22:48,799 house is broken and instead they went 636 00:22:48,799 --> 00:22:50,760 and changed lock on the front door and 637 00:22:50,760 --> 00:22:52,120 they told you it's all fixed right you 638 00:22:52,120 --> 00:22:53,960 don't really know what's going on under 639 00:22:53,960 --> 00:22:57,240 the covers so from a defense perspective 640 00:22:57,240 --> 00:22:59,640 though I I found this concern in um you 641 00:22:59,640 --> 00:23:01,000 know primarily because things like 642 00:23:01,000 --> 00:23:02,600 device registration service has been 643 00:23:02,600 --> 00:23:04,320 around for you know it's got to be going 644 00:23:04,320 --> 00:23:07,240 on a decade plus right um it's a thing 645 00:23:07,240 --> 00:23:10,520 that bootstraps devices into Azure ad 646 00:23:10,520 --> 00:23:13,720 entra ID um and and when I was con uh 647 00:23:13,720 --> 00:23:16,240 having conversation with Microsoft um 648 00:23:16,240 --> 00:23:19,039 they didn't really refute me sort of 649 00:23:19,039 --> 00:23:21,039 putting out there the thought that this 650 00:23:21,039 --> 00:23:23,240 sort of finding existed for as long as 651 00:23:23,240 --> 00:23:25,960 device registration service has right 652 00:23:25,960 --> 00:23:28,039 and so again the other sort of thing 653 00:23:28,039 --> 00:23:29,600 that I found troubling is coming from 654 00:23:29,600 --> 00:23:31,799 that sort of Enterprise side blue team 655 00:23:31,799 --> 00:23:33,400 sort of thing is that for a lot of 656 00:23:33,400 --> 00:23:35,200 organizations They Don't Really treat 657 00:23:35,200 --> 00:23:37,480 the app administrator or Cloud app 658 00:23:37,480 --> 00:23:40,240 administrators as tier zero right 659 00:23:40,240 --> 00:23:42,080 despite telling organizations they treat 660 00:23:42,080 --> 00:23:44,880 it as like tier 0.5 or tier one or 661 00:23:44,880 --> 00:23:47,080 whatnot so you know in my mind you have 662 00:23:47,080 --> 00:23:48,919 thread actor come along right it's much 663 00:23:48,919 --> 00:23:51,520 easier to breach right that app edmin 664 00:23:51,520 --> 00:23:53,360 sort of run through this whole scenario 665 00:23:53,360 --> 00:23:56,480 with that user and and move on right and 666 00:23:56,480 --> 00:23:57,880 you'll have probably guess right once 667 00:23:57,880 --> 00:23:59,960 you have something like Global admin 668 00:23:59,960 --> 00:24:01,080 there's like a million different things 669 00:24:01,080 --> 00:24:02,559 you can do out there to install 670 00:24:02,559 --> 00:24:05,080 persistence and just working with a lot 671 00:24:05,080 --> 00:24:06,880 of Enterprises I would suspect that if 672 00:24:06,880 --> 00:24:08,760 someone elevated privilege even to just 673 00:24:08,760 --> 00:24:10,880 temporarily install persistence and go 674 00:24:10,880 --> 00:24:12,159 remove themselves right because you 675 00:24:12,159 --> 00:24:14,360 might argue will be pretty obvious to 676 00:24:14,360 --> 00:24:15,760 just leave yourself in there as a global 677 00:24:15,760 --> 00:24:17,679 admin I still think most Enterprises 678 00:24:17,679 --> 00:24:19,600 would not really be able to easily 679 00:24:19,600 --> 00:24:21,279 detect this just because their their 680 00:24:21,279 --> 00:24:23,919 security is not mature enough right so 681 00:24:23,919 --> 00:24:25,480 there are a few things we can do from a 682 00:24:25,480 --> 00:24:27,200 defense perspective though right so we 683 00:24:27,200 --> 00:24:29,720 can look for suspicious now again these 684 00:24:29,720 --> 00:24:31,480 aren't absolutes because we don't know 685 00:24:31,480 --> 00:24:33,919 right if someone ever used this thing um 686 00:24:33,919 --> 00:24:36,279 if they also cleaned up after themselves 687 00:24:36,279 --> 00:24:38,360 right but we can get the uh service 688 00:24:38,360 --> 00:24:39,880 principle for device registration 689 00:24:39,880 --> 00:24:42,240 service and the client ID is globally 690 00:24:42,240 --> 00:24:44,760 unique right so anyone in any tenant can 691 00:24:44,760 --> 00:24:47,080 go look for this maybe not like gov 692 00:24:47,080 --> 00:24:48,520 tenants there's probably a different 693 00:24:48,520 --> 00:24:50,760 client ID there right but we can look 694 00:24:50,760 --> 00:24:54,039 for this and look for any certificates 695 00:24:54,039 --> 00:24:55,720 and again run the same command 696 00:24:55,720 --> 00:24:57,279 essentially looking for any password 697 00:24:57,279 --> 00:24:58,960 credentials right aside 698 00:24:58,960 --> 00:25:01,960 to device registration service um 699 00:25:01,960 --> 00:25:04,399 similar right with kql or whatever your 700 00:25:04,399 --> 00:25:06,600 you know favorite flavor of SE is seam 701 00:25:06,600 --> 00:25:09,159 or or Sim um you can go do similar where 702 00:25:09,159 --> 00:25:10,760 we can both look for credentials 703 00:25:10,760 --> 00:25:14,080 assigned to device registration service 704 00:25:14,080 --> 00:25:16,240 um and also if we have logs right we can 705 00:25:16,240 --> 00:25:19,480 go and look for suspicious actions like 706 00:25:19,480 --> 00:25:21,440 role management by device registration 707 00:25:21,440 --> 00:25:23,320 service cuz there would be no valid 708 00:25:23,320 --> 00:25:25,159 reason for device registration service 709 00:25:25,159 --> 00:25:27,480 to you know ever manage roles out there 710 00:25:27,480 --> 00:25:30,159 in in entra and you know this part is a 711 00:25:30,159 --> 00:25:33,240 lot and is kind of cruising through this 712 00:25:33,240 --> 00:25:35,480 just because um there's a lot of content 713 00:25:35,480 --> 00:25:38,080 and short B time here so there is a Blog 714 00:25:38,080 --> 00:25:42,039 available and I I do own ent. Ms uh and 715 00:25:42,039 --> 00:25:43,919 it's for sale to Microsoft if they've 716 00:25:43,919 --> 00:25:47,919 they've got enough money um but yeah 717 00:25:47,919 --> 00:25:50,960 that is uh that is it I I guess actually 718 00:25:50,960 --> 00:25:55,559 um well I if there are any questions I I 719 00:25:55,559 --> 00:25:57,080 suppose we got a few minutes to take 720 00:25:57,080 --> 00:26:02,080 with you but otherwise uh thank you 721 00:26:02,080 --> 00:26:04,589 [Applause]