Non Interactive PowerShell Process Spawned

Last updated on:

About the rule

Rule Type

Standard

Rule Description

Detects non-interactive PowerShell activity by looking at the "powershell" process with a non-user GUI process such as "explorer.exe" as a parent.

Severity

Attention

Rule Requirement

Criteria

Action1: actionname = "Process started" AND (PROCESSNAME endswith "\powershell.exe,\pwsh.exe" OR ORIGINALFILENAME = "PowerShell.EXE,pwsh.dll") AND (PARENTPROCESSNAME notendswith ":\Windows\explorer.exe,:\Windows\System32\CompatTelRunner.exe,:\Windows\SysWOW64\explorer.exe" AND PARENTPROCESSNAME != ":\$WINDOWS.~BT\Sources\SetupHost.exe") AND ((PARENTPROCESSNAME notendswith "\AppData\Local\Programs\Microsoft VS Code\Code.exe" OR PARENTPROCESSCOMMANDLINE notcontains " --ms-enable-electron-run-as-node ") AND (PARENTPROCESSNAME notcontains ":\Program Files\WindowsApps\Microsoft.WindowsTerminal_" OR PARENTPROCESSNAME notendswith "\WindowsTerminal.exe")) select Action1.HOSTNAME,Action1.MESSAGE,Action1.COMMANDLINE,Action1.FILE_NAME,Action1.PROCESSNAME,Action1.USERNAME,Action1.PARENTPROCESSNAME

Detection

Execution Mode

realtime

Log Sources

Windows

Author

Roberto Rodriguez @Cyb3rWard0g (rule), oscd.community (improvements)