WEBVTT

00:02.180 --> 00:03.660
Hey everybody, how's it going?

00:05.420 --> 00:06.740
My name is Michael Torres.

00:06.740 --> 00:09.360
I'm going to be talking about, uh, pseudo for Windows.

00:09.400 --> 00:11.960
Title of talk is Pseudos and Pseudonts.

00:13.060 --> 00:15.300
Here's a quick overview of what I'm going to talk about.

00:15.300 --> 00:21.180
You can read so I'm not going to bore you too much, but first we're going to go over what pseudo for Windows is because it sounds weird.

00:21.260 --> 00:25.680
Then we're going to hit, uh, some research, initial research on it, how it all works.

00:25.680 --> 00:29.100
Talk about some non-security issues according to MSRC.

00:29.100 --> 00:30.580
I'm supposed to use those words.

00:30.700 --> 00:33.280
Uh, then we're going to talk about some security issues that we found.

00:33.280 --> 00:35.540
One of them is unfortunately still under embargo.

00:35.580 --> 00:39.600
Talk more about how I found that one later, uh, but let's hit it.

00:40.920 --> 00:42.020
So who am I?

00:42.020 --> 00:45.480
Uh, I do operational technology security at Google.

00:45.480 --> 00:50.040
I also sort of do cyber depending on who you ask for the United States Marine Corps Reserve.

00:50.280 --> 00:56.320
I also volunteer my time with VETSEC which is a profit focused on helping, uh, veterans of the armed services for the U.S.

00:56.320 --> 00:59.520
and allied countries get careers in cyber security.

00:59.700 --> 01:04.400
I also just do random research projects like this that are not related to any of that when I get bored.

01:04.400 --> 01:05.660
So here I am.

01:07.920 --> 01:09.640
So what is pseudo for Windows?

01:09.640 --> 01:18.260
They, uh, Microsoft announced that they're going to introduce this utility in Windows 11 in the H2 update which usually drops around September, so in a month or so.

01:18.360 --> 01:22.280
It's currently an insider preview which is how I got access to test all this good stuff.

01:22.340 --> 01:32.360
The way it works at a very high level is it uses UAC, that standard process elevation thing to support the type of command line features you're probably used to if you use pseudo on Linux.

01:32.380 --> 01:37.320
So taking your input, your output, all that, putting it back into the prompt that you originally ran it in.

01:37.440 --> 01:42.880
Uh, that's both console input and output which are different on Windows than standard in, standard out, and standard error.

01:42.940 --> 01:46.240
It does this via fancy pipes and redirection and all that good stuff.

01:46.560 --> 01:47.620
It's written in Rust.

01:47.620 --> 01:49.380
It is now fully open source.

01:49.380 --> 01:54.140
At the time they just, at the time I did this research, they said it was open source but it wasn't published yet.

01:54.180 --> 01:58.400
Uh, which meant that I did a lot more work than I actually had to do but that's alright.

01:58.400 --> 02:00.220
That's what, that's what's fun I guess.

02:00.660 --> 02:05.160
Uh, I found two issues with, again, according to MSRC, no security impact.

02:05.160 --> 02:07.000
I have to use those words over and over again.

02:07.040 --> 02:10.840
One is a memory corruption issue which is fun cause like I said it's written in Rust.

02:10.840 --> 02:13.480
Uh, and the other one was a search order confusion issue.

02:13.480 --> 02:15.720
I found two issues with security impact.

02:15.720 --> 02:24.040
One allowed, uh, cross user code execution which, kind of sad, you don't really want other users to run code as you if you like your secrets being yours.

02:24.040 --> 02:29.600
And the other one allows you to data tamper the input and output data for sudo.

02:29.600 --> 02:33.360
And again I can't go into too much detail on that one but we'll talk more about it later.

02:35.340 --> 02:38.780
Most of my research was conducted against sudo version 1.

02:38.780 --> 02:43.860
Uh, you'll note that both of these bullet points say sudo version 1 but have different signature dates.

02:44.080 --> 02:45.260
I can't help you.

02:45.260 --> 02:51.080
They didn't increment the version number so I just had to use the signature date on the binary to distinguish the two.

