Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Entra.Chat

Entra.Chat artwork

I found a bug that could hack ANY Microsoft 365 tenant - Here's what happened

Oct 24, 20251 hr 1 minAudioEpisode 33
ShareXLinkedInFacebookWhatsAppEmail

In this episode, I chat with Dirk-jan Mollema, the legendary researcher behind some of the most important discoveries in Microsoft identity security. We go deep into how curiosity led him from tinkering with web tools to uncovering one of the biggest Entra ID vulnerabilities ever found. He shares the story behind the CVE that rocked the cloud world, the stress of realizing what he’d uncovered, and the mindset that drives his relentless research. If you’ve ever wondered what it feels like to find a bug that could break the internet - this one’s for you. PS: If you like this episode please leave a review on Apple Podcast or Spotify πŸ™ Subscribe with your favorite podcast player or watch on YouTube πŸ‘‡ About Dirk-jan Mollema Dirk-Jan Mollema is a security researcher and consultant specializing in Microsoft Entra ID (Azure AD) and Active Directory security. He is the creator of popular offensive security tools including ROADtools and ROADrecon. With seven years of Entra research and nearly a decade in AD security, Dirk-Jan has discovered numerous critical vulnerabilities and has played an important role in helping improve Microsoft’s cloud security posture. He provides training and consulting services through his company Outsider Security. Twitter β†’ https://twitter.com/_dirkjan LinkedIn β†’ https://www.linkedin.com/in/dirkjanm Contact β†’ https://outsidersecurity.nl πŸ”— Related Links * One Token to rule them all - obtaining Global Admin in every Entra ID tenant via Actor tokens - https://dirkjanm.io/obtaining-global-admin-in-every-entra-id-tenant-with-actor-tokens * Dirk-Jan’s Blog - https://dirkjanm.io * ROADtools - https://github.com/dirkjanm/ROADtools πŸ“— Chapters 00:00 Intro 02:11 Guest Journey into Security 07:13 Building ROADtools and ROADrecon 09:53 Research Tools & Methods 14:05 Top Discoveries Ranked 17:01 Windows Hello & PRT Deep Dive 26:07 The Cross-Tenant Actor Token Bug 35:34 Ethical Dilemmas of Big Finds 38:24 Disclosure, Impact & Community 45:59 Future Research & Intune Tips 53:58 Training, Consulting & Closing Podcast Apps πŸŽ™οΈ Entra. Chat - https://entra.chat 🎧 Apple Podcast β†’ https://entra.chat/apple πŸ“Ί YouTube β†’ https://entra.chat/youtube πŸ“Ί Spotify β†’ https://entra.chat/spotify 🎧 Overcast β†’ https://entra.chat/overcast 🎧 Pocketcast β†’ https://entra.chat/pocketcast 🎧 Others β†’ https://entra.chat/rss Merill’s socials πŸ“Ί YouTube β†’ youtube.com/@merillx πŸ‘” LinkedIn β†’ linkedin.com/in/merill 🐀 Twitter β†’ twitter.com/merill πŸ•Ί TikTok β†’ tiktok.com/@merillf πŸ¦‹ Bluesky β†’ bsky.app/profile/merill.net 🐘 Mastodon β†’ infosec.exchange/@merill 🧡 Threads β†’ threads.net/@merillf πŸ€– GitHub β†’ github.com/merill Get full access to Entra. News - Your weekly dose of Microsoft Entra at entra.news/subscribe

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_01Intro chat with Merrill's life. Dig in deep where techs thrive. From the latest hacks to cool updates. Join the ride, don't be. Hey, folks, welcome to another episode of EntraChat. And today we have a very, very, very special guest. It's none other than Dirkian Mollema. He's an absolute fantastic person in the Microsoft community,

SPEAKER_01in the cybersecurity space as well. He's made some amazing tools for, you know, all of the community and he's found so many things and helped secure Microsoft and, you know, even other services. So, Dirk Jan, welcome to InterChat. Yeah, thank you so much for the invite and thanks for the nice intro. I've been wanting to have you on for a long time, but then we had some recent news and then I was like,

SPEAKER_01now I have to get you on. I listened to a few episodes and I heard my name drop a few times and I was like,

SPEAKER_00well, sure, we can do it.

SPEAKER_01Absolutely. So this is one episode where I want to just have a disclaimer. So I am a Microsoft employee, but this chat and, you know, my community stuff that I do is all my personal opinion. It's not Microsoft's opinion. So just wanted to clear that up. This is just a community thing that I do. do during my free time. And none of what we discussed today, etc. is anything official from Microsoft.

SPEAKER_01We don't want people misquoting us.

SPEAKER_00Yeah, I get it. I hope the disclaimer is not needed.

SPEAKER_01No, I mean, one of the Microsoft policies is you're free to, you know, post on social media and things like that, as long as we have that disclaimer saying that it's not an official Microsoft response on various topics. Cool. Awesome. So tell us about, you know, how you got into this whole industry and, you know, your journey to some of the, like the big tools you've made, like Rotary Con and so on, which are extremely popular and We want to know who's Dirk Jan and your story.

SPEAKER_00I've always had a bit of a development background, I suppose. I mean, I didn't study anything IT related, but I was doing like freelance web development on the site. And I guess that's kind of how I rolled into security, like making web apps, looking into web security and slowly going into network security, like enterprise security and red teaming. And I've always made it my approach to understand how things work and to make my own tools for that and to basically interpret the protocols.

SPEAKER_00Because every time I find myself using someone else's tools, I'm like, okay, I know how to run this tool, but what does the tool do, right? What is the protocol about? How do I even implement it? I'm not going to implement everything from scratch. I'm not going to make... everything from hand. But a lot of things that I wanted to analyze, I just need to get a feeling around how it works.

SPEAKER_01Right, it's that curiosity, right? Like just being curious, pulling on a thread and then digging into that.

SPEAKER_00So I was doing this in the Active Directory space already for a while. And at some point, I guess it was at my previous employer, we had a network assessment. And they were like, okay, there's this one flag we want you to achieve. So there's this one goal to prove company impact. And like, okay, can you hack the CEO inbox just to prove that you have all kinds of access in the company? And I was like, sure, then we can do that. And they were like, yeah, but the mailbox is in Microsoft 365 or Office 365,

