Recommended Posts

Hi everyone

Here's the situation - a stand alone laptop (connected to ADSL via a router) with XP Pro SP2, CD/DVD and floppy attached, along with 2 USB 2.0 ports.

I would like to restrict users from accessing the command screen. I know that I can take <Run> from the Start menu and I can set the permissions of cmd.exe so that only Administrators can use it, but what if someone had a copy of cmd.exe on a floppy, CD or USB memory stick? Users need access to USB or floppy so disabling these (along with the CD) is not an option.

Basically, I'd like to prevent limited users from running cmd.exe, *whatever the source* of the file (i.e. they could e-mail a copy to themself). Can this be done? A lot of harm (and prying) can be done from the command screen and I'd like to prevent it. The situation is a stand alone at present, but I may increase the number of PCs to a small home network behing the router or a hub. I doubt that I'd get to the state of a large network with a server, MS Server 2003 etc.

Thank you for your time.

Link to comment
https://www.neowin.net/forum/topic/454369-prevent-users-from-using-cmdexe/
Share on other sites

  John said:

You can set permissions on cmd.exe itself (Y)

Yes, but that wouldn't stop a Limited user having a copy on a floppy or USB memory stick, or e-mailing another copy of cmd.exe to himself, would it?

I've been thinking about the earlier option of using a registry tweak, for instance DisallowRun or RestrictRun. If a user had another copy of cmd.exe (as above) and renamed it, I suspect that neither of these registry tweaks would prevent it from running.

I just wonder if cmd.exe accesses some other file(s) (such as a .dll) and, if so, would altering the permission of that file help in any way? I'm thinking aloud now.

This can be done through Group Policy. Click Start and then click run and type:"gpedit.msc" without quotes to launch Group Policy. Click System under Administrative Templates in User Configuration on the left pane and select "Prevent access to the command prompt" in the main window. Click on "Enabled" and then click OK and close Group Policy.

EDIT: betasp was faster than me.

