r/PowerShell • • 27d ago

Question Are Get-CimInstance and sc.exe query safe native Windows commands? Can they download malware or steal data?

Hi everyone, I'm feeling a bit anxious and need some reassurance.

I recently ran these two commands in PowerShell/CMD:

  • Get-CimInstance
  • sc.exe query ...

I didn't download anything from the internet or run any external scripts, but now I'm overthinking and worrying if these built-in commands could somehow connect to the internet, download a stealer, or compromise my Steam account.

Can these native Windows commands access the web or steal data on their own, or are they completely local and safe? I already ran a Malwarebytes scan and it came back clean, but my anxiety is acting up. Thanks for any clarification!

Used Ai because I am not very good at English

0 Upvotes

18 comments sorted by

8

u/JSChronicles 27d ago

I'm not sure what you're asking? These are built-in native commands for powershell made by Microsoft or the exe that is made by Microsoft so I'm not sure why you're worried about them by themselves.

What you should be worried about is you not understanding and running commands given to you by someone else

1

u/Rosjkor 27d ago

Thanks! I got a bit overly anxious because I don't usually work with PowerShell commands and wasn't sure what they did under the hood. Appreciate the fast response!

5

u/MaxFrost 27d ago

Both of those commands are read-only commands - they're just querying information off of your PC.

Get-CimInstance can interop with a significant portion of the .net interfaces across windows, and is usually used for pulling system information.

sc.exe is used for interacting with services. sc.exe query would just be checking service state.

1

u/Rosjkor 27d ago

Thank you, that explains a lot and really helps! What about the findstr command?

1

u/SilentPatchSniper 27d ago

Looks for a line of text based on what you filter for in the command

1

u/Rosjkor 27d ago

Awesome, that makes total sense. So it's basically just a text filter. Thank you for taking the time to explain everything, I feel much better now!

5

u/PinchesTheCrab 27d ago

Just a sidenote, win32_product is effectively not read-only even with get-ciminstance.

5

u/MaxFrost 27d ago

Aye, but that's because win32_product is stupid, not because Get-CimInstance deliberately does that.

3

u/PinchesTheCrab 27d ago

Absolutely

3

u/DragonspeedTheB 27d ago

Just to clarify sc.exe is not a powershell command. It is a WINDOWS (DOS) native binary to interact with the windows service manager.

1

u/Rosjkor 27d ago

Oh, I didn't know, I'll find out, thanks.

2

u/ron3090 27d ago

Why these two command specifically? If you haven't used PowerShell before, what are you trying to use them for?

1

u/Rosjkor 27d ago

I was trying to find and completely remove the FACEIT anti-cheat drivers. I asked Claude AI for help, and it generated these commands for me to run in PowerShell.

1

u/ron3090 27d ago

Although the commands you've asked about are read-only, uninstalling anything manually is dangerous and can damage your operating system. Please do not use Claude for that. You should be able to uninstall it just like any other Windows program through the Programs & Features control panel (or whatever it's called in Windows 11).

1

u/Rosjkor 27d ago

Got it, thank you for the advice! I won't do that manually anymore. And thanks again for reassuring me about those commands being read-only!

1

u/Rosjkor 26d ago

I entered these commands :

Get-CimInstance Win32_SystemDriver | Where-Object { $_.Name -like "*faceit*" -or $_.DisplayName -like "*faceit*" }⁠
⁠sc.exe query faceit⁠
⁠sc.exe query | findstr /i "faceit"⁠

2

u/1RedOne 27d ago

There are commands that could go out to the web, like irm, invoke-rest method, or iwr, invoke-webrequst or also wget or curl which are now also bundled in windows

But invoke ciminstance shouldn’t be dangerous but it really depends on the full command, give us that and we’ll tell you