process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.name == "mkdir" and process.parent.executable like (
"/dev/shm/*", "/tmp/*", "/var/tmp/*", "/var/run/*", "/root/*", "/boot/*", "/var/www/html/*", "/opt/.*"
) and process.args like (".*", "/*/.*") and process.args_count <= 3 and not (
process.parent.executable like ("/tmp/newroot/*", "/run/containerd/*") or
process.command_line like ("mkdir -p .", "mkdir ./*") or
process.parent.executable like (
"/tmp/pear/temp/*", "/var/tmp/buildah*", "/tmp/python-build.*", "/tmp/cliphist-wofi-img"
)
)
Install detection rules in Elastic Security
Detect Hidden Directory Creation via Unusual Parent 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).