host.os.type : "linux" and event.category : "process" and event.action : ("exec" or "exec_event") and
(process.args : "/etc/shadow" or (process.working_directory: "/etc" and process.args: "shadow")) and not (
(process.executable : ("/bin/chown" or "/usr/bin/chown") and process.args : "root:shadow") or
(process.executable : ("/bin/chmod" or "/usr/bin/chmod") and process.args : "640") or
process.executable:(/vz/* or /var/lib/docker/* or /run/containerd/* or /tmp/.criu* or /tmp/newroot/*) or
process.parent.name:(gen_passwd_sets or scc_* or wazuh-modulesd)
)
Install detection rules in Elastic Security
Detect Potential Shadow File Read via Command Line Utilities in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).