02:51.280 --> 02:54.100
Uh, one is from February, one's from March.

02:54.100 --> 02:58.940
I don't know if they've released a more recent update cause I haven't checked in the last three weeks.

02:58.940 --> 03:02.780
So they might have but three weeks ago it was still the version from March.

03:05.680 --> 03:07.280
So precursor things to know.

03:07.280 --> 03:08.400
User account control.

03:08.400 --> 03:15.660
If you use Windows, which I assume most of you do cause you came to a talk about sudo for Windows, you've seen a user account control prompt, right?

03:15.660 --> 03:18.540
You always just hit yes cause you don't care what you're doing you just want it to work.

03:18.780 --> 03:24.440
Uh, the way it works is normal processes without elevation run in what's called medium integrity.

03:24.520 --> 03:38.200
That's pretty much everything except for processes or systems that are designed to use low integrity which quick shorthand is basically just web browsers in your PDF reader because they want that to have the absolute least privilege they can.

03:38.860 --> 03:43.480
Elevated processes, so the thing that runs once you hit that yes button cause you don't care you just want it to work.

03:43.480 --> 03:45.840
Uh, run as high integrity.

03:46.540 --> 03:58.000
Only processes running in high integrity are allowed to modify system resources which implicitly means that they can get system level permissions which is roughly equivalent to root on Windows, right?

03:58.820 --> 04:01.320
It's considered a defense in depth measure by Microsoft.

04:01.320 --> 04:03.240
They do not consider it a primary control.

04:03.240 --> 04:06.740
They do not consider UAC bypasses a security issue.

04:06.740 --> 04:07.640
They won't service them.

04:07.640 --> 04:09.480
They don't consider them part of bug bounty.

04:09.480 --> 04:28.660
Importantly for why sudo for Windows needs to exist, you can't spawn a process with UAC and inherit the standard in standard out standard error or console input and console output into the privileged process meaning that if you're in a command prompt and you try to run you know reg query as a privileged process,

04:28.660 --> 04:33.860
you can't then pipe that into another command or redirect it into a text file or something like that.

04:33.860 --> 04:37.920
It'll spawn it as a new process that can't put it back into your same window.

04:40.280 --> 04:44.020
Other things to know about uh the ALPC interface.

04:44.020 --> 04:46.060
It's an inter-process communications framework.

04:46.060 --> 04:50.640
It is officially undocumented and only used by Microsoft internal systems.

04:50.740 --> 04:56.880
The way it works is the server listens on a port which is just an object cause everything in Windows is an object.

04:56.920 --> 04:59.340
That port is just a string name.

04:59.340 --> 05:01.760
Sometimes it's a string as is the case with sudo.

05:01.760 --> 05:03.380
You can see the example there.

05:03.380 --> 05:06.900
Uh sometimes it's a GUID if it's a com object or things like that.

05:07.800 --> 05:20.120
The way that security is supposed to be implemented on ALPC is that the server can query attributes of the client like the process ID, the uh SID, the principal name and all of that of the caller.

05:20.120 --> 05:32.040
And the client is able to say I only want to connect to an ALPC server if it's also this SID or some other properties that I don't remember frankly and they're not in the slide so I'm not gonna remember them right now.

05:32.300 --> 05:43.160
Um the other thing to know is that in Rust if you want to use Windows native APIs like create process or shell execute X which are important if you're trying to run a process as an elevated user.

05:43.320 --> 05:48.040
Um you have to use one or you don't have to but Microsoft released two crates for it.

05:48.040 --> 05:50.940
Windows and Windows sys so those are first party owned by Microsoft.

05:50.940 --> 05:59.620
They both require you to run in unsafe Rust meaning that now we can get memory issues and buffer overreads and buffer overruns and all that good stuff.

05:59.740 --> 06:05.840
Um the only difference between Windows and Windows sys is the Windows crate does type coercion for you.

06:05.840 --> 06:13.480
So if you have a Rust string and you want to call a Windows API if you use the Windows crate you just give it the Rust string and magic happens.

06:13.480 --> 06:16.820
I don't really know Rust that well so sorry it just magically happens to me.

