PowerShell Base64 Encoded WMI Classes

Detects calls to base64 encoded WMI class such as "Win32_ShadowCopy", "Win32_ScheduledJob", etc.

Sigma rule (View on GitHub)

 1title: PowerShell Base64 Encoded WMI Classes
 2id: 1816994b-42e1-4fb1-afd2-134d88184f71
 3related:
 4    - id: 47688f1b-9f51-4656-b013-3cc49a166a36
 5      type: obsolete
 6status: test
 7description: Detects calls to base64 encoded WMI class such as "Win32_ShadowCopy", "Win32_ScheduledJob", etc.
 8references:
 9    - https://github.com/Neo23x0/Raccine/blob/20a569fa21625086433dcce8bb2765d0ea08dcb6/yara/mal_revil.yar
10author: Christian Burkard (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
11date: 2023-01-30
12tags:
13    - attack.execution
14    - attack.t1059.001
15    - attack.defense-evasion
16    - attack.t1027
17logsource:
18    category: process_creation
19    product: windows
20detection:
21    selection_img:
22        - Image|endswith:
23              - '\powershell.exe'
24              - '\pwsh.exe'
25        - OriginalFileName:
26              - 'PowerShell.EXE'
27              - 'pwsh.dll'
28    selection_cli_shadowcopy:
29        # Win32_ShadowCopy
30        CommandLine|contains:
31            - 'VwBpAG4AMwAyAF8AUwBoAGEAZABvAHcAYwBvAHAAeQ'
32            - 'cAaQBuADMAMgBfAFMAaABhAGQAbwB3AGMAbwBwAHkA'
33            - 'XAGkAbgAzADIAXwBTAGgAYQBkAG8AdwBjAG8AcAB5A'
34            - 'V2luMzJfU2hhZG93Y29we'
35            - 'dpbjMyX1NoYWRvd2NvcH'
36            - 'XaW4zMl9TaGFkb3djb3B5'
37    selection_cli_scheduledJob:
38        # Win32_ScheduledJob
39        CommandLine|contains:
40            - 'VwBpAG4AMwAyAF8AUwBjAGgAZQBkAHUAbABlAGQASgBvAGIA'
41            - 'cAaQBuADMAMgBfAFMAYwBoAGUAZAB1AGwAZQBkAEoAbwBiA'
42            - 'XAGkAbgAzADIAXwBTAGMAaABlAGQAdQBsAGUAZABKAG8AYg'
43            - 'V2luMzJfU2NoZWR1bGVkSm9i'
44            - 'dpbjMyX1NjaGVkdWxlZEpvY'
45            - 'XaW4zMl9TY2hlZHVsZWRKb2'
46    selection_cli_process:
47        # Win32_Process
48        CommandLine|contains:
49            - 'VwBpAG4AMwAyAF8AUAByAG8AYwBlAHMAcw'
50            - 'cAaQBuADMAMgBfAFAAcgBvAGMAZQBzAHMA'
51            - 'XAGkAbgAzADIAXwBQAHIAbwBjAGUAcwBzA'
52            - 'V2luMzJfUHJvY2Vzc'
53            - 'dpbjMyX1Byb2Nlc3'
54            - 'XaW4zMl9Qcm9jZXNz'
55    selection_cli_useraccount:
56        # Win32_UserAccount
57        CommandLine|contains:
58            - 'VwBpAG4AMwAyAF8AVQBzAGUAcgBBAGMAYwBvAHUAbgB0A'
59            - 'cAaQBuADMAMgBfAFUAcwBlAHIAQQBjAGMAbwB1AG4AdA'
60            - 'XAGkAbgAzADIAXwBVAHMAZQByAEEAYwBjAG8AdQBuAHQA'
61            - 'V2luMzJfVXNlckFjY291bn'
62            - 'dpbjMyX1VzZXJBY2NvdW50'
63            - 'XaW4zMl9Vc2VyQWNjb3Vud'
64    selection_cli_loggedonuser:
65        # Win32_LoggedOnUser
66        CommandLine|contains:
67            - 'VwBpAG4AMwAyAF8ATABvAGcAZwBlAGQATwBuAFUAcwBlAHIA'
68            - 'cAaQBuADMAMgBfAEwAbwBnAGcAZQBkAE8AbgBVAHMAZQByA'
69            - 'XAGkAbgAzADIAXwBMAG8AZwBnAGUAZABPAG4AVQBzAGUAcg'
70            - 'V2luMzJfTG9nZ2VkT25Vc2Vy'
71            - 'dpbjMyX0xvZ2dlZE9uVXNlc'
72            - 'XaW4zMl9Mb2dnZWRPblVzZX'
73    condition: selection_img and 1 of selection_cli_*
74falsepositives:
75    - Unknown
76level: high

References

Related rules

to-top