Elastic high stable eql

Kernel Module Load from Unusual Location

This rule detects the loading of a kernel module from an unusual location. Threat actors may use this technique to maintain persistence on a system by loading a kernel module into the kernel namespace. This behavior is strongly related to the presence of a rootkit on the system.

View Source

Detection Logic

process where host.os.type == "linux" and event.type == "start" and event.action == "exec" 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 (
  process.working_directory like (
    "/tmp*", "/var/tmp*", "/dev/shm*", "/run*", "/var/run*", "/home*/*", "/root*",
    "/var/www*", "/boot*", "/srv*", "/mnt*", "/media*"
  ) or
  process.parent.working_directory like (
    "/tmp*", "/var/tmp*", "/dev/shm*", "/run*", "/var/run*", "/home*/*", "/root*",
    "/var/www*", "/boot*", "/srv*", "/mnt*", "/media*"
  ) or
  process.args like (
    "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/home/*/*", "/root/*",
    "/var/www/*", "/boot/*", "/srv/*", "/mnt/*", "/media/*", "./*"
  )
) and
not (
  process.parent.executable == "/usr/bin/podman" or
  process.working_directory like "/tmp/newroot"
)

Field Validations

Loading…

Comments (0)

Loading comments...