FILE_DACL

Use FILE_DACL to verify the discretionary access control list (DACL) permissions on a file or folder. The check compares the target's access control entries (ACEs) against the entries you define inline, without requiring a separate <file_acl> block. This makes it a self-contained replacement for the older FILE_PERMISSIONS check type.

Note: This check requires SMB access to the target Windows system and sufficient permissions to read the file or folder security descriptor.

Usage

<custom_item>

type: FILE_DACL

description: ["description"]

file: ["file or folder path"]

dacl: ["principal"] || ["right"] || ["scope"]

dacl: ["principal"] || ["right"] || ["scope"]

(optional) dacl: ["principal"] || ["right"] || ["scope"] || ["inheritance"]

(optional) check_type: [CHECK_EQUAL|CHECK_SUBSET|CHECK_SUBSET_USER|CHECK_SUPERSET]

(optional) acl_option: [CAN_BE_NULL]

</custom_item>

The following predefined paths can be used in the file field:

%SystemDrive%

%SystemRoot%

%WinDir%

%ProgramFiles%

%CommonProgramFiles%

%AllUsersProfile%

Each dacl line defines one access control entry (ACE). The fields are separated by the || operator, in the order:

"principal" || "right" || "scope" [|| "inheritance"]

The following describes each segment of a dacl line:

  • principal — The user or group name, or a raw SID string (for example Administrators, SYSTEM, Users, CREATOR OWNER). Principal names are compared case-insensitively.
    • To assign multiple granular rights to one principal, use multiple dacl lines for that principal. The rights are OR'd together.
  • right — A single file permission. Supported values: full control, modify, read & execute, list folder contents, read, write, traverse folder / execute file, list folder / read data, read attributes, read extended attributes, create files / write data, create folders / append data, write attributes, write extended attributes, delete subfolder and files, delete, read permissions, change permissions, take ownership.
  • scope — Which objects the ACE applies to. Supported values: this folder only, this folder, subfolders and files, this folder and subfolders, this folder and files, subfolders and files only, subfolders only, files only.
  • inheritance — Optional fourth segment that controls how the ACE is matched against the system's inheritance flags. Supported values: not inherited (default), inherited, not used.

Additional field notes:

  • Use file to specify the full path to the file or folder (for example, C:\WINDOWS\SYSTEM32) or a predefined path keyword. If you use a path keyword, the remote registry must be enabled so that Nessus can resolve the variable value.
  • check_type — Determines how the policy ACL is compared against the system ACL. Defaults to CHECK_EQUAL when omitted.
  • CHECK_EQUAL—- Requires an exact match.
  • CHECK_SUBSET — Requires the policy ACEs to be a subset of the system ACEs.
  • CHECK_SUBSET_USER — Same as CHECK_SUBSET, but ignores principals present on the system that are not listed in the policy.
  • CHECK_SUPERSET — Requires the system rights to be greater than or equal to the policy rights.
  • acl_option — Set to CAN_BE_NULL to pass the check if the file does not exist.

Examples

Verify a subset of permissions on the system drive root:

<custom_item>

type: FILE_DACL

description: "System drive root permissions"

file: "%SystemDrive%\"

dacl: "Administrators" || "full control" || "this folder, subfolders and files"

dacl: "SYSTEM" || "full control" || "this folder, subfolders and files"

check_type: CHECK_SUBSET_USER

</custom_item>

Specify multiple granular rights for a single principal:

<custom_item>

type: FILE_DACL

description: "Windows directory - Users have read & execute"

file: "%SystemRoot%"

dacl: "Users" || "read & execute" || "this folder, subfolders and files"

dacl: "Users" || "list folder contents" || "this folder, subfolders and files"

dacl: "Administrators" || "full control" || "this folder, subfolders and files"

dacl: "SYSTEM" || "full control" || "this folder, subfolders and files"

check_type: CHECK_SUBSET_USER

</custom_item>

Pass when an optional file may not be present:

<custom_item>

type: FILE_DACL

description: "Optional application file - check if exists"

file: "%ProgramFiles%\Example\config.dat"

dacl: "Administrators" || "full control" || "this folder, subfolders and files"

acl_option: CAN_BE_NULL

check_type: CHECK_SUBSET

</custom_item>

Comparison with the legacy FILE_PERMISSIONS style

The older FILE_PERMISSIONS check requires a separate <file_acl> block referenced by value_data:

<file_acl:"ACL1">

  <user:"Administrators">

    acl_inheritance : "not inherited"

    acl_apply       : "this folder, subfolders and files"

    acl_allow       : 'full control'

  </user>

  <user:"SYSTEM">

    acl_inheritance : "not inherited"

    acl_apply       : "this folder, subfolders and files"

    acl_allow       : 'full control'

  </user>

</file_acl>

 

<custom_item>

type: FILE_PERMISSIONS

description: "Permissions for the Windows directory"

value_type: FILE_ACL

value_data: "ACL1"

file: "%SystemRoot%"

check_type: CHECK_SUBSET

</custom_item>

The equivalent self-contained FILE_DACL check:

<custom_item>

type: FILE_DACL

description: "Permissions for the Windows directory"

file: "%SystemRoot%"

dacl: "Administrators" || "full control" || "this folder, subfolders and files"

dacl: "SYSTEM" || "full control" || "this folder, subfolders and files"

check_type: CHECK_SUBSET

</custom_item>