SPEAKER_00I guess it was called back in the day. And I was like, okay, I have no clue how any of that worked. Like I was kind of avoiding the whole cloud thing, like all the other Pentester researchers at the time. I figured it out, okay, there's this identity provider called Azure AD. Apparently it syncs from on-prem AD. And then there's this mailbox. And I started making a lab with that, mining setup, looking at all the synchronization and things.

SPEAKER_00And actually it was my first bit of research in that area. And I figured out that there was this thing called soft matching. It's meant that if you created a user on-prem with the same like mailbox name back in the day, then it would match that to like a cloud user. So I did some recon of the cloud. And back in the day, it was still like the recommendation to have like no multi-factor for your break class account. So they had the break glass account without MFA. And I found out that you could just create like a user with the

same mailbox on-prem and it would match that to the cloud user and it would automatically

SPEAKER_00override its password. So then I had their break glass account, which was global admin and I got access to the mailbox. So that was kind of the flag achieved. You make it sound so easy. I mean, if you put enough effort into it, then everything sounds easy once you explain it. But it made me kind of realize like, okay, there's this whole other product with a lot of attack surface. That's just in generally quite unexplored.

SPEAKER_00And in the first few years when I was looking at Entra, it really felt like nobody really cared about it. Like all the pen testers and security research, they were really focusing on on-prem Active Directory. because that's what they understood that's what they kind of like that was a lot of information about that topic and everyone tried to avoid the cloud a little bit but I was like okay well there's this niche that's like completely unexplored with a lot of research opportunities and I could just go into that and

well that's what I did and I'm happy that these days there's more people actually researching the cloud because it sometimes felt kind of lonely and if you found something nice and

SPEAKER_00you talked about it or wrote a blog about it like everyone was like oh yeah it's cloud and they didn't really care that much like you could see the difference in if i wrote a blog about active directory versus about entra like the views would be way lower for the entra blog than about active directory thing so i think now it's people are starting to catch up but especially back in the day there was a huge discrepancy between how many people were actually using the product and how many security research was done into that and i think it was quite lacking so

I tried to change that a little bit, write my own tools and figure out how the product works.

SPEAKER_00And it kind of escalated from there, I suppose.

SPEAKER_01Nice, nice. So how did you get started with like Roadcon, Roadrecon? That's like one of your biggest tools, right? What are the other sort of tools that you made today? Yeah, so I started with Rode Recon, which is kind of like a reconnaissance tool. And the reason for that is that I wanted to understand a bit better how the whole

SPEAKER_00Azure AD slash Entra ID works. And at some point I found this like undocumented API that I was using, the legacy version of the, or like internal version of the graph.windows.net, which nowadays we consider legacy API, but back then was the API for interacting with Entra. And I figured out that there was like a lot more information in that internal version of the API. And even though it was called internal, like the Azure portal was using it. So it was not that internal since people could also use it.

But of course, the problem with such an API is that you don't know how it works. Like there was a little bit that we could infer from it because based on the OData

SPEAKER_00specification, it tells you what kind of objects there are, what kind of properties there are. I still love the behavior that you kind of have to sort of reverse engineer. And because it's a cloud, you cannot just download like a local copy and see how the binary works because there is no binary that you can access. So I had to kind of automate that. And I was like, I'm not going to do all of these API requests by hand because it's a lot of effort. And I just like wrote a kind of a framework or a tool around it that would like read this API specification and then translate that to a

to a database model with like a very simple UI so I could just click through

SPEAKER_00things, make my own research easier. From there, it kind of went on that I started to adding more tools to the framework. Like I tried to find all the authentication protocols, like the unofficial ones, like sort of the legacy ones, figure out how these work. I slowly added all of these to the toolkit. And at the start, I still relied on the Active Directory authentication library or the ADAL library to do all of the auth.

SPEAKER_00But at some point, I figured out if I want to do this from a research point of view, I need to change some of the values. And the library is just not going to cut it. So in the end, I... I think I implemented almost all the flows by myself in Python just to be able to change them, to mess with them, to add undocumented fields that I found to the authentication flow and just to change things up a little bit. That's where the whole road tools framework started from. Nice, nice.

SPEAKER_01So when one of the questions that Erica asked is, what sort of tools do you use when you go around, you know, trying these out? Like, do you use a lot of the standard tools available? I'm sure you have other things that you built, you've not yet shared, like, you know, handy scripts and things that you made.

SPEAKER_00Yeah, so usually to analyze like what goes on, I use like an intercepting proxy, like just Burp Suite, which is like a standard web app testing tool. But it really helps with like analyzing what goes on. So for a lot of my like Windows research, like how Entra device join works or device registration works, I just set up a virtual machine. I configure it as a proxy and then I look at like what goes on, like what request does it make? How does it talk to things like Intune?

SPEAKER_00How does it talk to Entra? How will all these protocols work? And then I try to analyze that. And from there on, I usually write like a Python proof of concepts, but just like a minimalistic reproduction of the protocol. And then eventually I'll polish it up and add it to a a more user-friendly way, which is usually adding it to the ROTX tool, which is the tool that I use for all the token manipulation, all the token operations, basically. So most of it is just like looking at web traffic because

everything is an API.

SPEAKER_00So everything is web-based usually. If it's endpoint research, sometimes you have to reverse engineer a little bit. I'm kind of bad at that. So I try to avoid it as much as possible. I rather just implement the protocol. And I also did that for like... sporadically for some mobile things. So that's a bit harder to do because then you have to set up the whole emulator and proxy that through and make sure it still works with the certificate pinning and all of that. So I prefer to stick to Windows, which is very easily proxyable. So then it's easier to see like what goes on under the hood and

just try to

SPEAKER_00understand all the API calls, all the protocols. So there's no like super special tools. I just proxy things through something where I can see what actually happens.

SPEAKER_01Yeah, because Entra, the surface you have is the web, right? It's HTTP. So everything that goes back and forth from the client or the browser to... to entra and you know the id pieces all through the browser so i guess it just makes it a lot more easier to see what's happening uh yeah exactly and then you can also search like what kind of requests are going on like what's the portal doing um where does it get its tokens from and sometimes i just look at

like the developer tools in the in the in azure portal in the entra portal for example to see

