Cross-source coverage
T1574.011 / ATT&CK
Hijack Execution Flow: Services Registry Permissions Weakness
18 rules across 4 sources.
From MITRE ATT&CK 19.2
Adversaries may execute their own malicious payloads by hijacking the Registry entries used by services. Flaws in the permissions for Registry keys related to services can allow adversaries to redirect the originally specified executable to one they control, launching their own code when a service starts. Windows stores local service configuration information in the Registry under HKLM\SYSTEM\CurrentControlSet\Services. The information stored under a service's Registry keys can be manipulated to modify a service's execution parameters through tools such as the service controller, sc.exe, PowerShell, or Reg. Access to Registry keys is controlled through access control lists and user permissions.
If the permissions for users and groups are not properly set and allow access to the Registry keys for a service, adversaries may change the service's binPath/ImagePath to point to a different executable under their control. When the service starts or is restarted, the adversary-controlled program will execute, allowing the adversary to establish persistence and/or privilege escalation to the account context the service is set to execute under (local/domain account, SYSTEM, LocalService, or NetworkService).
Adversaries may also alter other Registry keys in the service’s Registry tree. For example, the FailureCommand key may be changed so that the service is executed in an elevated context anytime the service fails or is intentionally corrupted.
The Performance key contains the name of a driver service's performance DLL and the names of several exported functions in the DLL. If the Performance key is not already present and if an adversary-controlled user has the Create Subkey permission, adversaries may create the Performance key in the service’s Registry tree to point to a malicious DLL.
Adversaries may also add the Parameters key, which can reference malicious drivers file paths. This technique has been identified to be a method of abuse by configuring DLL file paths within the Parameters key of a given services registry configuration. By placing and configuring the Parameters key to reference a malicious DLL, adversaries can ensure that their code is loaded persistently whenever the associated service or library is invoked.
For example, the registry path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters contains the AutodiaDLL value, which specifies the DLL to be loaded for autodial funcitionality. An adversary could set the AutodiaDLL to point to a hijacked or malicious DLL:
"AutodialDLL"="c:\temp\foo.dll"
This ensures persistence, as it causes the DLL (in this case, foo.dll) to be loaded each time the Winsock 2 library is invoked.
- Platforms
- Windows
- Telemetry
-
WinEventLog:SecurityWinEventLog:SystemWinEventLog:Sysmon
How MITRE says to detect it DET0427
Detection Strategy for Hijack Execution Flow through Service Registry Premission Weakness.
Windows Analytic 1195
Unauthorized modification of service-related registry keys such as ImagePath, FailureCommand, ServiceDll, or Performance/Parameters keys. Defender correlates registry modifications, anomalous service metadata changes, and subsequent service process executions that deviate from baseline configurations.
WinEventLog:SecurityEventCode=4657WinEventLog:SystemEventCode=7040WinEventLog:SysmonEventCode=1
SigmaHQ/sigma
11 rules| Detection | Severity | Format |
|---|---|---|
| Abuse of Service Permissions to Hide Services Via Set-Service | High | Sigma |
| Abuse of Service Permissions to Hide Services Via Set-Service - PS | High | Sigma |
| Possible Privilege Escalation via Weak Service Permissions | High | Sigma |
| Potential Privilege Escalation via Service Permissions Weakness | High | Sigma |
| Service DACL Abuse To Hide Services Via Sc.EXE | High | Sigma |
| Suspicious Service DACL Modification Via Set-Service Cmdlet - PS | High | Sigma |
| Changing Existing Service ImagePath Value Via Reg.EXE | Medium | Sigma |
| Potential Persistence Attempt Via Existing Service Tampering | Medium | Sigma |
| Service Registry Permissions Weakness Check | Medium | Sigma |
| Service Security Descriptor Tampering Via Sc.EXE | Medium | Sigma |
+ 1 more from SigmaHQ/sigma → showing the 10 highest-severity
elastic/detection-rules
4 rules| Detection | Severity | Format |
|---|---|---|
| Persistence via Update Orchestrator Service Hijack | High | Elastic TOML |
| Potential Privilege Escalation via Service ImagePath Modification | Medium | Elastic TOML |
| Unsigned DLL Loaded by Svchost | Medium | Elastic TOML |
| Unusual Persistence via Services Registry | Low | Elastic TOML |
splunk/security_content
2 rules| Detection | Severity | Format |
|---|---|---|
| Reg exe Manipulating Windows Services Registry Keys | Undefined | SPL |
| Windows Service Creation Using Registry Entry | Undefined | SPL |