CobaltStrike Named Pipe Pattern Regex

Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles

Sigma rule (View on GitHub)

 1title: CobaltStrike Named Pipe Pattern Regex
 2id: 0e7163d4-9e19-4fa7-9be6-000c61aad77a
 3related:
 4    - id: 85adeb13-4fc9-4e68-8a4a-c7cb2c336eb7 # Patterns
 5      type: similar
 6    - id: d5601f8c-b26f-4ab0-9035-69e11a8d4ad2 # Generic
 7      type: similar
 8status: test
 9description: Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles
10references:
11    - https://svch0st.medium.com/guide-to-named-pipes-and-hunting-for-cobalt-strike-pipes-dc46b2c5f575
12    - https://gist.github.com/MHaggis/6c600e524045a6d49c35291a21e10752
13author: Florian Roth (Nextron Systems)
14date: 2021-07-30
15modified: 2022-12-31
16tags:
17    - attack.defense-evasion
18    - attack.privilege-escalation
19    - attack.t1055
20logsource:
21    product: windows
22    category: pipe_created
23    definition: 'Note that you have to configure logging for Named Pipe Events in Sysmon config (Event ID 17 and Event ID 18). The basic configuration is in popular sysmon configuration (https://github.com/SwiftOnSecurity/sysmon-config), but it is worth verifying. You can also use other repo, e.g. https://github.com/Neo23x0/sysmon-config, https://github.com/olafhartong/sysmon-modular You can also use other repo, e.g. https://github.com/Neo23x0/sysmon-config, https://github.com/olafhartong/sysmon-modular. How to test detection? You can always use Cobalt Strike, but also you can check powershell script from this site https://svch0st.medium.com/guide-to-named-pipes-and-hunting-for-cobalt-strike-pipes-dc46b2c5f575'
24detection:
25    selection:
26        - PipeName|re: '\\mojo\.5688\.8052\.(?:183894939787088877|35780273329370473)[0-9a-f]{2}'
27        - PipeName|re: '\\wkssvc_?[0-9a-f]{2}'
28        - PipeName|re: '\\ntsvcs[0-9a-f]{2}'
29        - PipeName|re: '\\DserNamePipe[0-9a-f]{2}'
30        - PipeName|re: '\\SearchTextHarvester[0-9a-f]{2}'
31        - PipeName|re: '\\mypipe-(?:f|h)[0-9a-f]{2}'
32        - PipeName|re: '\\windows\.update\.manager[0-9a-f]{2,3}'
33        - PipeName|re: '\\ntsvcs_[0-9a-f]{2}'
34        - PipeName|re: '\\scerpc_?[0-9a-f]{2}'
35        - PipeName|re: '\\PGMessagePipe[0-9a-f]{2}'
36        - PipeName|re: '\\MsFteWds[0-9a-f]{2}'
37        - PipeName|re: '\\f4c3[0-9a-f]{2}'
38        - PipeName|re: '\\fullduplex_[0-9a-f]{2}'
39        - PipeName|re: '\\msrpc_[0-9a-f]{4}'
40        - PipeName|re: '\\win\\msrpc_[0-9a-f]{2}'
41        - PipeName|re: '\\f53f[0-9a-f]{2}'
42        - PipeName|re: '\\rpc_[0-9a-f]{2}'
43        - PipeName|re: '\\spoolss_[0-9a-f]{2}'
44        - PipeName|re: '\\Winsock2\\CatalogChangeListener-[0-9a-f]{3}-0,'
45    condition: selection
46falsepositives:
47    - Unknown
48level: critical

References

Related rules

to-top