SPEAKER_00Like, okay, how does it get these tokens? How does it store them? Things like that. Just like figuring out what goes on, whether that's in a browser or in the operating system. Approach is kind of the same. Looking at the protocols, trying to understand the protocols, trying to implement the protocols. And then usually after that, you start messing with the protocols. Like you run things in different order. You change a field here and there. You see how it behaves. You see if you can fit it in with some other protocols you've analyzed before and all kind of that. And that's kind of where the research part comes in.

SPEAKER_00Nice, nice.

SPEAKER_01All right. So you've been doing this research for a while. How many years has it been?

SPEAKER_00I think on the Antra side, it's been seven years. And on the AD side, it's almost 10, I guess. So I've been doing it for a while now. And just, yeah, it's always the same concept, basically. Just try to figure out how things work that I see during like a assessment or a review. And then you meet like some new products or some new feature that people are using. And they're like, well, I don't know how this works, but it sounds interesting. And this company is obviously relying on this for their

security purposes.

SPEAKER_00So then you need to figure out, okay, how does it work and what could possibly go wrong if you either use it wrong or if it's something implemented was wrong.

SPEAKER_01Cool, cool. Awesome. So if I were to ask you, what were like the top three, you know, the discoveries of interesting, you know, on a scale of... whether it was really hard, how much time you spent on it, and so on. So if you were to pick your top, you know, the favorite three things you want people to know about, let's start from the bottom, right? The third, second, and then the first one. I think we all know what the first one will be, but let's start from the bottom up.

SPEAKER_00Oh, this is a hard question. Yeah, so I think some of the Windows Hello research was definitely in my favorites. So I think that's going to make the top two. Maybe the number three is actually not an Entra bug, but an Active Directory bug, which was like Kerberos related. So there was like... longer ago where i basically found a way to to hop between between trusts using some like some kerberos shenanigans and it's like you would

fake like an entire domain being added to a forest and then you could like impersonate other users in the other forest and that was kind of like the favorite vulnerability from a from a

SPEAKER_00technical side i think there's not an not an entra one On the Antra side, I think it's going to be more about the Windows Hello and primary first token things. It's mostly endpoint related, so it's very interesting to see how all these things behave, especially on Windows. How all the single sign-on works, figuring out what primary first tokens do. And at the start, especially with primary first tokens,

we're kind of like...

SPEAKER_00little hacks going on, I would like to say. So there was this setting, if I remember correctly, that it would do some magic with the multi-factor authentication. So if you would register the device and you would do that with multi-factor, then after, I think the MFA claim would automatically get added to your single sign-on token. Just because, like I said, okay, this person registered the device and then we're going to add the MFA claim to the primary first token. And I figured out like if you gained like the device owner,

SPEAKER_00like in between, like you could transfer that MFA link to someone else's token instead, because it was kind of the assumption that this was the same user, but it wasn't actually verified. It was kind of like a shortcut. where it was kind of possible to manipulate that and then suddenly get the MFA claim for somebody else. That was a lot of fun. Back in the day, you could also register devices with single sign-on. So if you landed on someone's endpoint, you could borrow their session temporarily, register a new device,

SPEAKER_00and then get a PRT with single sign-on on their new device. So that was a very nice way of persistence. Nice.

SPEAKER_01Yeah. So like, so how do you go about those? Is it again just with the browser tools and, you know, like what's that what you use? I mean, for the protocol analysis, yes, but I'm really into like logic flaws.

SPEAKER_00So I really like thinking about, okay, I have this protocol. What can it do? Where does it fit in with the other protocols? How can I kind of merge these things together and do something that's like unexpected? um so it's not like just like manipulating the protocol by itself it's more like figuring out okay what if i use this protocol in a slightly unintended way or if i combine this with something else um like does it work like the normal flow to get like a primary first token issue authenticate um and then you

get the token i'm like well what if i authenticate with single sign on can i then still get a token

SPEAKER_00and does that um like defeat some of the security expectations that people have around this. That is like tied to a specific device, but what if you can link it to like a new device that you just created as the attacker? So that's kind of my focus point, I would say, just thinking about these logic issues that may exist, like combining things in different order, combining different protocols together. Like a while ago, I did research also on like how primary first tokens behave on macOS.

SPEAKER_00And it turned out to be a completely different protocol. And they could kind of combine that with the Windows protocol to, again, bypass some of the security assumptions. So it's just like you find one thing and then you're like, well, I know a little bit about that related topic from like a different attack avenue. combined it and suddenly things behave in an expected way that wasn't quite intended but still works so that's it's kind of like the thinking about it combining things and just being well I've looked at this at some point that's how I

mostly do with my research which is not a very reproducible way I would say but that's just how my brain works I mean that's how you connect the dots that's an

SPEAKER_01interesting thing I want to ask you right so how do you keep track of it. Like what are the tools you use to like, do you write down your notes or use paper and pen or electronic or is it all in your head?

SPEAKER_00I wish I would be better at note keeping. If I'm lucky, I make screenshots somewhere or I still have like a P of the virtual machine. But usually sometimes I put, if it's really hard to remember things, I'll put it like in OneNote or something, but it's just going to be like a few lines of code. Oh yeah, I did this, this and this. But like most of my documentation is writing the tools. Like I write the tool, then I know how the protocol works, then I have it implemented and I can come back to it.

um but quite often like i might look at something and then i'm like okay i don't really find anything here and then maybe a year or so later i come back to like

SPEAKER_00I come back to that topic via like a different route. And I'm like, well, I've done this before. Maybe I can do something with it now. And then I sometimes have to start again a little bit from scratch because I forgot all the things. Or if I'm lucky, I still have the traffic saved because like if you proxy everything through a tool and you save all these requests locally, Now you still have the original traffic, so you can go back to that. But yeah, I'm not a very structured person. So usually I remember like some bits of it and then I have to go back and like, okay, how was it actually again?

SPEAKER_00And secretly, I also like read my own blogs quite often. So sometimes I have somebody asking me like, oh yeah, how does this Kerberos thing work? And I'm like, I don't know, it's been years since I looked at it. Let me look at my own blog and then I probably figure out again like what I was thinking at the time and why I did things in a certain way. And it usually comes back to me. So like writing a blog is also like a way to kind of push yourself to document things and to share it with your future self as well.

