Access Mask Reference

The AccessMask field in Microsoft-Windows-Security-Auditing events Event ID 4656: A handle to an object was requested, Event ID 4663: An attempt was made to access an object, Event ID 4661: A handle to an object was requested, and Event ID 4662: An operation was performed on an object is a hexadecimal bitmask whose meaning depends on the event: 4656 records requested rights, while 4663 records rights used on 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.

Event 4657 records a registry value change using fields such as ObjectValueName, OperationType, OldValue, and NewValue; its documented schema has no AccessMask. See Microsoft’s 4657 schema.

For the surrounding model, see Security Descriptors and Access Checks.

Standard and Generic Rights#

Standard rights describe operations shared by many object types; support depends on the object. Registry keys do not support SYNCHRONIZE. Generic rights map to rights for the particular object type. See standard rights and registry-key rights.

BitRightDescription
0x00010000DELETEDelete the object
0x00020000READ_CONTROLRead the security descriptor except its SACL
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 ID 4656: A handle to an object was requested and Event ID 4663: An attempt was made to access an object: 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 except its SACL

Registry Key Access Rights#

Interpret registry-key rights in 4656 and 4663 with ObjectType=Key. A key’s DACL is distinct from the values stored beneath the key. Microsoft’s registry-key reference defines these rights and view-selection flags.

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_LINKReserved for system use
0x00000200KEY_WOW64_32KEYSelect the 32-bit registry view (flag, not a permission)
0x00000100KEY_WOW64_64KEYSelect the 64-bit registry view (flag, not a permission)

Active Directory Object Rights#

Microsoft-Windows-Security-Auditing Event ID 4662: An operation was performed on an object: 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 ID 4661: A handle to an object was requested: 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#

PatternInterpretationDetection
DS_CONTROL_ACCESS (0x100) on domain rootDCSync (Replicating Directory Changes)Event ID 4662: An operation was performed on an object with DS_CONTROL_ACCESS on the domain partition DN from non-DC accounts
WRITE_DAC (0x40000)Right to modify the DACL; not proof of an ACL backdoorEvent ID 4656: A handle to an object was requested/Event ID 4663: An attempt was made to access an object with WRITE_DAC by non-owner/non-admin principals
WRITE_OWNER (0x80000)Right to change ownership; not proof that ownership changedEvent ID 4656: A handle to an object was requested/Event ID 4663: An attempt was made to access an object 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 pathsFile write access; additional context is needed to establish tamperingEvent ID 4663: An attempt was made to access an object on security-relevant files (e.g. SAM, SYSTEM, SECURITY hives)
KEY_SET_VALUE (0x2) on Run keysRight to change a value; not proof of persistenceEvent ID 4656/4663 with registry object type and this right; separately, 4657 can record the value change without an access-mask field

A 4656 request does not establish later use; 4663 records use of a right. Neither a mask nor a rule match by itself establishes malicious intent. For a permission change, inspect 4670 and its old/new descriptors under the required audit configuration. Microsoft’s 4656 documentation and 4663 documentation distinguish requests from use.