Potential Proxy Execution via Run-parts
Description
This rule detects the execution of a command or binary through the run-parts binary. Run-parts is a utility that runs all the executable files in a directory. Attackers may use this technique to execute binaries while attempting to evade detection.
Query · eql
process where event.type == "start" and event.action == "exec" and process.parent.name == "run-parts" and
process.parent.command_line like ("/*run-parts *", "run-parts *") and process.parent.args_count < 3 and not (
process.executable : (
"/usr/lib/*", "/ns/*", "/var/lib/docker/overlay2/*", "/vz/*", "/run/containerd/*", "/etc/*", "/data/docker/*",
"/home/*/docker/overlay2/*", "/usr/share/*", "/usr/bin/*", "/bin/*", "/usr/sbin/*", "/sbin/*", "/tmp/newroot/*"
) or
process.name in (
"su", "logger", "avahi-daemon", "sendmail", "avahi-daemon-check-dns.sh", "grub-mkconfig", "initramfs-tools",
"apt-auto-removal", "uninvention-policy-result", "unattended-upgrades", "post-update.d/proxmox-boot-sync",
"zz-proxmox-boot", "flash-kernel", "mdadm.finalrd", "dkms_autoinstaller", "frontend", "update-grub-legacy-ec2",
"runwsgi"
) or
process.args : (
"/etc/network/if-*", "/etc/cron.hourly/0anacron", "/etc/resolvconf/update-libc.d/postfix", "/etc/ssl/certs",
"/etc/ca-certificates/update.d/certhash"
) or
process.parent.args : (
"/etc/cron*", "/etc/update-motd.d/*", "/etc/ca-certificates/update.d/*", "/ns/sbin/*", "/etc/periodic/*",
"/ns/bin/*", "/opt/local/cron/periodic/*", "/etc/logrotate.d/*", "/usr/share/univention-monitoring-client/scripts/*",
"/home/*/scripts/cron*", "/etc/apt/post-invoke.d", "/etc/network/if-up.d", "/etc/letsencrypt/hooks/renew.d",
"/config/etc/letsencrypt/renewal-hooks/deploy/"
) or
process.command_line in (
"run-parts --lsbsysinit /etc/update-motd.d", "/bin/run-parts /etc/run_once",
"run-parts /usr/lib/vmware/viewagent/bin/uninstall",
"run-parts /scripts", "/usr/bin/env bash ./dovecot", "/usr/bin/env bash ./postfix"
) or
process.parent.command_line == "run-parts --lsbsysinit /etc/update-motd.d"
)