Persistence (TA0003)(external, opens in a new tab or window)
Defense Evasion (TA0005)(external, opens in a new tab or window)
text code block:process where host.os.type == "linux" and event.type == "start" and event.action == "load_module" and ( (process.name == "kmod" and process.args == "insmod" and process.args like~ "*.ko*") or (process.name == "kmod" and process.args == "modprobe" and not process.args in ("-r", "--remove")) or (process.name == "insmod" and process.args like~ "*.ko*") or (process.name == "modprobe" and not process.args in ("-r", "--remove")) ) and not ( process.parent.executable like ("/opt/ds_agent/*", "/opt/TrendMicro/vls_agent/*", "/opt/intel/oneapi/*") or process.working_directory in ("/opt/vinchin/agent", "/var/opt/ds_agent/am", "/opt/ds_agent", "/var/opt/TrendMicro/vls_agent/am") or process.parent.executable in ( "/usr/lib/uptrack/ksplice-apply", "/opt/commvault/commvault/Base/linux_drv", "/opt/cisco/amp/bin/cisco-amp-helper", "/usr/bin/kcarectl", "/usr/share/ksplice/ksplice-apply", "/opt/commvault/Base/linux_drv", "/usr/sbin/veeamsnap-loader", "/bin/falcoctl", "/usr/sbin/veeamworker" ) or process.parent.executable like ( "/sbin/iptables-multi*", "/var/ossec/bin/wazuh-modulesd", "/usr/sbin/mkinitramfs", "/usr/share/initramfs-tools/hooks/lvm2", "/usr/lpp/mmfs/bin/*", "/opt/forticlient/*", "/opt/traps/bin/*", "/snap/lxd/*/sbin/lxd", "/usr/sbin/xtables*" ) or (process.parent.name like ("python*", "platform-python*") and process.parent.args in ("--smart-update", "--auto-update")) or process.args in ("--showconfig", "--dump-modversions") or ( process.name == "modprobe" and process.args == "-q" and process.args == "--" and (process.args in ("net-pf-10", "binfmt-464c") or process.args like ("netdev-*", "block-major-*")) ) or ( process.name == "modprobe" and process.args == "-n" and process.args == "-v" and process.args in ("usb-storage", "dccp", "squashfs", "udf", "sctp", "cramfs", "hfsplus", "rds", "hfs", "jffs2", "freevxfs", "vfat", "overlay") ) or process.parent.args like "/usr/share/initramfs-tools/hooks/*" )
Install detection rules in Elastic Security
Detect Kernel Module Load via Built-in Utility 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(external, opens in a new tab or window).