| name | T1037.004_rc-scripts |
| description | Adversaries may establish persistence by modifying RC scripts, which are executed during a Unix-like system’s startup. |
| category | configuration |
| version | 18.1 |
| author | cyberstrike-official |
| tags | ["mitre-attack","enterprise","t1037.004","persistence","privilege-escalation","macos","linux","network-devices","esxi","sub-technique"] |
| technique_id | T1037.004 |
| tactic | persistence |
| all_tactics | ["persistence","privilege-escalation"] |
| platforms | ["macOS","Linux","Network Devices","ESXi"] |
| mitre_url | https://attack.mitre.org/techniques/T1037/004 |
| tech_stack | ["macos","linux","network devices","esxi"] |
| cwe_ids | ["CWE-276"] |
| chains_with | ["T1037","T1037.001","T1037.002","T1037.003","T1037.005"] |
| prerequisites | ["T1037"] |
| severity_boost | {"T1037":"Chain with T1037 for deeper attack path","T1037.001":"Chain with T1037.001 for deeper attack path","T1037.002":"Chain with T1037.002 for deeper attack path"} |
T1037.004 RC Scripts
Sub-technique of: T1037
High-Level Description
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. 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. 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.
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. This technique can be used on Mac OS X Panther v10.3 and earlier versions which still execute the RC scripts. To maintain backwards compatibility some systems, such as Ubuntu, will execute the RC scripts if they exist with the correct file permissions.
Kill Chain Phase
- Persistence (TA0003)
- Privilege Escalation (TA0004)
Platforms: macOS, Linux, Network Devices, ESXi
What to Check
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: rc.common
Modify rc.common