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 2, in 2, wildcard 1.bash_logout, .bash_aliases, .bash_login, .bash_profile, .bashrc
file.extension3eq 2, in 1rules, service, swp, timer

Top indicator values (966 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
6180
process_basenamein
csh
6147
process_basenamein
sh
6179
process_basenamein
zsh
6179
process_basenamein
dash
5149
process_basenamein
fish
5150
process_basenamein
ksh
5148
process_basenamein
tcsh
5144
EventTypein
exec
5180
EventTypein
start
5157
EventTypein
creation
432
EventTypein
exec_event
4135
EventTypein
file_create_event
26
EventTypein
open
27
EventTypein
rename
225
ParentImagestarts_with
/etc/update-motd.d/*
33
Imageis_not_null
2155
Imagewildcard
/boot/*
218
Imagewildcard
/dev/shm/*
226
Imagewildcard
/etc/cron.*/*
25
Imagewildcard
/etc/update-motd.d/*
25
Imagewildcard
/run/*
213
Imagewildcard
/srv/*
25
Imagewildcard
/tmp/*
228
Imagewildcard
/var/log/*
25
Imagewildcard
/var/tmp/*
226

Exclusions (630 distinct)

These values appear most often in top-level exclusions.

FieldKindValueRules excluding
Imagein
/usr/bin/yum
4
Imagein
./usr/bin/podman
3
Imagein
/bin/autossl_check
3
Imagein
/bin/chef-client
3
Imagein
/bin/dnf
3
Imagein
/bin/dnf-automatic
3
Imagein
/bin/dockerd
3
Imagein
/bin/dpkg
3
Imagein
/bin/dpkg-divert
3
Imagein
/bin/microdnf
3
Imagein
/bin/pacman
3
Imageis_null
4
file.extensionin
dpkg-remove
4
file.namestarts_with
sed*
4
process_basenameeq
sed
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