06:16.880 --> 06:23.220
Uh whereas with Windows sys you have to explicitly cast things into the right data type to get it to work in Rust.

06:25.840 --> 06:34.800
So Microsoft's blog post did actually include a fair bit of detail uh which was cool to see uh both from a security research perspective and just a curiosity perspective.

06:34.800 --> 06:38.020
It's cool to see them publish information about their tools like this.

06:38.120 --> 06:41.120
Uh there are three modes that Sudo for Windows supports.

06:41.120 --> 06:43.920
Those are new window, input closed and inline.

06:43.920 --> 06:48.760
The new window one is basically just the same as if you ran run as and then the command .

06:48.760 --> 06:50.680
So there's not really much novelty there.

06:50.680 --> 06:56.820
Uh the input closed and inline modes do this weird client server thing which you can see at the bottom uh right there.

06:56.920 --> 06:58.320
That sort of high level thing.

06:58.320 --> 06:59.700
We'll go into that more in a second.

06:59.700 --> 07:07.720
The difference between inline and input closed is in input closed the elevated process can't see the un-elevated console's standard end.

07:07.720 --> 07:17.500
So if you were to pipe the result of a command into a Sudo execution and your system is configured to run it in input closed mode, your elevated process won't be able to see it.

07:17.900 --> 07:26.220
They say that those are in order by most secure to least secure so new window being the most secure and inline being the least secure.

07:26.360 --> 07:33.120
Um they don't really go into a lot of details about that other than that it's it keeps things open for longer.

07:33.600 --> 07:37.560
Um again I mentioned earlier it in the blog post they say it's open source.

07:37.560 --> 07:38.760
They link to a GitHub repo.

07:39.080 --> 07:46.320
That GitHub repo was empty when I was doing this research so I just got to look at Rust code in Ghidra which if you haven't done it I don't recommend it.

07:46.540 --> 07:48.700
Um but now it's open source.

07:48.700 --> 07:50.600
You can go on GitHub and look at all their stuff.

07:50.700 --> 07:53.760
Um they included that diagram as I mentioned to explain the request flow.

07:53.760 --> 07:58.060
We'll go into that more in a second but you can see that there's a client server thing in there.

08:00.940 --> 08:07.560
So off the rip like this was actually found after the rest of this research because I was finally able to look at the source code.

08:07.560 --> 08:13.640
The new window mode still creates that RPC server so you're still able to do fun things with the RPC server.

08:13.980 --> 08:17.220
Um it doesn't always do what's on the tin.

08:17.220 --> 08:24.820
Sometimes it does actually pull in your standard in, standard out, standard error in your console input and console out and pipe it into the new process.

08:25.020 --> 08:33.440
Um again it's supposed to be the most secure uh but it does always get the standard in handle unlike the input disabled one.

08:33.660 --> 08:43.060
I don't know of any ways that that's necessarily a security issue but it's kind of an odd novelty because they describe it as being the most isolated from the unprivileged process perspective.

08:45.080 --> 08:57.740
So I started looking into this because I saw on Hacker News that veritable Y Combinator uh news aggregator that one of my co-workers at Google actually which I didn't know at the time made a blog post about Sudo for Windows and published some research.

08:57.800 --> 09:07.020
Um he pulled apart the RPC server some and found that at the time that RPC client server thing had zero authentication which is obviously very bad.

09:07.020 --> 09:11.740
That means you can just tell the server you would like to run a privileged command and it'll happily do it.

09:12.040 --> 09:14.880
Um that was fixed by the time I was testing it.

09:14.880 --> 09:15.900
Note that that's in quotes.

09:15.900 --> 09:18.940
Talk more about that in a minute.

09:18.940 --> 09:26.160
So I talked to again it pulled apart that RPC like client server API if you will and highlighted the methods of interest to call.

09:26.160 --> 09:28.340
Specifically that server do elevation API.

09:28.500 --> 09:33.240
That's what actually is called by the client into the server to coordinate execution.

09:33.300 --> 09:38.600
Passes handles that the process binds to and then you can get all your input and output and all that good stuff.

09:38.600 --> 09:49.660
It also passes a bunch of parameters relevant to the command being ran like the command to run, arguments to the command, the current working directory and optionally the environment depending on the flags you pass to sudo.