SPEAKER_01Yeah, I mean, that's how it's how your mind works. Right. And you you sometimes able to connect those dots. And yeah, you can't really express to people how you end up doing it. But yeah, I do get it. But I like the idea of the, you know, the tip about tooling. Right. So you you write the scripts and like that's basically a sort of things to repro and the comments you write in that. will help you go back and refer to things. And then, you know, when some things changed as well, right? Because, you know, you have the script, it worked at some point.

SPEAKER_01And then, you know, the APIs and things change. Yeah, they have to ruin the script again and then it doesn't work.

SPEAKER_00They have to figure out why. Yeah. Yeah, that's one of the problems with the cloud. Like you can never go back to the old vulnerable state, right? Like I can tell you about the vulnerability, but I cannot reproduce it again to make sure that I got everything 100% correct. So then I have to kind of trust my screenshots and whatever that the vulnerability was actually there because you cannot go back to an old vulnerable version to like try it out or try some variants anymore. As long as it's fixed, it's just fixed for everybody. Yeah, exactly.

SPEAKER_00And the new features come around. Yeah. And it's great to like kind of keep pushing each other. It's better that like researchers keep pushing the products than that attackers keep doing it. Exactly. Like real world attackers, they also keep pushing it. Sometimes it's just hard to respond like attacks like attacker in the middle because there's like there's no easy out of the box solution to block all that kind of stuff. But with all the new features, especially that mitigate some of the research that's been done

over the years with

SPEAKER_00like endpoint attacks, token stealing attacks, it's always great to like push these boundaries. And of course, like pushing the boundaries, like if Microsoft adds a new security feature and like, oh, okay, I wonder how it works. I wonder how that operates, what I can do with that. And I wonder how that changes like the attack surface, for example. That's also like a good way to, the pushing basically is usually mutual.

SPEAKER_01Yes. Yeah. And I remember when the intra-external auth method feature was released. Like it was a feature that I worked with one of the PMs on, you know, delivering that feature. But I knew you would have a fun time with it because it's a way to do another auth. And I think you built a proof of concept, right, where you run your own IDP, you start it off in the console, and you can then see how all of those flows work.

SPEAKER_00Yeah, that was also an interesting one to implement. And I actually use that because when I run a training class, like I often have people share accounts, but I don't want to bother with everybody setting up their own like multi-factor authentication because if I have to get 20 people in the class with the same account and all have to configure MFA, that's kind of annoying. So I just add like an external authentication method and I put the lab account in scope and I can just hit next and then they automatically like do the MFA method. So I really like that there's this kind of flexibility in the

platform and that you

SPEAKER_00have support for external providers. But of course, it also provides an opportunity for people like me to kind of play around with it, mess with it and use it in non-intended ways that weren't actually... that weren't actually, of course, intended in the design of that feature. Actually, the external auth method is a really good one because I had this possibility a couple of years ago where I had the ability from the Antra Connect Sync,

I could use to have the rights to modify all kinds of policies in the tenant. I was never really able to figure out like a good way to kind of abuse that.

SPEAKER_00But when the external auth methods came out, that was also added into the authentication method policy. So then suddenly there was this path that you could compromise entra connect and then you could modify the external auth methods and then you could like completely bypass MFA that way. So that was a nice extra basically opportunity where there's like at the point where I researched this was not really a way to abuse it. Then there's new features that kind of play into the whole scheme and that's only new opportunities. So usually I keep like some things on the shelf if I cannot

find the immediate abuse perspective for it and then sort of go back to it later if there's some new

SPEAKER_00possibilities or you think about, oh, I can actually do this in a certain way.

SPEAKER_01Yeah, exactly. Any sort of extension where you can extend and try and with hooks into doing things is good from, you know, the platform perspective for people to build and, you know, add custom stuff into it. And there's also this guy from the Netherlands who is doing like some completely non-internet functionalities and just like making fun of the whole feature. Cool. Awesome. So we spoke about the first two and let's come to,

SPEAKER_01you know, the big one, the big kahuna that you discovered. So tell us about, you know, what the vulnerabilities, you even have a CVE assigned for that one, right? Yeah.

SPEAKER_00Yeah, and that's pretty rare to get a CVE for a cloud vulnerability. That's only been there for like a year or so that MSRC even assigns CVEs for critical cloud vulnerabilities. Yeah, so this one is also, I guess that's kind of a backstory, I suppose. Yeah. because I actually think I started looking into alternative ways to go from on-prem to the cloud last year in the summer because there was some hardening around the

SPEAKER_00Entra Connect permissions, like the attack that I talked about previously with the external auth method that you could provision from on-prem that was fixed because all the permissions were just removed. And I was like, okay... There was this other thing that I looked at way back in the day, which was Exchange Hybrids. And it also, I think it was actually one of the first times where I looked at an Entra tenant and they were using Exchange Hybrids. And it kind of seemed odd to me that the on-prem authentication

was happening to

SPEAKER_00the same service principle. So they were doing like OAuth to their Exchange on-prem, but it was the same service principles for Exchange Online. And at the time, I never really had the time to dive into that because I was on the schedule, the assessment, and I couldn't set up like a whole Exchange hybrid lab, which is a lot of work, I can tell you, to get it working. Yeah. Then I came back to it and I'm like, okay, well, apparently there's this exchange hybrid that shares this service principle because otherwise you cannot do OAuth to the same service principle on-prem.

And it also means that they have to share some authentication material because if

SPEAKER_00you want to do OAuth to a web app, normally the web app has to prove that they're that app via a certificate secret or a client secret. So I'm like, okay, there's this on-prem secret apparently, so it could be possible to abuse if you have access to the on-prem environment. So then I actually did take the effort to install Exchange hybrids. I'm not sure if I ever completely got it to work, to be honest. Like the install wizard was giving me all kinds of errors. And I'm like, yeah, sending up all this DNS externally.

SPEAKER_00I don't want to do that. So I sort of a very hacky version of Exchange hybrids working in my lab. Yeah. And I started to look at some of these protocols. And at that point, I was just staring at my screen because it was doing all kinds of protocols that I had never seen, that I wasn't even aware of existed. And then there's kind of like, like sort of a, I don't know, if you want to call it like a spider sense or something like that. But if you've been doing research for a very long time,

