News for hackers. Stuff that matters.
Re:Sudo for Windows by dist-epoch on Thursday February 08, 2024 @03:20PM (#39307122)
Putting Microsoft in the UAC prompt is indeed weird. It should be the info of the target binary. This feature sounds a bit rushed, and it's early preview, maybe they fix it by the final release.
Re:Sudo for Windows by zadjii on Thursday February 08, 2024 @03:30PM (#39307257)
Yea, that's a limitation of UAC at this point, and probably not one we can avoid. The "Show details" dropdown on the dialog does however show the commandline you requested, so at least that's one way of making sure it's the thing you ran
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.
Re:Sudo for Windows by londons_explore on Thursday February 08, 2024 @06:24PM (#39309217)
A tool like sudo should probably be sufficiently integrated with UAC to be able to customize that dialogue box...
Re:Sudo for Windows by Sakos on Thursday February 08, 2024 @06:59PM (#39309522)
You say that like Microsoft isn't an incredibly deeply dysfunctional company with absurd turf wars and conflicting interests between all the teams. You'd think it should be sufficiently integrated, but it's likely office politics made that impossible. How about be glad we got this at all as a first step, then maybe it will build momentum towards a better integrated solution?
Re:Sudo for Windows by KeepFlying on Thursday February 08, 2024 @07:45PM (#39309915)
You forgot that because of backcompat this solution will now become the unchangeable standard for years and anything more integrated will be in addition, not a replacement.
Re:Sudo for Windows by Sakos on Friday February 09, 2024 @04:07AM (#39312945)
And that's OP's fault how? We often have to work with the environment and framework we have, not the one we wish we had where we could just immediately implement the best possible solution.
Re:Sudo for Windows by Repulsion9513 on Thursday February 08, 2024 @07:49PM (#39309951)
Why should we be glad that Microsoft is not functional enough to make a decent product...?
Re:Sudo for Windows by internet2000 on Thursday February 08, 2024 @08:31PM (#39310320)
Job security for us Microsoft MVPs
Re:Sudo for Windows by Repulsion9513 on Friday February 09, 2024 @04:22PM (#39320698)
lol, parent: "Microsoft is too dysfunctional to make a good product, be glad anyway"

me: "Why should we be glad that Microsoft is not functional enough to make a decent product...?"

HN: flag!

Re:Sudo for Windows by marwis on Thursday February 08, 2024 @07:07PM (#39309593)
Maybe until UAC is improved you can ship with a launcher process that is signed by publisher "Unknown"?
Re:Sudo for Windows by worewood on Friday February 09, 2024 @07:14AM (#39314021)
From the diagram on the article I see that sudo is elevated first, then the target program is launched.

Can't you call the target program directly? There must be a way, because explorer.exe is not elevated, and when you right click a program and choose "Run as administrator" you get a pop-up for the target .exe, not for Explorer.

Re:Sudo for Windows by saagarjha on Friday February 09, 2024 @04:53AM (#39313231)
Yes, but then you would just run sudo cmd.exe [the program you want to run] and it will still say Microsoft.