09:54.360 --> 09:57.820
Here is a more detailed look at run mode three in line mode.

09:57.820 --> 10:04.020
This is the one I did most of my research with because it is listed as the most insecure so it's probably the easiest target right?

10:04.020 --> 10:04.820
I'm lazy.

10:05.000 --> 10:14.100
Um you can see on the far side there you have the actual unprivileged console where the person runs sudo who am I and they're trying to run it as that elevated user.

10:14.100 --> 10:20.400
The way that works is it first spawns an elevated process to host that RPC service using normal run as.

10:20.400 --> 10:24.620
The user gets a prompt again they click yes like everyone does because they just want the thing to work.

10:24.940 --> 10:31.220
Um the client then sends an RPC into that privileged process telling it what command it wants to run.

10:31.400 --> 10:39.060
The privileged process binds to the handles that gets passed in there so that all your input output and standard error stuff just flows naturally.

10:39.520 --> 10:46.780
Privileged process that the user specified gets spawned and then magic happens you can do all your normal command line pipes and stuff.

10:48.940 --> 10:52.540
So summarizing everything we just talked about sort of high level notes.

10:52.540 --> 10:54.240
Uh it's written in Rust it's open source.

10:54.240 --> 10:59.160
Uh Rust requires you to enter into unsafe mode so again memory safety issues can happen.

10:59.160 --> 11:03.320
Uh to call Windows native APIs which things like this kind of have to do.

11:03.480 --> 11:09.780
Um and ALPC is what's used to coordinate the actual execution of the user specified process.

11:11.740 --> 11:15.140
So our first issue the memory safety issue in Rust.

11:15.240 --> 11:19.380
Um sort of odd right but as I just mentioned you have to use unsafe APIs.

11:19.380 --> 11:38.820
Uh they've removed this functionality before they published it to GitHub so I can't tell you exactly how it happened but at a high at a from my analysis what happened was if you gave a path that rewrote from the beginning meaning that you had a leading like backslash or C colon backslash right?

11:38.820 --> 11:49.880
It would write your path to the start and then when it passed it to an API function it didn't truncate at the end of where your path was it just read until the end of the buffer to the first null byte.

11:49.940 --> 12:06.300
I think that that happened because they assumed that a path as string would point to a null terminated buffer as you would kind of expect it to if you're used to C when in fact it just points to a vector of U8s that may or may not include a null byte at the end.

12:06.440 --> 12:45.980
Um here's sort of my mock up of the code uh you can pull these slides off the Defcon media server if you want to take a better look at it but this is just sort of demonstrating what I just talked about where if you assume that you can take the path as a string and then just get a pointer to it and pass it to the Windows API function you'll end up very sad because it'll just read until the first null byte not necessarily until the end of your target string meaning you have buffer over read in heap uh for arbitrary numbers of bytes that you can't necessarily control but because you can control the path you can control approximately how far into that heap buffer you read.

12:47.080 --> 13:18.200
Uh so like I just said you can read everything up to the first non-null byte you don't control which heap allocation you're reading and it doesn't let you write memory into arbitrary things that are outside of your heap boundary because it is rust it's a vector uh so it'll reallocate if you reach the capacity of the current heap allocation um but still you get to read things from previous heap allocations which in my testing tended to just be paths but it could be something like a token or something like that.

13:19.180 --> 13:46.760
Um it says at the bottom there why uh it's not really a security issue uh the main problem being this is only noticeable if you run pseudo with an unpro or a untrusted input which you shouldn't do anyway so it's not really security impacting if you run pseudo with arbitrary things someone you don't trust supplied and then you can read other memory because you shouldn't be doing that in the first place because you're going to execute someone else's code.

13:48.180 --> 14:15.020
This screenshot shows what I was talking about so you can see on the left there I run pseudo with a leading slash and then a path and then you can see in process monitor that at the end of the day a create file operation or trying to read the file um ends up re trying to read a file that's the thing that I was trying to read and then a bunch of things from presumably a previous heap allocation because that's the path that's the current working directory and then some garbage at the end until it reaches the first null byte.

