Persistence · Windows
reg.exe
Registry command line
Reads and writes the registry. Used to set autorun keys for persistence, change security settings and, with reg save, to export the SAM, SYSTEM and SECURITY hives for offline credential extraction.
Legitimate use
Admins and installers use it to read and set registry values from scripts.
Subcommands
Creates or sets a key or value, for example a Run key for autostart.
MediumReads keys and values. Used to find credentials and settings.
LowExports a hive to a file. Used against SAM, SYSTEM and SECURITY to steal credentials.
HighExports keys to a .reg text file.
LowDeletes a key or value, which can remove defensive settings or evidence.
MediumLoads a hive file into the registry.
MediumApplies settings from a .reg file.
MediumSwitches
Names the value to act on.
InfoThe data to write.
LowForces the operation with no prompt.
InfoCommand lines to worry about
- High
Registry hive export for credential theft
reg save of the SAM, SYSTEM or SECURITY hive lets an attacker extract local password hashes and LSA secrets offline. High-confidence credential access.
Detection regex
reg(\.exe)?\s+save\b.*hk(lm|ey_local_machine)\\(sam|security|system)\b - High
Winlogon Userinit or Shell modified
Changing Userinit or Shell under Winlogon runs an attacker program at every logon. A stealthier persistence spot than Run keys.
Detection regex
reg(\.exe)?\s+add\b.*\\winlogon\\.*\/v\s+(userinit|shell)\b - High
Image File Execution Options debugger set
A Debugger value under IFEO launches an attacker program whenever the named binary starts, and is also used to disable tools. Check the target binary and the data.
Detection regex
reg(\.exe)?\s+add\b.*\\image file execution options\\.*\/v\s+debugger\b - Medium
Autorun registry key set
A value added under a Run or RunOnce key makes a program start at logon. Common persistence. Check the data for the program path.
Detection regex
reg(\.exe)?\s+add\b.*\\currentversion\\(run|runonce)\b
Where it is recorded
- Security4688Process creation with the full command line, when command-line auditing is enabled.
- Sysmon1Process creation with command line, hashes and parent process.
- Security4657A registry value was modified, when registry auditing with a SACL is enabled.
- Sysmon13Registry value set, for example a Run key or a Winlogon value.
- Sysmon11File created when reg save writes a hive to disk.
Community detections
51 SigmaHQ rules for reg.exe. The explainer checks every pasted command line against all of them.
- HighAdd SafeBoot Keys Via Reg Utility
Detects execution of "reg.exe" commands with the "add" or "copy" flags on safe boot registry keys. Often used by attacker to allow the ransomware to work in safe mode as some security products do not
T1685by Nasreddine Bencherchali (Nextron Systems)
- HighControl Panel Items
Detects the malicious use of a control panel item
T1218.002T1546by Kyaw Min Thein, Furkan Caliskan (@caliskanfurkan_)
- HighDisabling Windows Defender WMI Autologger Session via Reg.exe
Detects the use of reg.exe to disable the Event Tracing for Windows (ETW) Autologger session for Windows Defender API and Audit events. By setting the 'Start' value to '0' for the 'DefenderApiLogger' or 'DefenderAuditLogger' session, an attacker can prevent these critical security events from being logged, effectively blinding monitoring tools that rely on this data.
T1685by Matt Anderson (Huntress)
- HighDumping of Sensitive Hives Via Reg.EXE
Detects the usage of "reg.exe" in order to dump sensitive registry hives. This includes SAM, SYSTEM and SECURITY hives.
T1003.002T1003.004T1003.005by Teymur Kheirkhabarov, Endgame, JHasenbusch, Daniil Yugoslavskiy, oscd.community, frack113
- HighHypervisor-protected Code Integrity (HVCI) Related Registry Tampering Via CommandLine
Detects the tampering of Hypervisor-protected Code Integrity (HVCI) related registry values via command line tool reg.exe. HVCI uses virtualization-based security to protect code integrity by ensuring that only trusted code can run in kernel mode.
T1685by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighMMC Spawning Windows Shell
Detects a Windows command line executable started from MMC
T1021.003by Karneades, Swisscom CSIRT
- HighPotential Defense Evasion Via Rename Of Highly Relevant Binaries
Detects the execution of a renamed binary often used by attackers or malware leveraging new Sysmon OriginalFileName datapoint.
T1036.003by Matthew Green - @mgreen27, Florian Roth (Nextron Systems), frack113
- HighPotential Tampering With RDP Related Registry Keys Via Reg.EXE
Detects the execution of "reg.exe" for enabling/disabling the RDP service on the host by tampering with the 'CurrentControlSet\Control\Terminal Server' values
T1021.001T1112by pH-T (Nextron Systems), @Kostastsale, TheDFIRReport
- HighPotentially Suspicious Child Process Of Regsvr32
Detects potentially suspicious child processes of "regsvr32.exe".
T1218.010by elhoim, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
- HighReg Add Suspicious Paths
Detects when an adversary uses the reg.exe utility to add or modify new keys or subkeys
T1112T1685by frack113, Nasreddine Bencherchali (Nextron Systems)
- HighRegistry Export of Third-Party Credentials
Detects the use of reg.exe to export registry paths associated with third-party credentials. Credential stealers have been known to use this technique to extract sensitive information from the registry.
T1552.002by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighRunMRU Registry Key Deletion
Detects deletion of the RunMRU registry key, which stores the history of commands executed via the Run dialog. In the clickfix techniques, the phishing lures instruct users to open a run dialog through (Win + R) and execute malicious commands. Adversaries may delete this key to cover their tracks after executing commands.
T1070.003by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighSafeBoot Registry Key Deleted Via Reg.EXE
Detects execution of "reg.exe" commands with the "delete" flag on safe boot registry keys. Often used by attacker to prevent safeboot execution of security products
T1685by Nasreddine Bencherchali (Nextron Systems), Tim Shelton
- HighSecurity Event Logging Disabled via MiniNt Registry Key - Process
Detects attempts to disable security event logging by adding the `MiniNt` registry key. This key is used to disable the Windows Event Log service, which collects and stores event logs from the operating system and applications. Adversaries may want to disable this service to prevent logging of security events that could be used to detect their activities.
T1685.001T1112by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighService Registry Key Deleted Via Reg.EXE
Detects execution of "reg.exe" commands with the "delete" flag on services registry key. Often used by attacker to remove AV software services
T1685by Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious Child Process Of Manage Engine ServiceDesk
Detects suspicious child processes of the "Manage Engine ServiceDesk Plus" Java web service
T1102by Florian Roth (Nextron Systems)
- HighSuspicious MSHTA Child Process
Detects a suspicious process spawning from an "mshta.exe" process, which could be indicative of a malicious HTA script execution
T1218.005by Michael Haag
- HighSuspicious Process By Web Server Process
Detects potentially suspicious processes being spawned by a web server process which could be the result of a successfully placed web shell or exploitation
T1505.003T1190by Thomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious Processes Spawned by Java.EXE
Detects suspicious processes spawned from a Java host process which could indicate a sign of exploitation (e.g. log4j)
by Andreas Hunkeler (@Karneades), Florian Roth
- HighSuspicious Shells Spawn by Java Utility Keytool
Detects suspicious shell spawn from Java utility keytool process (e.g. adselfservice plus exploitation)
by Andreas Hunkeler (@Karneades)
- HighSuspicious Spool Service Child Process
Detects suspicious print spool service (spoolsv.exe) child processes.
T1203T1068by Justin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)
- HighSuspicious Windows Defender Registry Key Tampering Via Reg.EXE
Detects the usage of "reg.exe" to tamper with different Windows Defender registry keys in order to disable some important features related to protection and detection
T1685by Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel, Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious WSL InstallLocation Registry Key Modification Via CommandLine
Detects the use of reg.exe or PowerShell to modify the WSL InstallLocation registry key via command-line arguments. Legitimate modifications to this key are performed exclusively by the Windows Installer (msiexec.exe) during WSL package installation or update. Manual use of reg.exe or PowerShell to set this value strongly indicates an attempt to redirect WSL execution to a malicious binary.
T1112T1218by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighSystem Restore Registry Modification via CommandLine
Detects system restore registry modification via command line, which can be used by adversaries to disable system restore on the computer.
T1490by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighUser Shell Folders Registry Modification via CommandLine
Detects modifications to User Shell Folders registry values via reg.exe or PowerShell, which could indicate persistence attempts. Attackers may modify User Shell Folders registry values to point to malicious executables or scripts that will be executed during startup.
T1547.001T1112by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighVulnerable Driver Blocklist Registry Tampering Via CommandLine
Detects tampering of the Vulnerable Driver Blocklist registry via command line tools such as PowerShell or REG.EXE. The Vulnerable Driver Blocklist is a security feature that helps prevent the loading of known vulnerable drivers.
T1685by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighWindows AMSI Related Registry Tampering Via CommandLine
Detects tampering of AMSI (Anti-Malware Scan Interface) related registry values via command line tools such as reg.exe or PowerShell. AMSI provides a generic interface for applications and services to integrate with antimalware products. Adversaries may disable AMSI to evade detection of malicious scripts and code execution.
T1685by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighWindows Credential Guard Registry Tampering Via CommandLine
Detects attempts to add, modify, or delete Windows Credential Guard related registry keys or values via command line tools such as Reg.exe or PowerShell. Credential Guard uses virtualization-based security to isolate secrets so that only privileged system software can access them.
T1685by Swachchhanda Shrawan Poudel (Nextron Systems)
- HighWindows Defender Context Menu Removed
Detects the use of reg.exe or PowerShell to delete the Windows Defender context menu handler registry keys. This action removes the "Scan with Microsoft Defender" option from the right-click menu for files, directories, and drives. Attackers may use this technique to hinder manual, on-demand scans and reduce the visibility of the security product.
T1685by Matt Anderson (Huntress)
- HighWindows EventLog Autologger Session Registry Modification Via CommandLine
Detects attempts to disable Windows EventLog autologger sessions via registry modification. The AutoLogger event tracing session records events that occur early in the operating system boot process. Applications and device drivers can use the AutoLogger session to capture traces before the user logs in.
T1685.001by Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumChanging Existing Service ImagePath Value Via Reg.EXE
Adversaries may execute their own malicious payloads by hijacking the Registry entries used by services. Adversaries may use flaws in the permissions for registry to redirect from the originally specified executable to one that they control, in order to launch their own code at Service start.
T1574.011by frack113
- MediumDetected Windows Software Discovery
Adversaries may attempt to enumerate software for a variety of reasons, such as figuring out what security measures are present or if the compromised system has a version of software that is vulnerable.
T1518by Nikita Nazarov, oscd.community
- MediumDirect Autorun Keys Modification
Detects direct modification of autostart extensibility point (ASEP) in registry using reg.exe.
T1547.001by Victor Sergeev, Daniil Yugoslavskiy, oscd.community, Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumEnumeration for 3rd Party Creds From CLI
Detects processes that query known 3rd party registry keys that holds credentials via commandline
T1552.002by Nasreddine Bencherchali (Nextron Systems)
- MediumEnumeration for Credentials in Registry
Adversaries may search the Registry on compromised systems for insecurely stored credentials. The Windows Registry stores configuration information that can be used by the system or other programs. Adversaries may query the Registry looking for credentials and passwords that have been stored for use by other programs or services
T1552.002by frack113
- MediumHiding User Account Via SpecialAccounts Registry Key - CommandLine
Detects changes to the registry key "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\Userlist" where the value is set to "0" in order to hide user account from being listed on the logon screen.
T1564.002by @Kostastsale, TheDFIRReport
- MediumLSA PPL Protection Setting Modification via CommandLine
Detects modification of LSA PPL protection settings via CommandLine. It may indicate an attempt to disable protection and enable credential dumping tools to access LSASS process memory.
T1689by Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumModify Group Policy Settings
Detect malicious GPO modifications can be used to implement many other malicious behaviors.
T1484.001by frack113
- MediumPotential Configuration And Service Reconnaissance Via Reg.EXE
Detects the usage of "reg.exe" in order to query reconnaissance information from the registry. Adversaries may interact with the Windows registry to gather information about credentials, the system, configuration, and installed software.
T1012T1007by Timur Zinniatullin, oscd.community
- MediumPotential Persistence Attempt Via Run Keys Using Reg.EXE
Detects suspicious command line reg.exe tool adding key to RUN key in Registry
T1547.001by Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumPotential Suspicious Registry File Imported Via Reg.EXE
Detects the import of '.reg' files from suspicious paths using the 'reg.exe' utility
T1112by frack113, Nasreddine Bencherchali
- MediumPotentially Suspicious Child Process Of ClickOnce Application
Detects potentially suspicious child processes of a ClickOnce deployment application
by Nasreddine Bencherchali (Nextron Systems)
- MediumPotentially Suspicious Desktop Background Change Using Reg.EXE
Detects the execution of "reg.exe" to alter registry keys that would replace the user's desktop background. This is a common technique used by malware to change the desktop background to a ransom note or other image.
T1112T1491.001by Stephen Lincoln @slincoln-aiq (AttackIQ)
- MediumRegistry Modification of MS-settings Protocol Handler
Detects registry modifications to the 'ms-settings' protocol handler, which is frequently targeted for UAC bypass or persistence. Attackers can modify this registry to execute malicious code with elevated privileges by hijacking the command execution path.
T1548.002T1546.001T1112by frack113, Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumRegistry Tampering Of Internal Tools Settings
Detects registry modifications that tamper with internal Windows tools settings, commonly used by malware to disable security features or system tools
T1112by Swachchhanda Shrawan Poudel (Nextron Systems)
- MediumSuspicious ScreenSave Change by Reg.exe
Adversaries may establish persistence by executing malicious content triggered by user inactivity. Screensavers are programs that execute after a configurable time of user inactivity and consist of Portable Executable (PE) files with a .scr file extension
T1546.002by frack113
- MediumSuspicious Windows Defender Folder Exclusion Added Via Reg.EXE
Detects the usage of "reg.exe" to add Defender folder exclusions. Qbot has been seen using this technique to add exclusions for folders within AppData and ProgramData.
T1685by frack113
- MediumSystem Language Discovery via Reg.Exe
Detects the usage of Reg.Exe to query system language settings. Attackers may discover the system language to determine the geographic location of victims, customize payloads for specific regions, or avoid targeting certain locales to evade detection.
T1614.001by Marco Pedrinazzi (@pedrinazziM) (InTheCyber)
- MediumWindows Recall Feature Enabled Via Reg.EXE
Detects the enabling of the Windows Recall feature via registry manipulation. Windows Recall can be enabled by deleting the existing "DisableAIDataAnalysis" value, or setting it to 0. Adversaries may enable Windows Recall as part of post-exploitation discovery and collection activities.
T1113by Sajid Nawaz Khan
- Low
- LowSystem Information Discovery via Registry Queries
Detects attempts to query system information directly from the Windows Registry.
T1082by lazarg
Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.