Potential Persistence via Mandatory User Profile Modification
Adversaries may abuse Windows mandatory profiles by dropping a malicious NTUSER.MAN file containing pre-populated persistence-related registry keys to establish persistence, which can evade traditional registry-based monitoring.
Attackers may leverage Windows mandatory profiles to achieve persistence by crafting or modifying an NTUSER.MAN file containing malicious registry entries. Windows loads registry settings directly from this file when a user logs in, causing embedded persistence mechanisms, such as Run keys or logon scripts, to activate. This technique allows adversaries to establish persistence without directly modifying the live registry, potentially evading detection by traditional registry-based monitoring tools. This technique may be used for stealthy persistence on systems where mandatory profiles are in use.
Attack Chain
- The adversary gains initial access to the system, possibly through exploiting a vulnerability or using stolen credentials.
- The attacker locates a user profile directory on the system, typically found under
C:\\Users\\. - The attacker creates or modifies an
NTUSER.MANfile within the user’s profile directory. This file contains registry settings that will be loaded when the user logs in. - The adversary embeds malicious registry keys within the
NTUSER.MANfile, such as entries in theRunorRunOncekeys, or configurations for logon scripts. - The user logs off and then logs back onto the system.
- Upon logon, Windows loads the registry settings from the
NTUSER.MANfile. - The malicious registry keys are executed, enabling the attacker to establish persistence or perform other malicious activities.
- The adversary maintains persistence on the system, enabling them to execute commands, install malware, or steal data.
Impact
Successful exploitation allows attackers to establish a persistent presence on the compromised system. This can lead to unauthorized access to sensitive data, further compromise of the network, and potential data exfiltration. The use of mandatory profiles for persistence can make detection more challenging as the malicious activity is triggered during user logon.
Recommendation
- Deploy the Sigma rule “Potential Persistence via Mandatory User Profile Creation” to detect the creation of NTUSER.MAN files by non-SYSTEM processes (see below).
- Deploy the Sigma rule “Potential Persistence via Mandatory User Profile Modification” to detect modification of NTUSER.MAN files by non-SYSTEM processes (see below).
- Monitor file creation and modification events related to
NTUSER.MANin user profile directories to identify suspicious activity. - Review endpoint detection coverage to ensure offline registry hive and profile-based persistence techniques are monitored.
- Investigate any file creation or modification of NTUSER.MAN files by reviewing process.name, process.executable, and parent process relationships.
Detection coverage 2
Potential Persistence via Mandatory User Profile Creation
mediumDetects the creation of NTUSER.MAN file by non-system processes which may indicate malicious persistence.
Potential Persistence via Mandatory User Profile Modification
mediumDetects the modification of NTUSER.MAN file by non-system processes which may indicate malicious persistence.
Detection queries are kept inside the platform. Get full rules →