14:18.130 --> 14:35.190
So the second issue uh search order inconsistency so in Windows just like actually I shouldn't say that I don't know if it's true in Linux but in Windows if you run a command without a path it is supposed to execute that command in the current working directory if it's present and then search your path.

14:35.570 --> 14:45.270
So if you run pseudoprogram.exe you expect it to run the program.exe in the current working directory not some other random program.exe.

14:46.130 --> 15:00.110
Path resolution didn't work that way the way it worked is again because of that client server thing it would try to resolve the path in the context of the privilege process which had a different current working directory meaning that you could end up running a command you didn't expect to run.

15:00.430 --> 15:14.270
Uh says up there it's a somewhat contrived example but if you had compiled your own binary and named it cmd.exe and then you tried to run pseudocmd.exe it wouldn't run your command.exe it would run the system32 command.exe.

15:14.270 --> 15:18.850
According to Microsoft it's not a vulnerability I have their exact response quoted there at the bottom.

15:20.210 --> 15:22.230
But they fixed it anyway.

15:22.690 --> 15:34.990
Um so they more or less looked up the in the unprivileged process they looked up the command you gave them and resolved it and then passed the fully resolved path into the privileged process.

15:35.250 --> 15:46.010
Um they fixed it I'm not going to complain too much but it's kind of odd that you accept input from people on what issues are fix them and then tell them yeah but we don't think it's a real issue.

15:48.050 --> 16:06.750
And this is a very well drawn I'm an artist if you didn't know uh example of how that would work from an attacker's perspective so you try to run command.exe you expect it to run yours it ends up running some other command in the privileged process path which isn't the one you wanted.

16:08.950 --> 16:18.030
So let's talk more about that RPC server again it's ALPC um source code wasn't available so I had to look in Giger to figure out what all these parameters meant.

16:18.030 --> 16:31.170
Uh I got pretty good results out of it I didn't know what those handles were or how to deal with them necessarily but luckily I didn't have to you can just bind to input and output without dealing or without worrying about the handles too much.

16:31.330 --> 16:47.230
Um importantly the unprivileged process ID so the one that you run before you hit that yes prompt as quick as humanly possible is what is used to create the socket name so it's predictable as long as you know the process ID that's uh trying to run sudo.

16:47.910 --> 17:05.990
And again I mentioned earlier after James Forshaw's blog post they added an authentication check which was checking that the client's process path so that unprivileged process was the same as the server's process path meaning both are running sudo.exe see windows system 32 sudo.exe right?

17:06.170 --> 17:17.870
Um over on the right side overview of that that off check on the right right just is the image name of my calling process the same as my image name if it is good to go we'll run your command.

17:19.690 --> 17:22.570
Which brings us to our first security issue.

17:22.570 --> 17:25.770
Um it turns out that that's not really a good authentication check.

17:25.770 --> 17:45.670
Um any user can issue elevation requests to that RPC server meaning that any user of a multi -user windows system to include you know unprivileged users because anyone can call an LPC socket like your web browser um can go ahead and run commands in the context of a user uh when they run sudo.

17:45.670 --> 17:53.570
So it's not latent I and a privileged user would have to try to run sudo and then you'd be able to exploit this to run it in the context of that user.

17:55.190 --> 18:18.190
Exploitation requires two things so like I mentioned insufficient authentication um the way I did that is I just injected a DLL into a sudo.exe sudo process that I controlled so that I could do whatever I want in the context of a process whose image name is the legitimate sudo.exe um and the other part of this was that predictable uh port name that predictable RPC control port name.

18:18.450 --> 18:25.910
Because users can view the process IDs of other users in Windows uh pretty much no matter what there are some types of tokens that can't do that.

18:25.910 --> 18:38.530
Uh you can get that information very easily and then you can just call the target sudo privileged sudo process and have it run whatever you command you want and gain execution in that user's context.

18:39.250 --> 18:45.830
This was patched in the version in the second version one of sudo the one that was uh code signed on the 4th of March.

18:47.090 --> 18:52.970
So again high level attack diagram you see at the top there we have our victim who's just trying to run sudo and get on with their day.

18:52.970 --> 18:57.030
We have we have our attacker with again I'm an artist very well drawn horns thank you.

