Welcome to MSDN Blogs Sign in | Join | Help

Workaround for Shutdown.exe LUA bug

The "shutdown.exe" command-line utility in Windows XP has a LUA bug that prevents non-admin users from using it to shut down or restart the computer.  There is a simple workaround.

Shutdown.exe offers a number of command-line options, including the ability to shut down a remote system (assuming you have the privilege to do so on the remote machine).  The problem is that when something other than "logoff" is specified, Shutdown.exe tries to enable both the SeShutdownPrivilege ("Shut down the system") and the SeRemoteShutdownPrivilege ("Force shutdown from a remote system"), even if local shutdown or reboot is all that is being requested.  On XP, Users have SeShutdownPrivilege by default, but they don't have SeRemoteShutdownPrivilege.

The workaround:  Grant "INTERACTIVE" the SeRemoteShutdownPrivilege.

How to do it (requires admin privileges):  Open Administrative Tools \ "Local Security Settings".  Navigate to Security Settings \ Local Policies \ User Rights Assignment.  Double-click "Force shutdown from a remote system" in the right pane.  Click "Add User or Group".  Enter the name INTERACTIVE in the text box and click "Check names", then click OK, and OK again.

Does granting this privilege this way open up the computer to remote attack?  No.  The "INTERACTIVE" SID appears in the user's token only in the interactive logon session.  Remotely invoked code does not have INTERACTIVE in its token.

Published Friday, January 27, 2006 1:46 AM by Aaron Margosis
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Workaround for Shutdown.exe LUA bug

Sunday, January 29, 2006 4:16 AM by Jonathan
I presume shutdown.exe will be fixed, at least for Vista?

# re: Workaround for Shutdown.exe LUA bug

Wednesday, February 01, 2006 9:49 AM by Joe Flomo Matthew
Thanks a million Aaron. You made my day by providing the trick in using 'Shutdown.exe" under non-admin users. Keep it coming my man, you are the greatest!

# re: Workaround for Shutdown.exe LUA bug

Wednesday, February 01, 2006 3:17 PM by somarr
OK. So I have given my LUA, the listed rights for a machine. I remotely attempt to shutdown the machine I had just given those rights and I receive a "A required privilege is not held by client." As a sidenote, I happen to be running the shutdown command from a RunAs prompt. Any ideas? I am trying to create a batch script for a tester to reboot his assigned machines.

# re: Workaround for Shutdown.exe LUA bug

Friday, February 03, 2006 3:29 AM by Lee
Interesting -- it had never occured to me that this was an issue. I've always been running it from my MakeMeAdmin window!

# Table of contents, Aaron Margosis' non-admin blog

Sunday, February 05, 2006 11:30 PM by Aaron Margosis' WebLog
Complete list of Aaron Margosis' non-admin / least privilege posts, for easy lookup.

# re: Workaround for Shutdown.exe LUA bug

Sunday, February 12, 2006 5:39 PM by Hell Baron
There is another computer virus targeting Windows machines. This is not a surprise, I mean that Windows has always been a target and always will be as long as people always run Windows as Administrator instead of an unprivileged account. Apparently it is a e-mail virus requiring a less than intelligent person to click on a link in the e-mail and activate the virus. Although with Internet Explorer you can just visit a web page and you are infected. That is why a browser like Opera is a better choice. Or Firefox 1.7. Some websites have mp3's for download and require you to download some software first before you can download their files. But of course it contains a Trojan Horse and you are infected. Infecting Windows has never taken much effort on the part of the spy-ware authors. Especially those types who still run Windows '98. That OS is really insecure. But then again, so is Windows XP SP1. That is very insecure. People assume the Windows XP service pack 2 firewall is secure, but I am sure it is not. Not as secure as a dedicated Smoothwall box. Windows needs to run with more strict permissions and have greater control over which files are writable by the normal user. But that would be too much hassle for the usual Windows users who prefer to run as administrator, since they think they are gods to Computing. Slashdot fan-boys I am looking at you. And yes I am a Slashdot  person but I do not run Windows, and I do not run my computer that way. I run Linux with strict file permissions and a password on sudo. Some people just have it setup to run any command without a password but that is silly indeed. An American man is suing Apple because their Ipod music player can cause cause deafness... Turn down the volume you loser! Americans crack me up when they behave like that.

# Can this be scripted somehow?

Friday, March 03, 2006 9:11 AM by Michał Szkutnik
Can this action be scripted and done automatically?

