Linux sudoers persistence via /etc/sudoers or /etc/sudoers.d file changes
Alerts on file changes in /etc/sudoers.d/ that may indicate persistence via sudo privilege policy.
- Product
- linux
- Category
- file_event
- Author
- Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2022-07-05
- Updated
- 2026-09-24
ATT&CK techniques
Priv Esc → Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags file creation or modification events for the main /etc/sudoers file and any file under the /etc/sudoers.d/ directory on Linux. Changes to sudoers configuration can enable attackers to run commands with elevated privileges without interactive password prompts. The detection relies on Linux file event telemetry that records the target filename, excluding a specific dpkg-related temporary sudoers.d README.dpkg-new path.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-09-24
- 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 sudoers persistence via /etc/sudoers or /etc/sudoers.d file changes
id: 7b275a20-6cd2-4fe0-84ad-58c939259740
status: test
description: This rule flags file creation or modification events for the main /etc/sudoers file and any file under the /etc/sudoers.d/ directory on Linux. Changes to sudoers configuration can enable attackers to run commands with elevated privileges without interactive password prompts. The detection relies on Linux file event telemetry that records the target filename, excluding a specific dpkg-related temporary sudoers.d README.dpkg-new path.
references:
- https://www.sudo.ws/docs/man/sudoers.man/
- https://github.com/h3xduck/TripleCross/blob/1f1c3e0958af8ad9f6ebe10ab442e75de33e91de/apps/deployer.sh
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/file_event/file_event_lnx_persistence_sudoers_files.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2022-07-05
modified: 2026-08-15
tags:
- attack.privilege-escalation
- attack.persistence
- attack.t1548.003
logsource:
product: linux
category: file_event
detection:
selection:
- TargetFilename: /etc/sudoers
- TargetFilename|startswith: /etc/sudoers.d/
filter_main_dpkg:
Image|endswith: /usr/bin/dpkg
TargetFilename: /etc/sudoers.d/README.dpkg-new
condition: selection and not 1 of filter_main_*
falsepositives:
- Legitimate sudoers changes by administrators or configuration-management tools
level: medium
license: DRL-1.1
related:
- id: ddb26b76-4447-4807-871f-1b035b2bfa5d
type: derived