18:57.090 --> 19:19.850
Um the attacker starts their code that's just waiting and find trying to find a victim sudo that is running and then as soon as it notices one it spawns its own sudo with a hooked method to connect to the target RPC server instead of one that it spawned uh to run whatever command the attacker wants.

19:19.850 --> 19:35.610
From the victim's perspective what this looks like is they ran sudo they as fast as humanly possible because again they're just trying to get the job done hit the yes button on the UAC prompt and then nothing happens from their perspective but in reality the attacker was able to run whatever command they wanted.

19:37.920 --> 19:40.300
Uh demo I think?

19:40.420 --> 19:41.640
Do I have that wrong?

19:42.020 --> 19:43.340
Hopefully it plays.

19:44.380 --> 19:46.600
Alright well that was surprising.

19:50.660 --> 19:57.480
So here I'm just showing there's nothing up my sleeve um uh the left prompt is gonna be our victim user so who am I?

19:57.480 --> 20:01.760
I'm MTU um it can run sudo just fine.

20:01.760 --> 20:06.260
The right prompt is now my unprivileged user or my non-administrative user not MTU.

20:06.260 --> 20:12.880
Right now I'm gonna show that uh sudo works and then that the base prompt is not running elevated.

20:13.000 --> 20:24.220
And then on the right on the right we're running that implant code that's just gonna spawn some stuff uh to try to target that victim sudo process.

20:24.220 --> 20:31.520
We are racing because if we don't beat the legitimate process um the RPC socket closes and we can't run our command.

20:31.520 --> 20:34.000
So we go slowly insane trying to win the race.

20:34.000 --> 20:43.600
I did test this in a debugger first so I was pretty confident it was supposed to work but man recording this video and just sitting there doing this for 2 minutes was not fun.

20:43.620 --> 20:56.520
Um at the end there you can see that it worked on the right side our unprivileged process again we were able to inject into that victim server process and run command.exe as this as the unprivileged user.

20:56.640 --> 21:02.080
We run whoami and we see that we're now running as that other user who is just trying to run something with sudo.

21:05.870 --> 21:09.110
Well I already played the video but we can play it again if you want.

21:10.390 --> 21:12.030
Oh nothing showing up there?

21:12.050 --> 21:12.870
Neat.

21:14.810 --> 21:16.570
Let's try it this way.

21:17.870 --> 21:18.790
Can you see this?

21:18.790 --> 21:19.950
This video now?

21:36.350 --> 21:46.370
So again uh again left prompt is the uh privileged user who's just trying to run sudo uh the right prompt that's about to spawn is the unprivileged user not MTU some evil attacker man.

21:46.870 --> 21:52.250
Um user runs command everything works.

21:52.310 --> 21:54.990
Let's see if I can skip this bit a bit.

21:55.430 --> 22:02.710
Um user keeps running command they keep working because you'll notice on the other side the attacker process is failing it's not winning that race.

22:02.710 --> 22:08.490
Uh like I mentioned I confirmed this in a debugger but still very frustrating watching it fail over and over and over again.

22:08.790 --> 22:15.390
Um but eventually it does work and we can see on that right side now we just got a command prompt back from the attacker's perspective.

22:15.410 --> 22:23.430
We run whoami and we see that we are running as a user other than ourselves which is not good I think is what it's called in the business.

22:31.700 --> 22:32.560
Alright.

22:34.520 --> 22:36.300
Uh work with me here.

22:36.300 --> 22:36.940
Nope.

22:40.360 --> 22:42.180
Yeah it's perfect.

22:42.380 --> 22:50.840
Um so I did find out after I tested this again after they made the source code available that they made that race window really short.

22:50.840 --> 23:01.520
So I assumed that the way it worked was the victim process ran its command successfully and then went ahead and uh then went ahead and closed the socket after it was done.

23:01.520 --> 23:06.300
In fact as soon as you called that elevation request API it locked all future calls of it.

23:06.300 --> 23:12.440
Which would explain why I had to run the command over and over again going slowly and sane until it worked.

23:12.440 --> 23:19.000
But I don't know not not really security control but good for them for locking out other users and thinking about it.