SPEAKER_00then you kind of know, like if you're looking at something that has a lot of potential to like be broken. like this this looks kind of weird like this is not this doesn't look like it was supposed to be there or that i'm supposed to look at this or that this was designed with all of the security properties in mind and that's kind of how i went through the whole like actor token thing um so for those who read the the whole research like exchange if it wants to talk exchange on-prem if it wants to talk to exchange online it's such a hybrid setup

It kind of has a way of impersonating users using what I call actor tokens.

SPEAKER_00I don't know if there's an official Microsoft name for it. I like to call them actor tokens. And basically, it authenticates as itself, as Exchange. And that's that, like, enter an issue token. It embeds that in unsigned token. And in unsigned token, it just says, I'm Exchange, and I want to impersonate, like, this specific user when talking to Exchange Online. Okay. And you could change that to any user in the tenant. And basically, I talk to the Exchange online service as anybody, which makes sense, right?

SPEAKER_00Because it's Exchange hybrid. There has to be a way to impersonate these users. So I was looking at it last year and then I was kind of probing at it and I couldn't really find like a way other than accessing exchange online to really abuse that. And SharePoint for some reason, because it also worked for SharePoint. So I was like, okay, I can exchange in SharePoint, which is nice, but it wasn't exactly the attack factor that I was looking for. And then I was like preparing the talk about this.

SPEAKER_00So I had a few like things in my backlog and I was like, okay, let's just make a talk about like hybrid lateral movement. And a couple of weeks before the presentation, then I usually like, make all the tools a bit nicer. I mean, all these, like these hacky proof of concept that I have, I port them to my normal tools. And that was a few alternatives. And one of the alternatives was like asking for a graph token or Azure AD graph token. And that actually worked. I was surprised when I was looking at that because...

Okay, Exchange can talk to Exchange, Exchange can talk to SharePoint, that makes sense.

SPEAKER_00But does Exchange really need to impersonate anybody like in Entra? Probably not, but maybe Exchange online site, but definitely not the on-prem site. And that's kind of raised the whole severity. So like, okay, now if I compromise Exchange on-prem, I can actually compromise the entire tenant because you can talk to the graph Windows.net and impersonate the global admin. And yeah, you can just modify whatever. You can add new global admins with credentials that you control. Then you can even log in like interactively into all of these portals.

SPEAKER_00So that was kind of bad. And then I decided, okay, well, like the hybrid part, I didn't find it that interesting.

SPEAKER_01And at this point, you still had to compromise a hybrid exchange. Yeah.

SPEAKER_00Like both exploitation lateral movements. So you compromise on-prem and then you can move to like the cloud part if they had exchange hybrids, which not a lot of companies have these days, but it's still out there. And at the time, it was only to exchange online and SharePoint online. So I was like, okay, that's not super interesting, especially since not everybody has this. But then I found out this was actually for the graph. And then I was like, okay, this makes it quite a bit more severe. So maybe I should send in a report to MSRC before I talk about this,

SPEAKER_00rather than them finding out at Black Hat. So I was writing this report and then making a night walkthrough so that they can reproduce it. And then I decided to mess around a bit more with the tokens. And I already tried this for Exchange and for SharePoint where I changed the tenant ID because there are these different tokens, like the actor token was obviously issued for my tenant. But it was also a tenant field in the impersonation token that I created around that.

And then I changed that for the graph and I changed it actually to my real tenant

SPEAKER_00where I have my email. And then it gave me a very weird error message. It said like, hey, this user doesn't exist. I'm like, well, I know that my lab user doesn't exist in my prop tenant, but it's not the error message I'm looking for. I'm looking for like access is denied because this token is like from a completely different tenant. But that's not what it said. So at that point I was like, oh, okay. Now I need to figure out how to find the right user. And I played around a bit with the fields and I put in the correct ID of a user

SPEAKER_00that actually did exist. And then I was seeing data like from my real tenant rather than from my lab tenant. And at that point, I was like, oh, OK, this has really worked. So I tried it with a few more of my test tenants just to be sure it actually worked. And it did work. So then I figured out, OK, well, I can do this cross-tenant. So I no longer need access to anybody's Exchange hybrids. I can just do it from my own Exchange hybrids. And basically found out you could do it with any tenant as long as you knew this unique ID. The net ID of a user, which is like,

SPEAKER_00I think, internal attributes going back to the Microsoft account days, sort of. So that was kind of bad.

SPEAKER_01So you started calling some graph APIs and it just works. When you come across something like that, like how do you feel at that moment?

SPEAKER_00I was mostly just really stressed out because I was like, this is big. And I was also like, I'm not sure I want this responsibility. So I still have like a screenshot. Because I have a smartwatch and it tracks like my stress levels. And you can identify like the exact time where I found the vulnerability because after my stress levels for the whole day were like up enormously. Yeah. So I'm like, okay, well, this is really exciting. So I messaged like a few people like, oh my God, I have this really bad bug. I think I actually tried to message Nestory,

Dr. Azure AD, but he was on holidays that week.

SPEAKER_00So I wasn't able to tell him about it. And at that point I decided, okay, I need to get this report out as fast as possible so that people can fix it. And then it's not my responsibility anymore because I don't want to have the ability to just compromise anybody's tenant. I just want this to get fixed as soon as possible so that I can relax again.

SPEAKER_01Right. So I do have a question at this point, right? Like a really sort of an ethical one. It's something you found, it's huge, right? And a bad person can do a lot with it, right? And they stand to gain so much as well, right? From something like that. How did you... Did the thought even cross your mind?

SPEAKER_00I think the thought only crossed my mind, like, after I sent the report. And then when I was called down a little bit, I was like, oh, hmm, this could have been interesting to see the right person. But, like... In the theoretical case that you would sell such a thing, which I don't think I would ever do, you know it's not going to be abused by the good guys, right? Because anybody putting down serious money for this kind of thing, you know it's going to be used in a way that's not exactly what I would like for it

SPEAKER_00to be used. And it's not something like you can use in a very like targeted way because it's everybody's affected. So once the knowledge is out there, it can be used against you as well. So it's not, I mean, the only way to actually deal with this was to get it fixed as soon as possible. And like hopefully no one else would have had access to it before. That was more my concern. Like, did other people find this out? Did other people have the ability to do this?

