News for hackers. Stuff that matters.
Re:Sudo for Windows by SushiHippie on Thursday February 08, 2024 @04:04PM (#39307674)
The best way would be, if it could say something like:

Allow $PARENT_PROCESS_NAME to run $COMMAND with administrator rights.

So if you would enter the following in cmd.exe:

  sudo notepad.exe ...

It would say:

Allow Command Processor Shell to run notepad.exe ... with administrator rights.

Re:Sudo for Windows by zadjii on Thursday February 08, 2024 @06:00PM (#39308977)
Maybe for Windows 2025 we can work with the UAC folks to get something like that. I'm still shocked to this day that we managed to ship this at all. One step at a time :)
Re:Sudo for Windows by jraph on Thursday February 08, 2024 @06:58PM (#39309504)
> I'm still shocked to this day that we managed to ship this at all

Why?

Re:Sudo for Windows by Sakos on Thursday February 08, 2024 @07:00PM (#39309527)
Sorry, have you never read anything about Microsoft before? I'm not sure why people are being so critical of OP.
Re:Sudo for Windows by jraph on Thursday February 08, 2024 @07:15PM (#39309657)
Look, I'm genuinely curious and we happen to have a MS dev here who could provide interesting first hand insight.

I'm not critical. I don't have enough knowledge on the situation to share criticism on the topic yet.

I could have added "Could you expand on this?" to clarify my intent.

Re:Sudo for Windows by zadjii on Thursday February 08, 2024 @09:03PM (#39310552)
To answer the original question: I've been at MSFT like, 8 years now? And this is probably the third serious attempt my team has made at Sudo for Windows. (I think I heard of a couple other attempts in my tenure as well). After the last attempt, my mantra had always been "this is impossible to actually ship".

It's a tricky feature to ship, cause it is ultimately something that can be used as an escalation of privilege vector. Like, that's the entire idea. And there are a lot of people who (very rightly) get the ick when you say "we want to add this thing which can be used as an EoP to the OS image".

So, it's kinda hard to believe that after four years of thinking it was impossible, we actually managed to get it out the door.

Re:Sudo for Windows by rezonant on Friday February 09, 2024 @01:48AM (#39312136)
Pretty fair, especially since there's already tons of ways (albeit far less convenient) to accomplish nonmalicious escalation.

Great work making this happen!

Re:Sudo for Windows by jraph on Friday February 09, 2024 @01:48AM (#39312137)
Makes sense.

Thanks for taking the time to answer, very appreciated! You must be happy to have been wrong, ah ah.

Re:Sudo for Windows by xattt on Friday February 09, 2024 @06:34AM (#39313791)
You must feel like you just shipped Duke Nukem Forever.
Re:Sudo for Windows by k12sosse on Saturday February 10, 2024 @03:27PM (#39329876)
Let's hope people actually use Sudo for windows though.
Re:Sudo for Windows by efreak on Friday February 09, 2024 @07:32PM (#39322236)
If you can get the suggestion passed on, a simple way to run a process while _dropping_ elevation would be appreciated. Basically the _opposite_ of sudo. There should be a way to _easily_ drop permissions back to the standard desktop user (or lower?), like Linux's setuidgid. There's runas, but apparently that's not sufficient[0]; instead all I'm aware of is scheduled tasks and proxying through explorer, or leaving an unelevated process open and using IPC or other methods to tell if to run something else (none of this is easy in a simple batch file).

The biggest visibility into this issue is software installers, which regularly offer to launch the freshly installed program for the user's convenience...with the same elevated permissions the installer itself uses.

[0]: according to this SO answer, runas still runs the process with high integrity: https://stackoverflow.com/questions/20218076/batch-file-drop...

Re:Sudo for Windows by jdhendrickson on Thursday February 08, 2024 @09:47PM (#39310810)
I wish my fellow posters could get out of their own way long enough to congratulate you! this is a great feature. I'm glad you got it into the build and I can tell you're excited about it. I can't remember the last time. I was excited about a feature that I shipped. maybe I'm just burned out but it's really refreshing to see it's shining through your replies. companies like Microsoft and Google need more engineers like you that actually care about shipping cool shit.