| ID | Name |
|---|---|
| T1037.001 | Logon Script (Windows) |
| T1037.002 | Login Hook |
| T1037.003 | Network Logon Script |
| T1037.004 | RC Scripts |
| T1037.005 | Startup Items |
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.
Adversaries may establish persistence by adding a malicious binary path or shell commands to rc.local, rc.common, and other RC scripts specific to the Unix-like distribution.[1][2] Upon reboot, the system executes the script's contents as root, resulting in persistence.
Adversary abuse of RC scripts is especially effective for lightweight Unix-like distributions using the root user as default, such as ESXi hypervisors, IoT, or embedded systems.[3] As ESXi servers store most system files in memory and therefore discard changes on shutdown, leveraging /etc/rc.local.d/local.sh is one of the few mechanisms for enabling persistence across reboots.[4]
Several Unix-like systems have moved to Systemd and deprecated the use of RC scripts. This is now a deprecated mechanism in macOS in favor of Launchd.[5][6] This technique can be used on Mac OS X Panther v10.3 and earlier versions which still execute the RC scripts.[7] To maintain backwards compatibility some systems, such as Ubuntu, will execute the RC scripts if they exist with the correct file permissions.[8]
| ID | Name | Description |
|---|---|---|
| G0016 | APT29 |
APT29 has installed a run command on a compromised system to enable malware execution on system startup.[9] |
| S0687 | Cyclops Blink |
Cyclops Blink has the ability to execute on device startup, using a modified RC script named S51armled.[10] |
| S0690 | Green Lambert |
Green Lambert can add |
| S0394 | HiddenWasp |
HiddenWasp installs reboot persistence by adding itself to |
| S0278 | iKitten |
iKitten adds an entry to the rc.common file for persistence.[13] |
| G1048 | UNC3886 |
UNC3886 has placed a bash installation script into |
| G1047 | Velvet Ant |
Velvet Ant used a modified |
| ID | Mitigation | Description |
|---|---|---|
| M1022 | Restrict File and Directory Permissions |
Limit privileges of user accounts so only authorized users can edit the |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0237 | Detection Strategy for Boot or Logon Initialization Scripts: RC Scripts | AN0658 |
Detection of modified or newly created /etc/rc.local or /etc/init.d scripts followed by suspicious execution during system startup. |
| AN0659 |
Detection of edits or additions to /etc/rc.common, /Library/StartupItems, or /System/Library/StartupItems and associated script execution during login or reboot. |
||
| AN0660 |
Detection of changes to /etc/rc.local.d/local.sh or rc.local during post-boot script execution with abnormal commands or additions. |
||
| AN0661 |
Detection of modified boot-time configuration scripts that persist malicious CLI commands across reboots. |