Elastic Defend high stable eql

Service Created by Suspicious Process and Activated

This rule detects the creation and activation of a service by a system process. Threat actors may abuse this to establish persistence or escalate privileges.

View Source

Detection Logic

sequence with maxspan=30s
  [file where event.action == "creation" and file.extension == "service" and file.path like (
    "/etc/systemd/system/*", "/etc/systemd/user/*", "/usr/local/lib/systemd/system/*",
    "/lib/systemd/system/*", "/usr/lib/systemd/system/*", "/usr/lib/systemd/user/*",
    "/home/*/.config/systemd/user/*", "/home/*/.local/share/systemd/user/*",
    "/root/.config/systemd/user/*", "/root/.local/share/systemd/user/*"
  ) and (
    process.executable like (
      "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/user/*", "/var/run/user/*", "/home/*/*", "/root/*", "/boot/*", "./*"
    ) or
    process.name in ("curl", "wget")
  ) and
  not process.executable like (
    "/tmp/tmp.*/nix-installer", "/tmp/octofence-agent-installer_*", "/tmp/selfgz*/install.sh",
    "/home/*/elastic-agent/.claude/*/elastic-agent", "/tmp/TestHeartbeatHTTPMonitor*/*/elastic-agent",
    "/tmp/Test*/elastic-agent-*/data/elastic-agent-*/elastic-agent",
    "/home/*/Downloads/*/elastic-agent", "/home/*/duoauthproxy-*/duoauthproxy-build/usr/local/bin/python*",
    "./elastic-agent", "/root/elastic-agent-*/elastic-agent",
    "/home/*/elastic-agent-*/data/elastic-agent-*/elastic-agent",
    "/tmp/elastic-agent-*/elastic-agent", "/tmp/cybercnsagent_linux",
    "/root/.cursor-server/bin/linux-x64/*/node",
    "/tmp/newroot/usr/local/manageengine/*/dcservice",
    "/home/*/.codex/*/bin/codex", "/home/linuxbrew/.linuxbrew/Caskroom/codex/*/bin/codex",
    "/home/*/.local/share/uv/python/*/bin/python*"
  )] as event0
  [process where event.type == "start" and event.action == "exec" and process.name == "systemctl" and
  process.args in ("enable", "start") and stringcontains(process.command_line, event0.file.name)]

Field Validations

Loading…

Comments (0)

Loading comments...