Thanks to both of you. It works fine, bringing up the command screen and it gives a warning that the Administrator has disabled it (whether I'm logged in with Limited or Administrative privileges). However, is it possible to still allow someone with Administrative privileges access to it? I guess that I could go back into GPE, reset it, do what I have to with cmd.exe and then disable it again but that seems a bit fiddly. I'm not sure just how bespoke Policies can be and how I'd set it exactly as I'd need.

Personally I would just disable cmd full stop on the machine and use an alternative command line processor which isnt subject to such restrictions, however that wont stop your errant users accessing a similar utility. It might just delay them slightly if theyre not so techical.

  Tosca said:

Thanks to both of you. It works fine, bringing up the command screen and it gives a warning that the Administrator has disabled it (whether I'm logged in with Limited or Administrative privileges). However, is it possible to still allow someone with Administrative privileges access to it? I guess that I could go back into GPE, reset it, do what I have to with cmd.exe and then disable it again but that seems a bit fiddly. I'm not sure just how bespoke Policies can be and how I'd set it exactly as I'd need.

With the modification I suggested you, all users including those with administrative privileges can't use CMD.EXE, with the exception of Administrator. If you want to use CMD.EXE and have modified Group Policy as I suggested you, open Start menu, click "All Programs", navigate to "Command Prompt" then right click it and select "Run as..." from context menu. A new window will open: From here you can run CMD as Administrator providing you know the password.

Edited by MPH

That's great. In a way, I'm a little surprised that a Policy can't be set to do what I want. I was under the impression that the Group Policy Editor could be very flexible in creating Policies to fit with required circumstances. The suggestion that you've made regarding running it as Administrator works well.

I just came across command.com on my PC which works similar to cmd. I've not tried it yet, but I *hope* that the setting in Group Policy will disable this too. If not, I dare say that I'll be back asking if that can be disabled!

Thank you.

I prefer to avoid third party software. I understand that bespoke policies can be set, but I don't know how. It's a very powerful utility so, rather than floundering, can you give me a nudge in the right direction about setting a policy specifically to prevent command.com from running?

I've done some googling and have come across Software Restriction Policy (SRP). There are several ways to implement this - one uses the MD5 hash of the file. I think this should allow me to authorise only an Admin user to run command.com. I don't think there's any way to prevent a "foreign" copy of command.com or some other command.com-like utility being run.

I suppose the other way around is to set SRP, based upon the MD5 hash, of those files to which I wish to grant a Limited user access. Everything else would be set to Deny for this group. I anticipate that this would prevent their using extenal applications, running batch files etc. I'm thinking aloud here so will have to try it to see how it works.

You really don't want people running a command window, huh? ;)

Consider the implications of restricting ALL programs except the ones you specify... A command prompt itself isn't that dangerous. The only thing you can do with it is launch other programs, and you're better off restricting those programs instead of the command prompt.

You can do a lot of damage with cmd.exe .

A lot of things that are restricted in the windows gui are not using cmd.exe.

I use software restriction policies on my network at work.

I dont go as bad as using hashes but I just block the exe. I use it to block chat and p2p programs.

I say try it its great.

Yes, but you're doing it differently from what he's suggesting. You block certain programs and allow everything else not specified. He's talking about blocking everything by default and specifying programs to allow. That list would fill up rather quickly.

^ if you are going to do that, besure that you set the program that you are using to be able to run... i did that once back in the day using Windows 98SE's "system policy editor" ... it was VERY powerful and i forgot to set it to run "poledit.exe" which was the name of that program... and then i couldnt run that program anymore in order to change settings, so i was stuck, lol.

  majortom1981 said:

You can do a lot of damage with cmd.exe. ........ I dont go as bad as using hashes but I just block the exe. I use it to block chat and p2p programs.

I know that command.com and cmd.exe aren't identical, but I want to be able to block both. I'm not keen on users, for instance, accessing any network commands.

I've not looked at simply blocking the .exe as you suggest. How exactly do you go about blocking chat and p2p programs?

  mujjuman said:

^ if you are going to do that, besure that you set the program that you are using to be able to run... i did that once back in the day using Windows 98SE's "system policy editor" ... it was VERY powerful and i forgot to set it to run "poledit.exe" which was the name of that program... and then i couldnt run that program anymore in order to change settings, so i was stuck, lol.

<LOL> I'd already thought about that - I'd be sure to leave myself a backdoor to apps such as gpedit.msc, regedit, cmd.exe, command.com etc.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Thanks to Herr Musk being a total poison pill, they can't even give those pieces of scrap away.  They can't even ship them to the UK/EU because they're completely illegal over here.  
    • Intel vs AMD? Microsoft seemingly has a clear recommendation for Windows 11 Pro PC upgrade by Sayan Sen Microsoft and its partners are now quite actively and regularly promoting the upgrade to Windows 11. Asus, for example, recently published blog posts about the "mandatory Windows 11 upgrade" that is coming as the Windows 11 end of support date nears. Microsoft itself, from time to time, urges users to upgrade to its newest OS. Back in February 2024, Microsoft released an advert highlighting the best things about Windows 11 over Windows 10. Later, in June in the same year, the tech giant busted "myths and misconceptions" surrounding a Windows 11 upgrade. And towards the end of 2024, in December, Microsoft put up a blog post outlining the gaming features a user enjoys on 11 if they were to upgrade from Windows 10. While technically there is nothing wrong with a company promoting its own product, sometimes these campaigns make little sense and they fall flat. For example, in January earlier this year, Microsoft shared a blog post headlined "Free Upgrade to Windows 11 (For a Limited Time Only)" which did not make sense as it offered little information about it being a "free upgrade," and it was rightfully, later taken down. The company is back again with a new commercial about Windows 11. This time it is aimed mainly at IT professionals and enterprises as the advert talks about upgrading to Windows 11 Pro from Windows 10. This landed a few days after Microsoft released a new backup tool for organizations for such a purpose. What is interesting is that the company is promoting Intel's vPro processors and there is no mention of AMD's Ryzen PRO parts. The commercial is posted on the Windows official YouTube channel and has been titled "Right side of risk | Windows 11 Pro and Intel". The video description says, "Windows 10 support ends October 14. Stay on the right side of risk—upgrade now to the power of Windows 11 Pro PCs with Intel vPro®." AMD does have a support article about the subject headlined "Support Your Customers’ Move to Windows 11, With AMD Ryzen™ PRO Processors" and you can find it here. This is not the first time Microsoft has promoted Intel CPUs over AMD ones. Back in 2021, the company also put up a full page explaining how users should "look for the Intel EVO badge" on a new device before making a purchase decision because such PCs are "verified wonderful" which was a bit of an odd language. Like the limited upgrade time article, the page above was taken down after we reported on it (can be viewed via the archive) and replaced with something else. The new commercial was published about a couple of days ago, and it is possible that Microsoft may have a dedicated AMD advert too in the pipeline scheduled for a later release, and that would only be fair if both companies get a similar treatment.
    • Don’t blame web developers for the downfall of Firefox. 😂
    • Microsoft, Indian police bust AI-powered tech support scam ring targeting elderly in Japan by Paul Hill Pop-up scams pretending to be Microsoft Working with India’s Central Bureau of Investigation (CBI), Microsoft recently assisted in busting a scam network that was targeting the elderly in Japan. The CBI raided 19 locations on May 28, leading to the arrest of six key operatives and the taking down of two call centers. The scammers were impersonating Microsoft specifically and using tech support scams against Japanese seniors. The raid led to the seizure of both digital and physical infrastructure, including computers, storage devices, and phones. The scammers were targeting older adults, who are more vulnerable to fraud. To put this activity to an end, Microsoft’s Digital Crimes Unit (DCU), the Japan Cybercrime Control Center (JC3), Japan’s National Police Agency (NPA), and India’s CBI conducted significant cross-border collaboration to trace the criminals. Thanks to the internet, cross-border crimes like these have been around for a while and multinational tech firms like Microsoft are making significant efforts to help law enforcement agencies crack down on cybercrime. Artificial intelligence is also starting to be used to make more sophisticated scams. The evolving threat This case reveals an evolution in how Microsoft’s DCU addresses cybercrime involving tech support fraud. Thanks to AI, scammers have been able to scale their operations. In response, Microsoft has moved away from focusing on individual call centers to target the heads of criminal operations and disrupting their technical infrastructure. Notably, Microsoft’s collaboration with JC3 is the first time the DCU has partnered with a Japan-based organization to assist victims. Microsoft is continually getting tips from JC3 about malicious pop-ups urging recipients to call fake technical support lines that claim to be Microsoft. This data has allowed Microsoft to shut down 66,000 malicious domains and URLs globally since May 2024. Microsoft noted that artificial intelligence is now being used by criminals to scale their operations. Some ways in which these entities leverage AI are for victim identification, writing convincing scam emails and building fake web pages, as well as for convincing translations. Anyone can use AI for malicious purposes so it could increase the number of people or groups carrying out attacks. It also makes attacks much more sophisticated and harder to detect and necessitates better consumer protections and more sophisticated security tools such as passkeys to reduce hacks. Protecting vulnerable populations and what readers can do Tech support fraud attacks have been found by the FBI to disproportionately affect older people, resulting in $590 million in losses in 2023 for just older Americans alone. In this operation that targeted Japanese victims, around 90% of the 200 affected people were over 50. If you’ve ever received suspicious communications from a party claiming to be Microsoft, you should know that Microsoft never sends unsolicited emails or makes phone calls requesting personal or financial information, and it doesn’t offer unsolicited tech support. If you do get any suspicious communications, then you should report it to Microsoft so that it can take action.
  • Recent Achievements

    • Week One Done
      luxoxfurniture earned a badge
      Week One Done
    • First Post
      Uranus_enjoyer earned a badge
      First Post
    • Week One Done
      Uranus_enjoyer earned a badge
      Week One Done
    • Week One Done
      jfam earned a badge
      Week One Done
    • First Post
      survivor303 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      434
    2. 2
      +FloatingFatMan
      238
    3. 3
      snowy owl
      214
    4. 4
      ATLien_0
      211
    5. 5
      Xenon
      156
  • Tell a friend

    Love Neowin? Tell a friend!