> For the complete documentation index, see [llms.txt](https://infra.newerasec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infra.newerasec.com/infrastructure-testing/privilege-esclation/windows/icacls.md).

# icacls

icacls is a command-line utility that can be used to modify NTFS file system permissions in Windows Server 2003 SP2, Windows Server 2008, Windows Vista and Windows 7. It builds on the functionality of similar previous utilities, including cacls, Xcacls.exe, Cacls.exe, and Xcacls.vbs.  &#x20;

**example**:&#x20;

```
PS htb\amanda@SIZZLE documents> icacls clean.bat 
clean.bat NT AUTHORITY\SYSTEM:(I)(F) 
          BUILTIN\Administrators:(I)(F) 
          HTB\Administrator:(I)(F) 
          HTB\amanda:(I)(F) 
```

**Change permissions:**&#x20;

icacls C:\PS /grant  John:M&#x20;

**Remove permissions:**&#x20;

icacls C:\PS /remove John&#x20;

Opposed to each group and the user’s access level is specified. Access rights are indicated using abbreviations. Consider the permissions for the user CORP\someusername. The following permissions are assigned to this user:&#x20;

* (OI) — object inherit&#x20;
* (CI) — container inherit&#x20;
* (M) —  modify access&#x20;

This means that this user has the rights to write and modify data in this directory. These rights are inherited to all child objects in this directory.&#x20;

Below is a complete list of permissions that can be set using the icacls utility:&#x20;

iCACLS inheritance settings:&#x20;

* (OI)  —  object inherit&#x20;
* (CI)  —  container inherit&#x20;
* (IO)  —  inherit only&#x20;
* (NP)  —  don’t propagate inherit&#x20;
* (I)  — permission inherited from parent container&#x20;

List of basic access permissions:&#x20;

* D  —  delete access&#x20;
* F  —  full access&#x20;
* N  —  no access&#x20;
* M  —  modify access&#x20;
* RX  —  read and eXecute access&#x20;
* R  —  read-only access&#x20;
* W  —  write-only access&#x20;

Detailed permissions:&#x20;

* DE  —  delete&#x20;
* RC  —  read control&#x20;
* WDAC  —  write DAC&#x20;
* WO  — write owner&#x20;
* S  —  synchronize&#x20;
* AS  —  access system security&#x20;
* MA  —  maximum allowed permissions&#x20;
* GR  —  generic read&#x20;
* GW  —  generic write&#x20;
* GE  —  generic execute&#x20;
* GA  —  generic all&#x20;
* RD  —  read data/list directory&#x20;
* WD  —  write data/add file&#x20;
* AD  — append data/add subdirectory&#x20;
* REA  —  read extended attributes&#x20;
* WEA  —  write extended attributes&#x20;
* X  —  execute/traverse&#x20;
* DC  —  delete child&#x20;
* RA  —  read attributes&#x20;
* WA  —  write attributes&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://infra.newerasec.com/infrastructure-testing/privilege-esclation/windows/icacls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
