Adversaries may use scripts automatically executed at boot or logon initialization to establish persistence.[1][2] 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.
Adversaries may use these scripts to maintain persistence on a single system. Depending on the access configuration of the logon scripts, either local credentials or an administrator account may be necessary.
An adversary may also be able to escalate their privileges since some boot or logon initialization scripts run with higher privileges.
| ID | Name | Description |
|---|---|---|
| G0016 | APT29 |
APT29 has hijacked legitimate application-specific startup scripts to enable malware to execute on system startup.[1] |
| G0096 | APT41 |
APT41 used a hidden shell script in |
| C0046 | ArcaneDoor |
ArcaneDoor used malicious boot scripts to install the Line Runner backdoor on victim devices.[4] |
| G0106 | Rocke |
Rocke has installed an "init.d" startup script to maintain persistence.[2] |
| S1078 | RotaJakiro |
Depending on the Linux distribution and when executing with root permissions, RotaJakiro may install persistence using a |
| G1048 | UNC3886 |
UNC3886 has attempted to bypass digital signature verification checks at startup by adding a command to the startup config |
| S1217 | VIRTUALPITA |
VIRTUALPITA can persist as an init.d startup service on Linux vCenter systems.[7] |
| ID | Mitigation | Description |
|---|---|---|
| M1022 | Restrict File and Directory Permissions |
Restrict write access to logon scripts to specific administrators. |
| M1024 | Restrict Registry Permissions |
Ensure proper permissions are set for Registry hives to prevent users from modifying keys for logon scripts that may lead to persistence. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0112 | Boot or Logon Initialization Scripts Detection Strategy | AN0311 |
Monitoring modification and execution of user or system logon scripts such as in registry Run keys or startup folders. |
| AN0312 |
Detection of changes or execution of shell initialization scripts like .bashrc, .profile, or /etc/profile for persistence. |
||
| AN0313 |
Monitoring for modification and execution of login hook scripts or LaunchAgents/LaunchDaemons used for persistence. |
||
| AN0314 |
Detection of modification to ESXi rc.local.d or rc scripts that are used to execute on boot. |
||
| AN0315 |
Detection of changes to device startup-config files that include boot scripts or scheduled execution routines. |