Query: Sigma rule for Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles
Matching passage: Sigma rule: Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles. Logsource: windows / pipe_created. Rule: title: CobaltStrike Named Pipe Pattern Regex id: 0e7163d4-9e19-4fa7-9be6-000c61aad77a related: - id: 85adeb13-4fc9-4e68-8a4a-c7cb2c336eb7 type: similar - id: d5601f8c-b26f-4ab0-9035-69e11a8d4ad2 type: similar status: test description: Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles references: - https://svch0st.medium.com/guide-to-named-pipes-and-hunting-for-cobalt-strike-pipes-dc46b2c5f575 - https://gist.github.com/MHaggis/6c600e524045a6d49c35291a21e10752 author: Florian Roth (Nextron Systems) date: 2021-07-30 modified: 2026-06-18 tags: - attack.privilege-escalation - attack.stealth - attack.t1055 logsource: product: windows 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 detection: selection: - PipeName|re: \\mojo\.5688\.8052\.(?:183894939787088877|35780273329370473)[0-9a-f]{2} - PipeName|re: \\wkssvc_?[0-9a-f]{2} - PipeName|re: \\ntsvcs[0-9a-f]{2} - PipeName|re: \\DserNamePipe[0-9a-f]{2} - PipeName|re: \\SearchTextHarvester[0-9a-f]{2} - PipeName|re: \\mypipe-(?:f|h)[0-9a-f]{2} - PipeName|re: \\windows\.update\.manager[0-9a-f]{2,3} - PipeName|re: \\ntsvcs_[0-9a-f]{2} - PipeName|re: \\scerpc_?[0-9a-f]{2} - PipeName|re: \\PGMessagePipe[0-9a-f]{2} - PipeName|re: \\MsFteWds[0-9a-f]{2} - PipeName|re: \\f4c3[0-9a-f]{2} - PipeName|re: \\fullduplex_[0-9a-f]{2} - PipeName|re: \\msrpc_[0-9a-f]{4} - PipeName|re: \\win\\msrpc_[0-9a-f]{2} - PipeName|re: \\f53f[0-9a-f]{2}$ - PipeName|re: \\rpc_[0-9a-f]{2} - PipeName|re: \\spoolss_[0-9a-f]{2} - PipeName|re: \\Winsock2\\CatalogChangeListener-[0-9a-f]{3}-0, condition: selection falsepositives: - Unknown level: critical
Near-miss passage: Sigma rule: Detects the usage of utilities such as 'systemctl', 'service'...etc to stop or disable tools and services on Linux syste. Logsource: linux / process_creation. Rule: title: Disable Or Stop Services id: de25eeb8-3655-4643-ac3a-b662d3f26b6b status: test description: 'Detects the usage of utilities such as ''systemctl'', ''service''...etc to stop or disable tools and services on Linux systems. Attackers may stop or disable security tools and services to evade detection, maintain persistence, or disrupt system operations. ' references: - https://www.trendmicro.com/pl_pl/research/20/i/the-evolution-of-malicious-shell-scripts.html author: Nasreddine Bencherchali (Nextron Systems) date: 2022-09-15 modified: 2025-03-18 tags: - attack.defense-impairment - attack.t1685 - attack.impact - attack.t1489 logsource: category: process_creation product: linux detection: selection: Image|endswith: - /service - /systemctl - /chkconfig CommandLine|contains: - ' stop ' - ' disable ' filter_main_legit_snapd: Image|endswith: /systemctl CommandLine|contains: - --no-reload disable snap-snapd- - ' stop snap-snapd-' filter_main_ssh_preinstall: Image|endswith: /systemctl ParentCommandLine|contains: tmp.ci/preinst upgrade CommandLine|contains|all: - ' stop ' - ssh. filter_main_ubuntu_upgrade: ParentCommandLine|contains: /dpkg/info/ubuntu-pro-client.prerm upgrade Image|endswith: /systemctl filter_optional_aws_agent: Image|endswith: /systemctl CommandLine|endswith: snap.amazon-ssm-agent.amazon-ssm-agent.service condition: selection and not 1 of filter_main_* and not 1 of filter_optional_* falsepositives: - Legitimate administration activities - Some false positives are to be expected. Apply additional filters as needed before pushing to production. level: medium