T1564.002 Hidden Users
Sub-technique of: T1564
High-Level Description
Adversaries may use hidden users to hide the presence of user accounts they create or modify. Administrators may want to hide users when there are many user accounts on a given system or if they want to hide their administrative or other management accounts from other users.
In macOS, adversaries can create or modify a user to be hidden through manipulating plist files, folder attributes, and user attributes. To prevent a user from being shown on the login screen and in System Preferences, adversaries can set the userID to be under 500 and set the key value Hide500Users to TRUE in the /Library/Preferences/com.apple.loginwindow plist file. Every user has a userID associated with it. When the Hide500Users key value is set to TRUE, users with a userID under 500 do not appear on the login screen and in System Preferences. Using the command line, adversaries can use the dscl utility to create hidden user accounts by setting the IsHidden attribute to 1. Adversaries can also hide a user’s home folder by changing the chflags to hidden.
Adversaries may similarly hide user accounts in Windows. Adversaries can set the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList Registry key value to 0 for a specific user to prevent that user from being listed on the logon screen.
On Linux systems, adversaries may hide user accounts from the login screen, also referred to as the greeter. The method an adversary may use depends on which Display Manager the distribution is currently using. For example, on an Ubuntu system using the GNOME Display Manger (GDM), accounts may be hidden from the greeter using the gsettings command (ex: sudo -u gdm gsettings set org.gnome.login-screen disable-user-list true). Display Managers are not anchored to specific distributions and may be changed by a user or adversary.
Kill Chain Phase
- Defense Evasion (TA0005)
Platforms: macOS, Windows, Linux
What to Check
- Identify if Hidden Users technique is applicable to target environment
- Check macOS systems for indicators of Hidden Users
- Check Windows systems for indicators of Hidden Users
- Check Linux systems for indicators of Hidden Users
- Verify mitigations are bypassed or absent (1 known mitigations)
- Assess detection coverage (1 detection strategies)
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: Create Hidden User using UniqueID < 500
Add a hidden user on macOS using Unique ID < 500 (users with that ID are hidden by default)
Supported Platforms: macos Elevation Required: Yes
sudo dscl . -create /Users/#{user_name} UniqueID 333
Atomic Test 2: Create Hidden User using IsHidden option
Add a hidden user on macOS using IsHidden optoin
Supported Platforms: macos Elevation Required: Yes
sudo dscl . -create /Users/#{user_name} IsHidden 1
Atomic Test 3: Create Hidden User in Registry
Adversaries may similarly hide user accounts in Windows. Adversaries can set the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList Registry key value to 0 for a specific user to prevent that user from being listed on the logon screen. Reference https://attack.mitre.org/techniques/T1564/002/ and https://thedfirreport.com/2022/07/11/select-xmrig-from-sqlserver/
Supported Platforms: windows Elevation Required: Yes
NET USER #{user_name}$ #{user_password} /ADD /expires:never
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\Userlist" /v #{user_name}$ /t REG_DWORD /d 0
Manual Testing
If Atomic Red Team tests are not applicable, manually verify the technique by:
Identify Attack Surface: Determine if the target environment is susceptible to Hidden Users by examining the target platforms (macOS, Windows, Linux).
Assess Existing Defenses: Review whether mitigations for T1564.002 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Remediation Guide
M1028 Operating System Configuration
If the computer is domain joined, then group policy can help restrict the ability to create or hide users. Similarly, preventing the modification of the /Library/Preferences/com.apple.loginwindow Hide500Users value will force all users to be visible.
Detection
Detection Strategy for Hidden User Accounts
Risk Assessment
| Finding | Severity | Impact |
|---|---|---|
| Hidden Users technique applicable | Low | Defense Evasion |
CWE Categories
| CWE ID | Title |
|---|---|
| CWE-693 | Protection Mechanism Failure |