Meterpreter or Cobalt Strike Getsystem Service Installation - System

Detects the use of getsystem Meterpreter/Cobalt Strike command by detecting a specific service installation

Sigma rule (View on GitHub)

 1title: Meterpreter or Cobalt Strike Getsystem Service Installation - System
 2id: 843544a7-56e0-4dcc-a44f-5cc266dd97d6
 3status: test
 4description: Detects the use of getsystem Meterpreter/Cobalt Strike command by detecting a specific service installation
 5references:
 6    - https://speakerdeck.com/heirhabarov/hunting-for-privilege-escalation-in-windows-environment
 7    - https://blog.cobaltstrike.com/2014/04/02/what-happens-when-i-type-getsystem/
 8author: Teymur Kheirkhabarov, Ecco, Florian Roth (Nextron Systems)
 9date: 2019-10-26
10modified: 2023-11-15
11tags:
12    - attack.defense-evasion
13    - attack.privilege-escalation
14    - attack.t1134.001
15    - attack.t1134.002
16logsource:
17    product: windows
18    service: system
19detection:
20    selection_id:
21        Provider_Name: 'Service Control Manager'
22        EventID: 7045
23    selection_cli_cmd:
24        # meterpreter getsystem technique 1: cmd.exe /c echo 559891bb017 > \\.\pipe\5e120a
25        # cobaltstrike getsystem technique 1: %COMSPEC% /c echo 559891bb017 > \\.\pipe\5e120a
26        # cobaltstrike getsystem technique 1b (expanded %COMSPEC%): %COMSPEC% /c echo 559891bb017 > \\.\pipe\5e120a
27        ImagePath|contains|all:
28            - '/c'
29            - 'echo'
30            - '\pipe\'
31        ImagePath|contains:
32        - 'cmd'
33        - '%COMSPEC%'
34    selection_cli_rundll:
35        # meterpreter getsystem technique 2: rundll32.exe C:\Users\test\AppData\Local\Temp\tmexsn.dll,a /p:tmexsn
36        ImagePath|contains|all:
37            - 'rundll32'
38            - '.dll,a'
39            - '/p:'
40    selection_cli_share:
41        ImagePath|startswith: '\\\\127.0.0.1\\ADMIN$\'  # https://twitter.com/svch0st/status/1413688851877416960?lang=en
42    condition: selection_id and 1 of selection_cli_*
43falsepositives:
44    - Unlikely
45level: high

References

Related rules

to-top