SPEAKER_01Would you do anything different the next time you come across, like, based on the experience you went through now, are there things you would do differently the next time? Yeah. So maybe I would take a little bit more time to analyze the full impact because

SPEAKER_00like I first sent the report to MSRC. And at that point I mentioned like, yeah, I don't know exactly how I can get these net IDs, right? Because that was the only requirement that you know, like this net ID attributes. I know probably you can get it somehow, but I think you should already fix it like this without knowing it. And then after I only started thinking, okay, how can I get these? And I came up with several strategies actually to get them. So that's like the only barrier at the point where I submitted the report was that you needed to know this piece of information,

SPEAKER_00which was a bit of a mitigating factor. But after I found out there's like several quite easy ways to obtain that piece of information. So it kind of increased the whole scope. I don't think they treated it any less severe because of that. So it doesn't really make a difference in the end. But next time... Just for my own piece of mind, just make sure you have the full flow figured out so that you can give the full story directly. But other than that, I think it was handled quite well. It was fixed very fast.

So I don't think there was anything that we should have done differently in that sense.

SPEAKER_00Nice. Okay. So tell us about the experience of you sharing that until it got fixed and so on.

SPEAKER_01How did it go?

SPEAKER_00So after I posted about it, I mean, my phone was just like ringing nonstop with all the notifications the days after. So that was kind of wild. I think the wildest thing was that somebody on LinkedIn suggested I should get a Nobel Prize for it, which I think was a little bit over the top, pretty much over the top. Yeah. And people were starting to make like reaction videos with all the weird poses for YouTube and all of that. How did I end up in this place?

SPEAKER_00I'm just doing like some research here. So it kind of blew up. And it even made like, in the Netherlands, it even made what I would say like the normal people news. So like the non-tech news would actually, a journalist from like a national news network came and wrote a story about it. And they were like, well, do you want to do an interview for TV? And we want to send like a camera crew over. I was like, well, I'm in Rome at the moment. So I'm not sure that you want to come all the way over here. Yeah. so then we did it over over teams and they aired like five

seconds of the whole of the whole interview but that was uh that was definitely i didn't expect it to to blow up as uh as much as it did even though it of course it was quite uh um yeah quite a quite a finding and i don't think i'll ever ever top it again but that's

SPEAKER_00okay that's fine i don't need to ever find it again but

SPEAKER_01On Twitter, it's Flangwick. He asked, what color of Lamborghini are you going to buy after getting the bug bounty? Yes.

SPEAKER_00Yeah, I knew that question would be coming. There's been a lot of discussion about bounty amounts. On purpose, I didn't mention any bounty amount because even without mentioning, all the discussion is already about how much did you get paid? How much should Microsoft pay you for it? I don't really want that whole discussion. So that's kind of why I avoid it. But it's definitely not money that buys you a Lamborghini, but it was still a nice amount of money.

SPEAKER_01Cool. Yeah, I mean, I definitely need to buy you a coffee the next time I see you. Or your favorite beverage. It's more the personal gestures for people that are appreciated than like people

SPEAKER_00saying like you should get like so many millions for this. Yeah. All the people reaching out and supporting, I appreciated it way more than getting some money for it. Even though, of course, the money is always a nice factor, but it was really humbling how much people appreciated it, how many people reached out to congratulate and all that. That was really a super positive experience from the community and from Microsoft as well.

SPEAKER_01Exactly. Like it's like we are very much in the Microsoft community. All of us are indebted to you for, you know, your approach and not just this, right? Like all of the work that you do. And for me, like all of the security researchers that are in the community and keep sharing information, And helping improve, you know, our security really helped because it's more like it's us versus the bad guys, right? So that's the bigger sort of the battle that's going on.

SPEAKER_00Yeah, exactly. And I think there's all like a lot that we can learn from each other. So I also learn like a lot of things from the people that aren't in like security research per se, but are on more of the product side and that work with these products. Like an example is Rudy, who does a lot with Intune research and writes a lot of super in-depth blogs about Intune. That helps me a ton with my research because people talk about features that I never knew about and this whole niche expertise that people

have that are on the implementation side that's also very useful to know from a research point of view. And also I asked some people in the community when I was looking at the exchange

SPEAKER_00hybrid, like, okay, how much do people actually use this? Like, is this still common or does nobody pretty have it? And they also provided like valuable feedback, like how much is what actually used. And also, well, I tried not to look at SharePoint hybrids, but I touched upon it a little bit. And exchange hybrid was like maybe more common than SharePoint. So like, okay, that's where I focus. Yeah. Because that's sometimes the problem of being a security researcher. Like you don't know what people actually have in their environments. So that's why I'm really happy when I get to do like some real

client work rather

SPEAKER_00than just research, then I can see what people have in their environments. how they're using these products and what like their expectations are about these products that I may not be aware of because like I can put something in my lab and find like a vulnerability in something that like literally nobody's using but then what's the point in that Everybody is using a feature in a certain way, even though it's maybe not intended to be a security feature. And of course, it's interesting to look at, does it actually behave as a security feature where people have it?

SPEAKER_00So it's not just sharing between researchers, because of course, we learn a lot from each other and other researchers, but especially also people that just share like from the community, all the MVPs. sharing like the new product features, the new ways to deal with that, actually analyze, but it's also super valuable and we all keep learning from each other.

SPEAKER_01Yeah, exactly. Like some of the names you mentioned, like Rudy on all of the Intune stuff he writes about, like I start reading it and halfway through my head starts hurting. He goes into so much depth about, you know, how like join works and like enter join and like, you know, all of the different API calls and so on. So it's always a fun read, reading stuff. And yeah, as you said, it helps everyone build on top of each other, right? Like the research we do. uh and it's it's a team sport as many people say yeah and when

people are talking about like api calls and things i'm like oh and now we're talking like don't tell me how to click the button tell me what it actually does like how it actually works what it talks about like what the protocols are involved what all the nuances are

SPEAKER_00that's uh that's where i start to get interested in things But yeah, my head usually also hurts after I look at too much research.

SPEAKER_01So there's an interesting question from Dennis DNS in it. He asked, he'd love to know how many undisclosed vulnerabilities and unsupported APIs you're sitting on at the moment.

