Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

January 16, 2002 12:00 AM

Access Denied--Keeping Users from Running Unauthorized Commands

Windows IT Pro
InstantDoc ID #23658
Rating: (2)

I thought I had adequately locked down workstations to keep users from accessing the command prompt and running arbitrary commands. However, some determined users have found a way to open a command prompt. I've removed the Run command from the Start menu, deleted the command-prompt shortcut, and disabled the New Task command in Task Manager. How else can users open a command prompt or run commands?

In environments with an unruly yet savvy user base, such as colleges, you might want to lock down desktops so that users can't get into the system and cause problems, such as running unauthorized commands. Users might employ several methods to get access to a command prompt. First, however, let me explain how to configure what you've implemented so far.

Open the Microsoft Management Console (MMC) Active Directory Users and Computers snap-in, then open the Properties dialog box for the domain root. Select the Group Policy tab and edit the Default Domain Policy Group Policy Object (GPO). Changes you make here will affect all users in your domain. To limit the policies to a subset of users, define your policies in a GPO linked to the appropriate organizational unit (OU). In the GPO, maneuver to \user configuration\administrative templates\start menu and taskbar, then enable the Remove Run menu from Start Menu policy. Enabling this policy also removes the New Task command from Task Manager, and users won't be able to display the Run dialog box by pressing the Windows logo key and the R key at the same time. Although you can delete the command prompt from the Start Menu in roundabout ways, you might want to use the policy I introduce below.

One way users can still access a command prompt after the above changes is by opening Windows Explorer and double-clicking cmd.exe in the \%systemroot%\system32 folder. Or, if Microsoft Office is installed, users can open the command prompt in the Microsoft Office Shortcut Bar. However, you can use a little-known policy called Disable the command prompt that resides in the dark recesses of GPOs—in \userconfiguration\administrative templates\system. If you enable this policy, the command-prompt program (cmd.exe) will simply display the message that Figure 3 shows regardless of how users tried to open the program. Some especially crafty users might think of writing a batch file that contains the commands they originally intended to type from the command line, then simply running the batch file. You can also disable cmd.exe from running batch and command files by setting the Disable the command prompt script processing also? policy to Yes. However, note that this option will interfere with any .bat or .cmd files you've configured as logon, logoff, startup, or shutdown scripts.

Related Content:

ARTICLE TOOLS

Comments
  • Charles
    5 years ago
    Apr 04, 2007

    Another problem is this. I basically denied access to command prompt CMD.EXE through the GPO as you described but I also added command.com to DISALLOWED windows app. So even if they search adn run CMD.EXE or COMMAND.COM they get ACCESS DENIED. But guess what! The can right click desktop or in a flder and CREAT NEW... SHORTCUT and call it command and it morphs into MS-DOS shortcut. If they run the shortcut it will indeed open a DOS prompt. It get's uglier. They can then run SERVICES.MSC and others from that prompt. Now get your head around that one.

    C.

  • Anonymous User
    7 years ago
    Mar 21, 2005

    Locking down workstations is great, but makes it a pain for Admins to troubleshoot the box - How do you run IPCONFIG to check the PC if the ADMIN can't open the CMD line? Interesting delima. If you have a work-around let me know. hogankr@vvsd.org

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.