Boot or Logon Initialization Scripts: RC Scripts T1037.004

Tactics: Persistence, Privilege Escalation

Adversaries may establish persistence by modifying RC scripts, which are executed during a Unix-like system’s startup. These files allow system administrators to map and start custom services at startup for different run levels. RC scripts require root privileges to modify.

Events covered

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

Authoring guide

Patterns shared across the 11 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 (16 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
EventType9in 6, eq 3creation, exec, exec_event, file_create_event, ProcessRollup2
host.os.type9eq 9
TargetFilename5in 2, wildcard 2, starts_with 1*/etc/init.d/*, */etc/rc.d/*, */etc/rc.local*, /boot/efi/efi/*/grub.cfg, /boot/grub/grub.cfg
process_name5eq 3, in 2, is_not_null 1chmod, claude, claude.exe, codex, ctl
event.type3eq 3start, info
data_stream.dataset2eq 2fim.event, system.syslog
process.args2eq 1, in 1, starts_with 1, wildcard 1+x, --, --restart=Never, -m, /etc/NetworkManager/dispatcher.d/*
CommandLine1wildcard 1* nc *, * nc.traditional *, * ncat *
Image1eq 1, starts_with 1, wildcard 1./, /boot/, /dev/shm/
event.category1eq 1network
event.outcome1eq 1success
event_action1eq 1created
file.extension1eq 1swp
file.name1eq 1, in 1.bash_logout, .bash_profile, .bashrc
message1in 1Connection refused, No such file or directory, command not found

Top indicator values (395 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
EventTypein
creation
323
EventTypein
exec
2171
EventTypein
exec_event
2139
EventTypein
file_create_event
29
EventTypein
start
2134
event.typeeq
start
2606
CommandLinewildcard
* nc *
12
CommandLinewildcard
* nc.traditional *
1
CommandLinewildcard
* ncat *
1
CommandLinewildcard
* netcat *
1
CommandLinewildcard
*./.*
1
CommandLinewildcard
*/boot/*
1
CommandLinewildcard
*/dev/shm/*
13
CommandLinewildcard
*/dev/tcp/*
12
CommandLinewildcard
*/etc/init.d*
12
CommandLinewildcard
*/etc/ld.so*
12
CommandLinewildcard
*/etc/profile*
12
CommandLinewildcard
*/etc/rc.local*
12
CommandLinewildcard
*/etc/shadow*
15
CommandLinewildcard
*/etc/ssh*
14
CommandLinewildcard
*/etc/sudoers*
12
CommandLinewildcard
*/etc/update-motd.d*
12
CommandLinewildcard
*/home/*/.ssh/*
15
CommandLinewildcard
*/lost+found/*
1
CommandLinewildcard
*/media/*
1
CommandLinewildcard
*/proc/*
1
CommandLinewildcard
*/root/.ssh*
13
CommandLinewildcard
*/sys/*
1
CommandLinewildcard
*/tmp/*
12
CommandLinewildcard
*/var/backups/*
1

Exclusions (177 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
file.extensionin
dpkg-remove
3
Imagein
/bin/autossl_check
2
Imagein
/bin/chef-client
2
Imagein
/bin/dnf
2
Imagein
/bin/dnf-automatic
2
Imagein
/bin/dockerd
2
Imagein
/bin/dpkg
2
Imagein
/bin/dpkg-divert
2
Imagein
/bin/microdnf
2
Imagein
/bin/pacman
2
Imagein
/bin/pamac-daemon
2
Imagein
/bin/podman
2
Imagein
/bin/puppet
2
Imagein
/bin/rpm
2
Imagein
/bin/snapd
2

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)

Elastic 10 rules

Splunk 1 rule