23:20.500 --> 23:24.320
So the second vulnerability I mentioned it's still under embargo unfortunately.

23:24.700 --> 23:30.300
Um I reported it 13th of June while the rest of this research was done April May time frame.

23:30.340 --> 23:35.380
Um sort of interesting story for you since I can't talk too much about the details of this one.

23:35.380 --> 23:46.320
The reason I thought of this was I was on a run trying to avoid working on the slides and I realized that there was some other issues with how they do that client server thing.

23:46.320 --> 23:57.040
So I was able to prove it out and get data tampering and information disclosure from again the process or the perspective of a non -privileged user on the privileged user's stuff.

23:59.320 --> 24:06.920
So public issues again it is a GitHub repo there are public issues uh that I think are sort of notable to talk about when we talk about Sudo for Windows.

24:06.920 --> 24:10.080
The first one um the elevation prompt is confusing.

24:10.080 --> 24:13.040
So there's a screenshot of it on the right you saw it earlier in the video.

24:13.360 --> 24:17.860
You don't know what hitting yes will do cause it's just telling you it's a Sudo invocation right?

24:17.860 --> 24:28.120
It doesn't tell you oh Sudo's actually gonna spawn this other process over here maybe you don't wanna do that it just says hi I'm Microsoft I'm a legitimate binary would you like me to run?

24:28.480 --> 24:31.440
Um not great from a security's perspective right?

24:31.460 --> 24:52.100
Admittedly again most of us probably just click yes as fast as humanly possible anyway or type in our credentials if we have that version of UAC enabled but um I believe that they committed to trying to figure out how to make it so it was more obvious what the actual command that's gonna run is instead of just saying yeah it's it says it's legitimate I'm just gonna hit yes and hope everything's okay.

24:52.440 --> 25:05.940
And the second issue uh which is critical to me because I like my computers to insult me is um Sudo for Linux or Unix if you will has a mode to have it insult you if you don't have legitimate access to run a command.

25:05.940 --> 25:10.520
Uh I want that in Windows cause I like my computers to be mean to me when I'm silly.

25:14.060 --> 25:16.160
So summary of everything we just talked about.

25:16.160 --> 25:17.460
Sudo for Windows is coming soon.

25:17.460 --> 25:28.180
Again it is scheduled to be in mainline Windows 11 and I think Windows server don't quote me on that one uh end of September-ish in the in the H2 update.

25:28.360 --> 25:44.880
Uh it's open source again we we love to see that it makes it so people like me or people like anyone in this audience can go look at the source code and pull it apart and understand not only how it works but maybe find some more security issues in it so we're not shipping products that are enabling bad things to happen on Windows.

25:44.880 --> 25:49.640
Or if you're on the other side of it using it to make bad things happen on Windows I don't know I don't judge.

25:49.980 --> 26:02.200
Um it is meant to be a drop in replacement for the way Sudo works on Linux so it lets you actually have standard in, standard out, standard air, piped and redirected and all that stuff within your command prompt or your PowerShell prompt.

26:02.440 --> 26:16.240
Um and it does all of that using user account control to elevate processes and inter-process uh communication to actually coordinate that across the not a trust boundary because that's not what Microsoft calls it of UAC.

26:16.380 --> 26:26.960
Uh sort of the big take away for me and it's informing some more stuff I'm looking into is you cannot call a Windows native API without going into unsafe rust.

26:27.200 --> 26:49.700
If you want to do that or for anything that uses a Windows API that means there is now the potential for you to get memory corruption act vulnerabilities in something written in rust which is counter to what everyone tells you about rust so be on the lookout for that if you're a bug hunter that if you see something calling a Windows native API from a rust program somewhere in that code it is unsafe.

26:49.700 --> 26:50.860
Poke at that boundary.

26:51.780 --> 26:59.440
And then I'll show some references and if anyone has any questions you can step up to that mic in the middle and I'll be happy to answer them.

26:59.580 --> 27:03.960
I don't know how much time I have left but I'll try to answer as many questions as I can.

27:08.850 --> 27:09.970
Thank you.

27:14.180 --> 27:15.100
Cool.

27:15.140 --> 27:16.360
Thanks everyone.