SPEAKER_00I think zero. I don't think I had any. So like my talk at Blackout and Defcon last summer was kind of like my house cleaning of all the previously identified like hybrid vulnerabilities that I had out of the way. But I don't think I have any like super exciting like undocumented things that I'm not talking about. I mean, there's still a few things that are under disclosure with MSRC that will get fixed hopefully in the next few months. It is always some vulnerability or some weird thing going on.

SPEAKER_00But no, it's mostly no. And I don't hoard zero days or something like that. I just hoard non-vulnerabilities that behave in a bit weird way. That reference later when I actually find a way to abuse it.

SPEAKER_01Nice. Yeah. So Sapir had a question as well, like, how do you decide what to research next? Like you already shared a little bit about, you know, exchange and how you started looking into that. But like typical, what's a typical day you get up and how do you decide, like, what am I going to look at today?

SPEAKER_00I think there's various inputs that I have. If it's about protocols and tools, then it can be something like opening a GitHub issue, some question that comes up during one of the classes I teach about Entra security, or something that I encounter in a real environment, or just a new feature that comes out. So there's quite a few questions. like features that I haven't looked at as much in depth as I would like. So I recently looked a little bit at like global secure access, but it's not something I've looked at extensively.

I'm also interested in like the token protection thing because it's also recently

SPEAKER_00when GA and that means also there's probably changes in how it works. So those are some things on my backlog, but usually whatever... piques my interest that I encounter. And of course, if I'm in a client environment, then there's more motivation to find something in there because then you can actually directly help your client with that. Which was actually how I also got into the whole Intune thing and Intune certificates because they had some misconfigured certificates. And there was also a way to find a way to abuse that,

SPEAKER_00but also immediately give them feedback like, okay, this is not something that people are doing yet because it's not really researched yet, but this is something that could happen in your environment. So you probably want to get this fixed anyway. And I like these kind of research things because they're using it. It's relevant to them. And if they have it, probably some other people also have it. And that's why I then research these things.

SPEAKER_01Nice. So, Joe had a question. Was it Joe? No, it was Erica Zellig had another question. So, she asked, what are your top three recommendations for configuration changes that will give, you know, the most bang for the buck for Intune?

SPEAKER_00For Intune. So Intune is one of these research areas where I still have to look into it because every time I look at Intune, there's like way more features than I thought were there. So every time I look at this thing, there's this thing and there's this thing. But I think a lot of the... So there's actually quite a bit of like changes in approach with regards to Intune. It's actually a very interesting topic because it goes back a

bit into like

SPEAKER_00attackers and defenders pushing each other. And what you see a lot is that like attackers, they're now doing all kinds of phishing. And then you have policies like device compliance, which are very effective against like these kinds of credential phishing. But then like maybe the next step for attackers is to actually try to get a device into Intune and get that device compliant so that they can bypass that. And then there's this autopilot thing. There's a bit of discussion whether autopilots should or should not be considered a

SPEAKER_00security measure, which was also interesting topic of discussion when I asked people about that because all of them were like, yeah, it's not a security feature. And I'm like, well, everybody is using it like it is a security feature. As the thing that stops like attackers from registering fake devices or from users and running arbitrary devices. So that's an interesting point of discussion where maybe there's a bit of a mismatch between what people are actually doing in that space and what is supposed

SPEAKER_00to be a security boundary or not. But I think just like tightening in Intune, like who can enroll devices? What kind of devices are you allowed to be enrolled? Especially like scoping some of your more like sensitive configurations, like certificates, VPN profiles to like devices that you really trust, like based on their like autopilot tag or something like that, which is way harder for attackers to be spoofed than just like enrolling a virtual machine or something like that.

SPEAKER_00So locking that down, locking down who can enroll these kind of devices, what kind of devices you allow, whether you allow like BYOD, that's kind of the kind of things. That's I think where the Intune wins are at. And if you roll out certificates via Intune, I would really look at like how are these templates configured because there's a lot of potential for misconfigurations there, I would say. Not sure if these are three things, but that's what I could come up with regarding Intune.

Yeah, I mean, that's like I personally was an Intune person before I joined the intro team. And yeah, it's a fascinating area because you have a lot on the client, right?

SPEAKER_01On the device side of things. Unlike in intro, it's mostly the cloud and you can see things that are going over the wire. So Joe had a question. He was asking about how do you avoid the temptation to look at other tenants when you find different vulnerabilities? Yes, I guess that only applies to the one cross-tenant vulnerability that I found. The only temptation I had to really resist was like adding myself as a global admin

SPEAKER_00in the Microsoft tenant. That would be like nice, like patch. That's... i know like i get in trouble if i do that so that's why i resist temptation but other than that like i don't really care that much about like reading other companies information um i've been a a band tester for so long that i've seen so much stuff at companies and like you're used to it right you're used to dealing with other people's data you know it's not your data you know you cannot look at it you can't keep it with you

you're just there to to help improve your security so looking at other people's standards and reading other people's mail is not something that's that's even remotely interesting to me so that's that's kind of how i avoid the temptation i guess so when you do some of these like do you share with others so they can also run and test like if you want to do more validation or do you just go off on the

SPEAKER_01validation that you do yourself

SPEAKER_00Depends. So most of the projects I would say I do by myself, but I've also done some projects like together with Fabian Banner, which you also had on the podcast a while ago. I looked at like these Entra, like first party app scopes, and that was like a very nice collaborative project. I've done some collaboration on the macOS side, for example, with Olaf, because I have no clue how Macs work. I only know how to deal with the windows. So that's also a nice, nice collab.

So sometimes I share things if it's in an area that I'm talking about with other people.

SPEAKER_00Sometimes with myself, just by myself doing it. But yeah, it's definitely interesting to research with people that have different perspectives, especially with people that are either on the defensive side or more implementation side, because there's so much experience of how people are actually using these things and how people do configure things like conditional access policies, what they see in practice that if you have a pure research point of view, you just don't have that. Yeah. Just doing like research in a lab with like your blinds on and

not seeing anything else.

SPEAKER_00That's not always useful. I need to have some external input to actually find like an impact. Yeah, that makes sense.

SPEAKER_01So you tell us about like the stuff that you do. You do training as well from time to time.

