Powershell XML Execute Command

Adversaries may abuse PowerShell commands and scripts for execution. PowerShell is a powerful interactive command-line interface and scripting environment included in the Windows operating system. (Citation: TechNet PowerShell) Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code

Sigma rule (View on GitHub)

 1title: Powershell XML Execute Command
 2id: 6c6c6282-7671-4fe9-a0ce-a2dcebdc342b
 3status: test
 4description: |
 5    Adversaries may abuse PowerShell commands and scripts for execution.
 6    PowerShell is a powerful interactive command-line interface and scripting environment included in the Windows operating system. (Citation: TechNet PowerShell)
 7    Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code    
 8references:
 9    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1059.001/T1059.001.md#atomic-test-8---powershell-xml-requests
10author: frack113
11date: 2022-01-19
12modified: 2023-01-19
13tags:
14    - attack.execution
15    - attack.t1059.001
16logsource:
17    product: windows
18    category: ps_script
19    definition: 'Requirements: Script Block Logging must be enabled'
20detection:
21    selection_xml:
22        ScriptBlockText|contains|all:
23            - 'New-Object'
24            - 'System.Xml.XmlDocument'
25            - '.Load'
26    selection_exec:
27        ScriptBlockText|contains:
28            - 'IEX '
29            - 'Invoke-Expression '
30            - 'Invoke-Command '
31            - 'ICM -'
32    condition: all of selection_*
33falsepositives:
34    - Legitimate administrative script
35level: medium

References

Related rules

to-top