Elevated System Shell Spawned From Uncommon Parent Location

Detects when a shell program such as the Windows command prompt or PowerShell is launched with system privileges from a uncommon parent location.

Sigma rule (View on GitHub)

 1title: Elevated System Shell Spawned From Uncommon Parent Location
 2id: 178e615d-e666-498b-9630-9ed363038101
 3related:
 4    - id: 61065c72-5d7d-44ef-bf41-6a36684b545f
 5      type: similar
 6status: test
 7description: Detects when a shell program such as the Windows command prompt or PowerShell is launched with system privileges from a uncommon parent location.
 8references:
 9    - https://github.com/Wh04m1001/SysmonEoP
10author: frack113, Tim Shelton (update fp)
11date: 2022-12-05
12modified: 2025-03-06
13tags:
14    - attack.privilege-escalation
15    - attack.execution
16    - attack.t1059
17logsource:
18    product: windows
19    category: process_creation
20detection:
21    selection_shell:
22        - Image|endswith:
23              - '\powershell.exe'
24              - '\powershell_ise.exe'
25              - '\pwsh.exe'
26              - '\cmd.exe'
27        - OriginalFileName:
28              - 'PowerShell.EXE'
29              - 'powershell_ise.EXE'
30              - 'pwsh.dll'
31              - 'Cmd.Exe'
32    selection_user:
33        User|contains: # covers many language settings
34            - 'AUTHORI'
35            - 'AUTORI'
36        LogonId: '0x3e7'
37    filter_main_generic:
38        # Example 1:
39        #   C:\Program Files\erl-23.2\erts-11.1.4\bin\erl.exe" -service_event ErlSrv_RabbitMQ -nohup -sname rabbit@localhost -s rabbit boot -boot start_sasl +W w +MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30 +P 1048576 +t 5000000 +stbt db +zdbbl 128000 +sbwt none +sbwtdcpu none +sbwtdio none -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672 -lager crash_log false -lager handlers []
40        # Example 2:
41        #   ParentImage: C:\Program Files (x86)\Varonis\DatAdvantage\GridCollector\VrnsRealTimeAlertsSvc.exe" /appid 000000ad-cb03-500b-9459-c46d000000ad
42        #   CommandLine: C:\Windows\system32\cmd.exe /c C:\Program Files "(x86)\Varonis\DatAdvantage\GridCollector\handle_scopes.cmd C:\Collector" Working Share\VaronisWorkDirectoryCollector
43        ParentImage|contains:
44            - ':\Program Files (x86)\'
45            - ':\Program Files\'
46            - ':\ProgramData\'
47            - ':\Windows\System32\'
48            - ':\Windows\SysWOW64\'
49            - ':\Windows\Temp\' # Installers
50            - ':\Windows\WinSxS\'
51    filter_optional_manageengine:
52        # Example:
53        #   ParentImage: C:/ManageEngine/ADManager Plus/pgsql/bin/postgres.exe" --forkarch 5380
54        #   CommandLine: C:\Windows\system32\cmd.exe /c "IF EXIST archive.bat (archive.bat pg_wal\000000010000008E000000EA 000000010000008E000000EA)
55        ParentImage|endswith: ':\ManageEngine\ADManager Plus\pgsql\bin\postgres.exe'
56        Image|endswith: '\cmd.exe'
57    filter_optional_asgard:
58        CommandLine|contains: ':\WINDOWS\system32\cmd.exe /c "'
59        CurrentDirectory|contains: ':\WINDOWS\Temp\asgard2-agent\'
60    filter_optional_ibm_spectrumprotect:
61        ParentImage|contains: ':\IBM\SpectrumProtect\webserver\scripts\'
62        CommandLine|contains: ':\IBM\SpectrumProtect\webserver\scripts\'
63    filter_main_parent_null:
64        ParentImage: null
65    filter_main_parent_empty:
66        ParentImage:
67            - ''
68            - '-'
69    condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*
70falsepositives:
71    - Some legitimate applications may spawn shells from uncommon parent locations. Apply additional filters and perform an initial baseline before deploying.
72level: medium

References

Related rules

to-top