Access Mask Reference

The AccessMask field in Microsoft-Windows-Security-Auditing events 4656, 4663, 4657, 4661, and 4662 is a hexadecimal bitmask indicating the type of access requested or granted to an object. The meaning of the object-specific bits varies by object type: the same bit value represents different rights for files, registry keys, AD objects, and SAM objects.

Standard and Generic Rights#

These rights apply to all object types.

BitRightDescription
0x00010000DELETEDelete the object
0x00020000READ_CONTROLRead the security descriptor (DACL)
0x00040000WRITE_DACModify the DACL: change who can access the object
0x00080000WRITE_OWNERChange the object owner
0x00100000SYNCHRONIZEUse the object for synchronization
0x10000000GENERIC_ALLFull control
0x20000000GENERIC_EXECUTEExecute access
0x40000000GENERIC_WRITEWrite access
0x80000000GENERIC_READRead access

File and Directory Access Rights#

Microsoft-Windows-Security-Auditing Event 4656 and Event 4663: object access auditing for files and directories.

BitRightDescription
0x00000001FILE_READ_DATA / FILE_LIST_DIRECTORYRead file contents or list directory
0x00000002FILE_WRITE_DATA / FILE_ADD_FILEWrite to file or add a file to directory
0x00000004FILE_APPEND_DATA / FILE_ADD_SUBDIRECTORYAppend data to file or create subdirectory
0x00000008FILE_READ_EARead extended attributes
0x00000010FILE_WRITE_EAWrite extended attributes
0x00000020FILE_EXECUTE / FILE_TRAVERSEExecute file or traverse directory
0x00000040FILE_DELETE_CHILDDelete a file or directory within a directory
0x00000080FILE_READ_ATTRIBUTESRead file attributes
0x00000100FILE_WRITE_ATTRIBUTESWrite file attributes
0x00010000DELETEDelete the file or directory
0x00020000READ_CONTROLRead the security descriptor

Registry Key Access Rights#

Microsoft-Windows-Security-Auditing Event 4657: registry value modification.

BitRightDescription
0x00000001KEY_QUERY_VALUEQuery registry key values
0x00000002KEY_SET_VALUESet registry key values
0x00000004KEY_CREATE_SUB_KEYCreate subkeys
0x00000008KEY_ENUMERATE_SUB_KEYSEnumerate subkeys
0x00000010KEY_NOTIFYRequest change notifications
0x00000020KEY_CREATE_LINKCreate symbolic links
0x00000100KEY_WOW64_32KEYAccess 32-bit registry view
0x00000200KEY_WOW64_64KEYAccess 64-bit registry view

Active Directory Object Rights#

Microsoft-Windows-Security-Auditing Event 4662: an operation was performed on an Active Directory object.

BitRightDescription
0x00000001DS_CREATE_CHILDCreate child objects
0x00000002DS_DELETE_CHILDDelete child objects
0x00000004DS_LIST_CONTENTSList contents of the container
0x00000008DS_WRITE_SELFWrite self (validated writes)
0x00000010DS_READ_PROPRead all properties
0x00000020DS_WRITE_PROPWrite all properties
0x00000040DS_DELETE_TREEDelete the entire subtree
0x00000080DS_LIST_OBJECTList the object (visibility control)
0x00000100DS_CONTROL_ACCESSExtended rights (e.g. Replicating Directory Changes for DCSync)

SAM Object Rights#

Microsoft-Windows-Security-Auditing Event 4661: a handle to a SAM object was requested.

BitRightDescription
0x00000001ReadPasswordParametersRead password policy parameters
0x00000002WritePasswordParametersWrite password policy parameters
0x00000004ReadOtherParametersRead other domain parameters
0x00000008WriteOtherParametersWrite other domain parameters
0x00000010CreateUserCreate user accounts
0x00000020CreateGlobalGroupCreate global groups
0x00000040CreateLocalGroupCreate local groups
0x00000080GetLocalGroupMembershipEnumerate local group membership
0x00000100ListAccountsList all accounts in the domain
0x00000200LookupIDsResolve names to SIDs
0x00000400AdministerServerFull administrative access to the SAM

Commonly Monitored Access Patterns#

PatternTechniqueDetection
DS_CONTROL_ACCESS (0x100) on domain rootDCSync (Replicating Directory Changes)Event 4662 with DS_CONTROL_ACCESS on the domain partition DN from non-DC accounts
WRITE_DAC (0x40000)ACL backdoor: attacker grants themselves persistent accessEvent 4656/4663 with WRITE_DAC by non-owner/non-admin principals
WRITE_OWNER (0x80000)Ownership takeover to bypass ACLsEvent 4656/4663 from non-admin accounts
GENERIC_ALL (0x10000000)Full control requestedUnusual when targeting sensitive files, AD objects, or registry keys
FILE_WRITE_DATA (0x2) on sensitive pathsData tampering or log clearingEvent 4663 on security-relevant files (e.g. SAM, SYSTEM, SECURITY hives)
KEY_SET_VALUE (0x2) on Run keysRegistry persistenceEvent 4657 on HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and similar