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

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

Authoring guide

These 52 rules share fields, values, and exclusions.

Fields filtered most (36 distinct)

These fields appear most often in rule filters.

FieldRulesHowSample values
EventType29eq 17, in 12exec, creation, exec_event, start, connection_attempted
event.type20eq 17, ne 2, in 1start, deletion, change, info, process_started
TargetFilename16wildcard 7, starts_with 5, in 4, ends_with 2, contains 1/etc/udev/rules.d/*, /etc/update-motd.d/*, *.desktop, */.config/autostart/*, */etc/init.d/*
process_basename13in 8, eq 7, starts_with 2, wildcard 2, is_not_null 1bash, csh, awk, , .*
process.args9eq 6, in 4, wildcard 4, contains 3, starts_with 2, ends_with 1*/bin/*sh*, -c, * /dev/shm/* , * /home/*, * /run/*
parent_process_basename8eq 6, in 3, starts_with 1, wildcard 1socat, *.bin, *.lua, *.pl, Cursor
Image7wildcard 3, eq 2, is_not_null 2, starts_with 2, ends_with 1, is_null 1/boot/*, /dev/shm/*, , ./*, ./.*
ParentImage7starts_with 4, ends_with 1, is_not_null 1, wildcard 1/etc/update-motd.d/*, , ., /dev/shm/*, /etc/init.d/*
CommandLine6contains 3, wildcard 3, eq 1, regex_match 1* nc *, * nc.traditional *, * ncat *, * setsid *, *#!/*
EventID4eq 3, in 14104, 4688, 5136, 5145, ModifyInstanceAttribute
data_stream.dataset4eq 4azure.activitylogs, fim.event, system.syslog
event.outcome4eq 3, in 1success, Success
event_action4eq 2, in 2created, modified
file.name4eq 3, in 2.bash_logout, .bash_aliases, .bash_login, .bash_profile, .bashrc
file.extension3eq 2, in 1rules, service, swp, timer

Top indicator values (945 distinct)

These values appear most often in rule predicates.

FieldKindValueRules (here)Corpus reach
event.typeeq
start
141036
EventTypeeq
exec
9547
EventTypeeq
creation
350
EventTypeeq
connection_attempted
272
process_basenamein
bash
6181
process_basenamein
csh
6148
process_basenamein
sh
6180
process_basenamein
zsh
6180
process_basenamein
dash
5150
process_basenamein
fish
5151
process_basenamein
ksh
5149
process_basenamein
tcsh
5145
EventTypein
exec
5180
EventTypein
start
5157
EventTypein
creation
432
EventTypein
exec_event
4135
EventTypein
file_create_event
26
EventTypein
open
27
EventTypein
rename
225
Imageis_not_null
2155
Imagewildcard
/boot/*
213
Imagewildcard
/dev/shm/*
216
Imagewildcard
/etc/cron.*/*
23
Imagewildcard
/etc/update-motd.d/*
23
Imagewildcard
/run/*
29
Imagewildcard
/srv/*
24
Imagewildcard
/tmp/*
217
Imagewildcard
/var/log/*
23
Imagewildcard
/var/tmp/*
216
ParentImagestarts_with
/etc/update-motd.d/*
22

Exclusions (586 distinct)

These values appear most often in top-level exclusions.

FieldKindValueRules excluding
Imagein
/usr/bin/yum
5
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

Rules under this technique

These vendors publish rules tagged with this technique.

Platform (all)
Domain (all)

Sigma 4 rules

Elastic 36 rules

Splunk 10 rules

YARA-L 1 rule

Panther 1 rule