# re: Workaround for Shutdown.exe LUA bug

Friday, March 03, 2006 9:50 AM by Aaron Margosis
Michał Szkutnik - it could be applied through Group Policy, through a startup script (not a logon script), and possibly through the "Restricted Groups" feature of GP.

# re: Workaround for Shutdown.exe LUA bug

Tuesday, March 14, 2006 6:08 PM by Brian Paul
I am scheduling Shutdown.exe to run thru the task scheduler.  This workaround works fine if a person is logged in, but if it's at the login screen, it will not perform a shutdown.  Aaron, is there a way to make this work for a power user when the computer is at the login screen?

# re: Workaround for Shutdown.exe LUA bug

Tuesday, March 14, 2006 9:52 PM by Aaron Margosis
Brian Paul - A program started from the task scheduler with no one logged on will (I'm quite sure) not have INTERACTIVE in its token.  You could try granting the privilege to the user account you're configuring it to run as, but be aware that that grants the privilege to that account for a real remote shutdown.  You might also try granting the privilege to "BATCH" instead of "INTERACTIVE" - I can't remember what logon type task scheduler processes use.  If that doesn't work, "SERVICE" might.

# re: shutdown will not work

Friday, March 24, 2006 12:09 PM by Josh
when i want to remotely shut down computers, some computers will work and some computers will not.  It will say "cannot find network path"

Any Ideas?

# re: Workaround for Shutdown.exe LUA bug

Sunday, May 14, 2006 9:01 PM by Euan
You might need to put the PC name like \\PCName instead of PCName

Or try pinging the computer name to be sure its connected to the network.

# re: Workaround for Shutdown.exe LUA bug

Friday, July 07, 2006 3:18 AM by Matt M
for "shutdown.exe -s -m \\PCName" would work for windows 2000, and windows xp pro, but not for windows xp home. I have not found any info on why XP home has an issue with receiving remote shutdown commands from shutdown.exe

# re: Workaround for Shutdown.exe LUA bug

Friday, July 07, 2006 1:42 PM by Aaron Margosis
@Matt M - do you have Simple File Sharing turned on on the XP Home box?  That will cause all remote users to authenticate as Guest, which can't do a remote shutdown.  (There may be other causes as well.)

# re: Workaround for Shutdown.exe LUA bug

Friday, July 28, 2006 9:13 PM by Ryan

is there another way to shut down the PC if i dont have the "start" button, i cant right click on the desktop and alt+f4 is not allowed?

Ctrl-Alt-Del + "Shut Down"?  (Is this a machine you're supposed to be able to shut down, or a kiosk system?)

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Wednesday, August 30, 2006 1:09 PM by Noah P
I tried to add more permissions, and I am still getting access denied.  I have these two machines, that have 2 PC's on each. They are on their own internal networks (Read: Machines not connected to each other). Both use the same logons (With Admin Rights), one machine works, one doesn't.  

The one that doesn't I can't shut down either pc from either PC.

# re: Workaround for Shutdown.exe LUA bug

Sunday, September 03, 2006 5:05 PM by Carl
The Shutdown.exe LUA bug appears to also effect how Wake on Lan (WOL) works.  

On my IBM ThinkCenter, shutting down remotely worked both through ctrl-alt-end and choosing shutdown, and through shutdown.exe.

However, the system would not Wake on Lan if it was shutdown with Shutdown.exe.  The workaround listed here has fixed the problem.

# re: Workaround for Shutdown.exe LUA bug

Wednesday, October 04, 2006 11:38 PM by pclady

THANKS! This is great! Worked for me. I was simply trying to run shutdown.exe from command line from a USERS account. I applied workaround and it worked. So, now I need to know if this workaround can be applied via the REGISTRY or from a VB.NET application? Any info would be greatly appreciated.

It can't be applied via the registry.  You need to use the LsaAddAccountRights Win32 API.

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Thursday, October 26, 2006 10:37 AM by chkidd

I am trying to do the following...

use the WinXP Shutdown.exe on Win2k PC's with users in both AD and non-AD WinNT Domains,

the pc's in AD work, the pc's not in AD do not work.

I am using a shortcut to the shutdown.exe from the users desktop.

Any help appreciated.

chkidd

Just to understand:  are you trying to shut down remote computers or the local computer?  If remote, the logged on user must be recognized as a member of the administrators group on the remote computer.  There may also be issues with using the WinXP shutdown.exe -- Windows 2000's shutdown.exe came with the Windows 2000 Resource Kit.  You might want to use that if you're running it on a Windows 2000 computer.  Also to clarify:  by "non-AD WinNT domains", do you mean that the domain controllers are running Windows NT 4.0 or earlier?

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Saturday, January 20, 2007 11:57 PM by Joe Smith

You know.. making sure that the Simple File Sharing was unchecked allowed me to accomplish the remote shutdown from a different computer on the same LAN.  I tried all sorts of other stuff to get the remote shutdown to work with shutdown.exe but in the end all I had to do is uncheck the use Simple File Sharing option in Folder Options\View\Adavnced Settings window.

Joe Smith:  When Simple File Sharing is enabled, all network access authenticates as Guest.  Remote Shutdown requires administrator rights, which can't be obtained when you're authenticating as Guest.

Hope this clarifies...

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Wednesday, February 28, 2007 7:37 AM by TP

Thanks! This seems to work. Where the setting is in the registry?

TP:  It can't be edited directly -- it's buried under HKLM\Security.

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Friday, March 23, 2007 4:53 PM by Jeff

I have 2 separate networks, both with 2 xp pro boxes running in a workgroup.  Adding the INTERACTIVE account as described and unchecking simple file sharing worked on the first network, but not the second.

I still get "Access Denied" when the first box on the second network attempts to shutdown the second box.

Netbios over TCP/IP is enabled.  They can ping each other.  File sharing works.  No events are captured in the event viewer.

The user accounts on both machines have blank passwords.  Would that cause any issue?

Any other ideas

Jeff:  user accounts with blank passwords can be used only for console logon.  They can't be used across the network, including through Remote Desktop, nor can they be used with RunAs (or MakeMeAdmin, which builds on RunAs).

-- Aaron

# re: Workaround for Shutdown.exe LUA bug

Sunday, June 03, 2007 10:55 PM by David

I have XP Home. According to Help and Support center, simple file sharing cannot be turned off in XP Home edition. How can I remotely shutdown one XP Home computer using shutdown?

I already tried

shutdown -s -m //NAME

and got the error

"The network path was not found."

Thanks!!!

# re: Workaround for Shutdown.exe LUA bug

Friday, October 19, 2007 4:19 PM by Steve

Thats because its \\name  not//

# re: Workaround for Shutdown.exe LUA bug

Saturday, October 20, 2007 7:33 AM by Ben

I'm having problems with this too. I have two XP Home computers. I've tried everything I could find (both fiddling and searching the internet) to try to get them to shut each other down. They keep giving me the "the network path was not found" error message. Any help would be appreciated.

[Aaron Margosis] XP Home Edition has "Simple File Sharing" always on.  That means that anyone connecting remotely does so as "Guest". That further means that remote administration (including remote shutdown) of XP Home Edition computers is not possible.

# re: Workaround for Shutdown.exe LUA bug

Monday, December 10, 2007 3:33 AM by hey

mayby because, you are not the adminstrator

# re: Workaround for Shutdown.exe LUA bug

Thursday, March 13, 2008 12:34 PM by Chris

Further to Aaron's comment that Remote Shutdown of a XP Home PC is not possible because connecting remotely uses the rights of the Guest account - this is correct.

What is not correct however is the statement that remote shutdown is not possible. The solution lies in granting the Guest account the privilege to access the shutdown.  

To do this you need to use the NtRights.exe file found in the XP Resource Kit, here http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en  You need to download the kit from Microsoft. Copy the NtRights.exe program to Windows\system32. Next log-in as an administrator on the box top be shutdown remotely and perform the following commands from a command window:

NtRights –u Guest +r SeRemoteShutdownPrivilege

NtRights –u Guest +r SeShutdownPrivilege

Be careful about the spelling – note there is no ‘t’ in the priv name where you would expect it to read SetRemoteShutdownPrivilege  

See here for a full description of the NtRights.exe program http://support.microsoft.com/kb/279664

Now you should be able to use the shutdown.exe programs from a remote computer. When you do the shutdown message on your XP Home machine will read ‘Shutdown initiated by \\<pc name>Guest’

# re: Workaround for Shutdown.exe LUA bug

Sunday, April 13, 2008 7:30 PM by Alvin

How am I supposed to copy the NtRights.exe program to Windows\system32?

[Aaron Margosis]  You need to be running as admin to do that.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker