New Systemd Service Created by Previously Unknown Process

edit

New Systemd Service Created by Previously Unknown Process

edit

Systemd service files are configuration files in Linux systems used to define and manage system services. Malicious actors can leverage systemd service files to achieve persistence by creating or modifying service files to execute malicious commands or payloads during system startup. This allows them to maintain unauthorized access, execute additional malicious activities, or evade detection.

Rule type: new_terms

Rule indices:

  • logs-endpoint.events.*
  • endgame-*

Severity: medium

Risk score: 47

Runs every: 5m

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Domain: Endpoint
  • OS: Linux
  • Use Case: Threat Detection
  • Tactic: Persistence
  • Tactic: Privilege Escalation
  • Data Source: Elastic Endgame
  • Data Source: Elastic Defend

Version: 6

Rule authors:

  • Elastic

Rule license: Elastic License v2

Rule query

edit
host.os.type:linux and event.category:file and event.action:("creation" or "file_create_event") and file.path:(
  /etc/systemd/system/* or
  /usr/local/lib/systemd/system/* or
  /lib/systemd/system/* or
  /usr/lib/systemd/system/* or
  /home/*/.config/systemd/user/*
) and
not (
  process.name:(
    "dpkg" or "dockerd" or "rpm" or "snapd" or "yum" or "exe" or "dnf" or "dnf-automatic" or python* or "puppetd" or
    "elastic-agent" or "cinc-client" or "chef-client" or "pacman" or "puppet" or "cloudflared"
  ) or
  file.extension:("swp" or "swpx")
)

Framework: MITRE ATT&CKTM