
title: CobaltStrike Named Pipe Patterns
author: Florian Roth, Christian Burkard
date: 2021/07/30
description: Detects the creation of a named pipe with a pattern found in CobaltStrike
  malleable C2 profiles
detection:
  SELECTION_1:
    EventID: 17
  SELECTION_2:
    EventID: 18
  SELECTION_3:
    PipeName:
    - \mojo.5688.8052.183894939787088877*
    - \mojo.5688.8052.35780273329370473*
    - \mypipe-f*
    - \mypipe-h*
    - \ntsvcs*
    - \scerpc*
    - \win_svc*
    - \spoolss*
    - \msrpc_*
    - \win\msrpc_*
    - \wkssvc*
    - \f53f*
    - \windows.update.manager*
    - \SearchTextHarvester*
    - \DserNamePipe*
    - \PGMessagePipe*
    - \MsFteWds*
    - \f4c3*
    - \fullduplex_*
    - \rpc_*
  SELECTION_4:
    PipeName:
    - \demoagent_11
    - \demoagent_22
  SELECTION_5:
    PipeName: \Winsock2\CatalogChangeListener-*
  SELECTION_6:
    PipeName: '*-0,'
  SELECTION_7:
    PipeName:
    - \wkssvc
    - \spoolss
    - \scerpc
    - \ntsvcs
    - \SearchTextHarvester
    - \PGMessagePipe
    - \MsFteWds
  condition: ((SELECTION_1 or SELECTION_2) and ((SELECTION_3 or SELECTION_4) or (SELECTION_5
    and SELECTION_6)) and  not (SELECTION_7))
falsepositives:
- Chrome instances using the exactly same name pipe named mojo.something
id: 85adeb13-4fc9-4e68-8a4a-c7cb2c336eb7
level: high
logsource:
  category: pipe_created
  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
  product: windows
modified: 2021/08/26
references:
- https://svch0st.medium.com/guide-to-named-pipes-and-hunting-for-cobalt-strike-pipes-dc46b2c5f575
- https://gist.github.com/MHaggis/6c600e524045a6d49c35291a21e10752
status: experimental
tags:
- attack.defense_evasion
- attack.privilege_escalation
- attack.t1055
ruletype: SIGMA
