# AppLocker

## Overview

> AppLocker can be used to create rules that specify which applications are allowed to run, based on a variety of criteria, including the file path, publisher, file hash, and version. AppLocker can also be used to create rules that block specific applications or types of applications from running.

## Enumerating AppLocker policies

```powershell
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections
```

<figure><img src="/files/Iu8oK0FI98viwCVh4YYH" alt=""><figcaption></figcaption></figure>

## Bypassing examples

### Trusted folder

In AppLocker, a Trusted folder is a designated folder or set of folders that are exempt from application control policies. If the default AppLocker rules are applied, you should be able to execute executables from Read/Write/Executable folders within `C:\Program Files\` and `C:\Windows`.

#### To locate Writeable and executable folder

**Using accesschk.exe:**

```powershell
accesschk.exe "student" C:\Windows -wus
```

<figure><img src="/files/pF8fPn7lb5cbU9C06jkt" alt=""><figcaption></figcaption></figure>

**Verify they are executable:**

```powershell
icacls.exe C:\Windows\Tasks
```

<figure><img src="/files/CBX2WTKc0GbTH30FEqVQ" alt=""><figcaption></figcaption></figure>

### Unmanaged DLLs

AppLocker default rule set does not protect against loading arbitrary DLLs.

## References

{% embed url="<https://github.com/milkdevil/UltimateAppLockerByPassList>" %}

{% embed url="<https://github.com/api0cradle/UltimateAppLockerByPassList/blob/master/VerifiedAppLockerBypasses.md>" %}


---

# Agent Instructions: 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:

```
GET https://rfc1918.gitbook.io/offsec/defence-evasion/applocker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
