Detects suspicious PowerShell invocation command parameters
title: Suspicious PowerShell Invocations - Specific - ProcessCreation
id: 536e2947-3729-478c-9903-745aaffe60d2
related:
- id: fce5f582-cc00-41e1-941a-c6fabf0fdb8c
type: obsolete
- id: ae7fbf8e-f3cb-49fd-8db4-5f3bed522c71
type: similar
- id: 8ff28fdd-e2fa-4dfa-aeda-ef3d61c62090
type: similar
status: test
description: Detects suspicious PowerShell invocation command parameters
references:
- Internal Research
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-01-05
tags:
- attack.stealth
logsource:
category: process_creation
product: windows
detection:
selection_convert_b64:
CommandLine|contains|all:
- '-nop'
- ' -w '
- 'hidden'
- ' -c '
- '[Convert]::FromBase64String'
selection_iex:
CommandLine|contains|all:
- ' -w '
- 'hidden'
- '-noni'
- '-nop'
- ' -c '
- 'iex'
- 'New-Object'
selection_enc:
CommandLine|contains|all:
- ' -w '
- 'hidden'
- '-ep'
- 'bypass'
- '-Enc'
selection_reg:
CommandLine|contains|all:
- 'powershell'
- 'reg'
- 'add'
- '\software\'
selection_webclient:
CommandLine|contains|all:
- 'bypass'
- '-noprofile'
- '-windowstyle'
- 'hidden'
- 'new-object'
- 'system.net.webclient'
- '.download'
selection_iex_webclient:
CommandLine|contains|all:
- 'iex'
- 'New-Object'
- 'Net.WebClient'
- '.Download'
filter_chocolatey:
CommandLine|contains:
- "(New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1"
- 'Write-ChocolateyWarning'
condition: 1 of selection_* and not 1 of filter_*
falsepositives:
- Unknown
level: medium
imProcessCreate
| where ((TargetProcessCommandLine contains "-nop" and TargetProcessCommandLine contains " -w " and TargetProcessCommandLine contains "hidden" and TargetProcessCommandLine contains " -c " and TargetProcessCommandLine contains "[Convert]::FromBase64String") or (TargetProcessCommandLine contains " -w " and TargetProcessCommandLine contains "hidden" and TargetProcessCommandLine contains "-noni" and TargetProcessCommandLine contains "-nop" and TargetProcessCommandLine contains " -c " and TargetProcessCommandLine contains "iex" and TargetProcessCommandLine contains "New-Object") or (TargetProcessCommandLine contains " -w " and TargetProcessCommandLine contains "hidden" and TargetProcessCommandLine contains "-ep" and TargetProcessCommandLine contains "bypass" and TargetProcessCommandLine contains "-Enc") or (TargetProcessCommandLine contains "powershell" and TargetProcessCommandLine contains "reg" and TargetProcessCommandLine contains "add" and TargetProcessCommandLine contains "\\software\\") or (TargetProcessCommandLine contains "bypass" and TargetProcessCommandLine contains "-noprofile" and TargetProcessCommandLine contains "-windowstyle" and TargetProcessCommandLine contains "hidden" and TargetProcessCommandLine contains "new-object" and TargetProcessCommandLine contains "system.net.webclient" and TargetProcessCommandLine contains ".download") or (TargetProcessCommandLine contains "iex" and TargetProcessCommandLine contains "New-Object" and TargetProcessCommandLine contains "Net.WebClient" and TargetProcessCommandLine contains ".Download")) and (not((TargetProcessCommandLine contains "(New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1" or TargetProcessCommandLine contains "Write-ChocolateyWarning")))
| Sentinel Table | Notes |
|---|---|
imProcessCreate | Ensure this data connector is enabled |