Linux auditd: getcap scanning for setuid/setgid-capable files under root
Flags getcap command-line usage scanning / for Linux capability-bearing files via auditd.
- Product
- linux
- Service
- auditd
- Author
- Pawel Mazur (SigmaHQ), DRL 1.1
- Published
- 2021-11-28
- Updated
- 2026-07-31
ATT&CK techniques
Priv Esc → DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags executions of the getcap command that query with the options `-r /`, indicating a recursive scan of the root filesystem for capability-bearing files. Such discovery can help an attacker identify privilege-escalation opportunities from binaries that have elevated capabilities. It relies on Linux auditd telemetry capturing process execution events with the specific command-line arguments `getcap -r /`.
Reporting behind it
- man7.orghttps://man7.org/linux/man-pages/man8/getcap.8.html
- hackingarticles.inhttps://www.hackingarticles.in/linux-privilege-escalation-using-capabilities/
- mn3m.infohttps://mn3m.info/posts/suid-vs-capabilities/
- int0x33.medium.comhttps://int0x33.medium.com/day-44-linux-capabilities-privilege-escalation-via-openssl-with-selinux-enabled-and-enforced-74d2bec02099
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/execve/lnx_auditd_capabilities_discovery.yml
Changelog
v3- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Linux auditd: getcap scanning for setuid/setgid-capable files under root"
id: 01c8431c-1d10-449f-97c1-722daec0476a
status: test
description: This rule flags executions of the getcap command that query with the options `-r /`, indicating a recursive scan of the root filesystem for capability-bearing files. Such discovery can help an attacker identify privilege-escalation opportunities from binaries that have elevated capabilities. It relies on Linux auditd telemetry capturing process execution events with the specific command-line arguments `getcap -r /`.
references:
- https://man7.org/linux/man-pages/man8/getcap.8.html
- https://www.hackingarticles.in/linux-privilege-escalation-using-capabilities/
- https://mn3m.info/posts/suid-vs-capabilities/
- https://int0x33.medium.com/day-44-linux-capabilities-privilege-escalation-via-openssl-with-selinux-enabled-and-enforced-74d2bec02099
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/execve/lnx_auditd_capabilities_discovery.yml
author: Pawel Mazur, Huntrule Team
date: 2021-11-28
modified: 2022-12-25
tags:
- attack.discovery
- attack.privilege-escalation
- attack.t1083
- attack.t1548
logsource:
product: linux
service: auditd
detection:
selection:
type: EXECVE
a0: getcap
a1: -r
a2: /
condition: selection
falsepositives:
- Unknown
level: low
license: DRL-1.1
related:
- id: fe10751f-1995-40a5-aaa2-c97ccb4123fe
type: derived