Skip to content
WETNav

Defense evasion · Windows

icacls.exe

icacls

Shows and changes file and folder permissions. Granting broad rights to a protected file, or resetting ACLs, is used to tamper with protected data and clear the way for other actions.

Legitimate use

Admins use it to view, grant, remove and back up NTFS permissions.

Worst caseMedium

Switches

/grant<value>

Grants permissions. grant:r replaces existing rights for the account.

Medium
/remove<value>

Removes an account's permissions.

Medium
/deny<value>

Adds a deny entry, which can lock others out of a file.

Medium
/reset

Resets permissions to those inherited from the parent, removing explicit entries.

Medium
/setowner<value>

Changes the owner of the object.

Medium
/t

Applies the change to the whole folder tree.

Low
/save<value>

Saves ACLs to a file.

Info

Command lines to worry about

  • Medium

    Full control granted to a broad group

    Granting full control to Everyone or Users on a file weakens its protection. Check which file and why.

    Detection regexicacls(\.exe)?\s+.*\/grant\s+\S*(everyone|users|authenticated users)\S*:\S*f

    T1222.001

Where it is recorded

  • Security4688Process creation with the full command line, when command-line auditing is enabled.
  • Sysmon1Process creation with command line, hashes and parent process.

Community detections

1 SigmaHQ rule for icacls.exe. The explainer checks every pasted command line against all of them.

Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.