SPEAKER_00Yes, I actually do quite a lot of training because it turns out that Entra is a very complicated topic and people want to know how it works and how to secure it and how to advise their clients on that. So I do quite a bit of training on that for pen test companies or companies that have internal security teams. And I enjoy teaching people and it also provides me with new perspectives, right? Because you quite often have smart people in the class that ask

good questions

SPEAKER_00like, well, I don't know how this works, but maybe I can figure it out or we can find it out together. Yeah. And sometimes I also learn things from people that they tell me that's how it works. So I guess I've always liked sharing knowledge and just teaching others how things work and teaching them the joy of working with Antra and sometimes the pain of working with Antra. Yeah. But that's something I enjoy a lot. And actually, I also do like consulting every now and then actually look at real world

SPEAKER_00environments, which is a very useful input. And of course, any time I have left, I do one spending on research time or just answering my emails.

SPEAKER_01If someone wants to reach out, they can reach out on your website, right? To... book you so the contact info is on my website outsiderscurity.nl and before people ask like it's just me it's not a company with like 50 people i don't want to manage people i know what i'm good at i know what i'm bad at i wouldn't want to be my own manager so i'm just gonna keep it that way nice yeah that's one of the things i personally don't want to do managing people i prefer working

with the machine

SPEAKER_01typing yeah exactly

SPEAKER_00Writing code is so much more fun. Like code is usually doing exactly what you expect it to do without having an emotion about it. Yeah, for me, it's an art for managing people and I would prefer leaving it to others. And at some point in life, you have to realize that you cannot be good at everything and other people are better at dealing with different topics than you are. Absolutely.

SPEAKER_01Absolutely. So there was a question from John T about Dutch pancakes. Yeah, we have the best pancakes. the Dutch bank takes, right? I'm from Sri Lanka and we have a bit of a Dutch history. So there are lots of food and other things that we have in the Sri Lankan culture that come from, you know, the Dutch culture as well. So, and I didn't even know that about that.

We thought it was, they were like native Sri Lankan food, different things.

SPEAKER_01But it ended up being things that we had borrowed from the Dutch culture. So lots of shared stuff there. So what's your favorite pancake then? So my wife makes the small ones, the prof... What do you call it? Profit, yeah. So the Aussies also love it. You can go out and get those. But, I mean, she puts a lot of sugar, strawberries and chocolate syrup. So it's not a very healthy breakfast.

Yeah.

SPEAKER_00I mean, usually pancakes are something that you make for kids, right? It's also a guilty pleasure for adults. So I like my pancakes with like a mix of savory and sweet. So cheese and bacon, but then also like maple syrup on top for the sweet flavor. And that's like excellent. And actually, I think I'll make some pancakes this week because just hearing questions being asked about them, I'm like, I've eaten pancakes in a while. the remedy yeah my wife hates it when i do it but i also dip it

in curry and then have it so it's like mixing yeah with um especially with crab curry it's really good all right i haven't tried that yet i have to try that yeah it's a different

SPEAKER_01fusion thing it would not be a good mix Cool. Again, it's been such an awesome time having you on IntraChat. And thank you so much for sharing, you know, your journey and all of what you've been working on You are very generous with your time writing blog posts and sharing with the community. So it is very, very much appreciated. You help a lot of other researchers and a lot of up and coming

researchers.

SPEAKER_01They look up to you quite a lot. And we in the Microsoft community are lucky to have you and you focusing on the Microsoft stack is a thing I feel that we are we're lucky to have you on our side i mean i enjoy sharing knowledge and i really like seeing more people pick up these topics especially if people like pick up something that that i looked at a few years ago and then find new stuff in there or

find alternative attack paths that's that's like that's why i do the to the sharing

SPEAKER_00so that everybody can kind of kind of benefit from that and I mean, that's also how I learn. I learn also from other people that helped me get started, that's helped me reach the audience that I have, that I'm not just blogging into the void where no one reads it. So it's all about receiving and giving back, right? And also the things that you do for the community to give these people a stage to help them share their story. It's also really awesome. So thanks for that.

SPEAKER_01For me, it's a fun thing. I get to bring on people and talk to them one-on-one, right? So like for me, the hour that I spent with you itself is worth it. Cool. So thanks so much, Dakian. I'm looking forward to your next blog post. It'll always be an interesting one. I get my coffee ready and then I sit down and love going through the research that you share. So looking forward to it. Whatever you write, it's going to be amazing and very interesting.

SPEAKER_01And I'll come off learning something. So that's what I really like about, you know, reading stuff from the community.

SPEAKER_00All right. I'll make sure to make the next one a good one then. Cool.

SPEAKER_01Awesome.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. Which Passkey Should Your Users Get? The FIDO Alliance CTO on Passkeys and Post-Quantum Cryptography

    Nov 14, 202645 minAudio

    Microsoft is moving millions of users off SMS and onto passkeys, and most admins now have to decide which kind of passkey each group of users should get. Nishant Kaushik, CTO of the FIDO Alliance, the industry body...

    Credit the people on this episode

  2. Free AI Agents, the E7 Bill and AD vs Entra: The Workplace Ninjas US Special

    Nov 7, 202625 minAudio

    AI agents are arriving in every Microsoft 365 tenant, and the questions admins ask first are what they cost to run and what it costs to secure them. In this Workplace Ninjas US special, four of the event’s speakers...

    Credit the people on this episode

  3. Entra Multi-Tenant App Mistakes Every SaaS Builder and Admin Should Know, with Kelvin Tegelaar

    Oct 31, 202643 minAudio

    Most SaaS vendors connect to your tenant with one multitenant app and one credential, shared by every customer. Kelvin Tegelaar, founder of CyberDrain and creator of CIPP (used by well over 10,000 MSPs), sees it from...

    Credit the people on this episode

  4. Conditional Access Gaps and the App Back Door, with Brandon Colley

    Oct 24, 202639 minAudio

    Most Conditional Access gaps aren’t exotic. They come from reading policies the wrong way: as firewall rules with an β€œallow”, as a list of platforms that seems complete, as an MFA exception for the office that made...

    Credit the people on this episode

  5. Stop the Bleeding: Cleaning Up Apps, Secrets and Consent in Microsoft Entra

    Oct 17, 202651 minAudio

    Most tenants have the same problem: hundreds of app registrations and service principals, client secrets that were set to expire in a hundred years, permission grants nobody remembers approving, and test tenants that...

    Credit the people on this episode