Boot or Logon Initialization Scripts T1037

Tactics: Persistence, Privilege Escalation

Adversaries may use scripts automatically executed at boot or logon initialization to establish persistence. Initialization scripts can be used to perform administrative functions, which may often execute other programs or send information to an internal logging server. These scripts can vary based on operating system and whether applied locally or remotely.

Events covered

12 catalog events are tagged with this technique by at least one rule.

Authoring guide

Patterns shared across the 37 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.

Fields filtered most (36 distinct)

The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.

FieldRulesHowSample values
host.os.type19eq 19
EventType17in 9, eq 8creation, exec, exec_event, start, file_create_event
TargetFilename11starts_with 5, wildcard 5, in 2, ends_with 1*/etc/init.d/*, */etc/rc.d/*, */etc/rc.local*, .plist, /boot/efi/efi/*/grub.cfg
event.type11eq 8, ne 2, in 1start, deletion, change, info, process_started
process_name9eq 5, in 5, is_not_null 1, starts_with 1, wildcard 1bash, csh, awk, chmod, claude
process.args7eq 5, wildcard 3, contains 2, in 2, ends_with 1, starts_with 1* /dev/shm/* , * /home/*, * /run/*, */bin/*sh*, *import*pty*spawn*
CommandLine4contains 3, eq 1, wildcard 1* nc *, * nc.traditional *, * ncat *, PowerShell.exe, defaults
Image4eq 2, is_not_null 2, ends_with 1, is_null 1, starts_with 1, wildcard 1./, /boot/, /dev/shm/, /usr/sbin/chkconfig, :\program files (x86)\citrix\hdx\bin\cmstart.exe
file.name4eq 3, in 2.bash_logout, .bash_aliases, .bash_login, .bash_profile, .bashrc
EventID3eq 34104, 4688, ModifyInstanceAttribute
file.extension3eq 2, in 1rules, service, swp, timer
parent_process_name3eq 3com.apple.foundation.UserScriptService, exim4, socat
ParentImage2ends_with 1, starts_with 1/etc/update-motd.d/, \userinit.exe
TargetObject2contains 1, wildcard 1hkey_users\*\control panel\desktop\scrnsave.exe, hkey_users\*\environment\userinitmprlogonscript, hkey_users\*\software\microsoft\command processor\autorun, userinitmprlogonscript
container.id2starts_with 2?

Top indicator values (648 distinct)

Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.

FieldKindValueRules (here)Corpus reach
event.typeeq
start
6606
EventTypein
creation
423
EventTypein
exec
4171
EventTypein
exec_event
4139
EventTypein
start
4134
EventTypein
file_create_event
29
EventTypein
open
22
EventTypein
rename
218
EventTypeeq
creation
325
EventTypeeq
exec
2171
process_namein
bash
388
process_namein
csh
371
process_namein
sh
383
process_namein
zsh
382
TargetFilenamewildcard
/etc/cron.allow
23
TargetFilenamewildcard
/etc/cron.d/*
23
TargetFilenamewildcard
/etc/cron.daily/*
23
TargetFilenamewildcard
/etc/cron.deny
23
TargetFilenamewildcard
/etc/cron.hourly/*
23
TargetFilenamewildcard
/etc/cron.monthly/*
23
TargetFilenamewildcard
/etc/cron.weekly/*
23
TargetFilenamewildcard
/etc/crontab
23
TargetFilenamewildcard
/etc/systemd/system/*
24
TargetFilenamewildcard
/home/*/.config/systemd/user/*
24
TargetFilenamewildcard
/home/*/.local/share/systemd/user/*
24
TargetFilenamewildcard
/lib/systemd/system/*
24
TargetFilenamewildcard
/root/.config/systemd/user/*
24
TargetFilenamewildcard
/root/.local/share/systemd/user/*
24
TargetFilenamewildcard
/usr/lib/systemd/system/*
24
TargetFilenamewildcard
/usr/local/lib/systemd/system/*
24

Exclusions (302 distinct)

Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.

FieldKindValueRules excluding
Imagein
/bin/autossl_check
4
Imagein
/bin/chef-client
4
Imagein
/bin/dnf
4
Imagein
/bin/dnf-automatic
4
Imagein
/bin/dockerd
4
Imagein
/bin/dpkg
4
Imagein
/bin/dpkg-divert
4
Imagein
/bin/microdnf
4
Imagein
/bin/pacman
4
Imagein
/bin/pamac-daemon
4
Imagein
/bin/podman
4
Imagein
/bin/puppet
4
Imagein
/bin/rpm
4
Imagein
/bin/snapd
4
Imagein
/bin/yum
4

Rules under this technique

Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.

Platform (all)
Domain (all)

Sigma 4 rules

Elastic 24 rules

Splunk 7 rules

YARA-L 1 rule

Panther 1 rule