> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/wifi-pineapple-pager/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/wifi-pineapple-pager/wifi-pineapple-commands/device_filter.md).

# DEVICE\_FILTER

`PINEAPPLE_DEVICE_FILTER_ADD` - add a MAC address to a Pineapple WiFi device filter list

`PINEAPPLE_DEVICE_FILTER_ADD_FILE` - add a file of MAC addresses to a Pineapple WiFi device filter list

`PINEAPPLE_DEVICE_FILTER_DELETE` - remove a MAC address from a Pineapple WiFi device filter list

`PINEAPPLE_DEVICE_FILTER_DELETE_FILE` - delete a file of MAC addresses from a Pineapple WiFi device filter list

`PINEAPPLE_DEVICE_FILTER_CLEAR` - clear all MAC addresses from a Pineapple device filter list

`PINEAPPLE_DEVICE_FILTER_LIST` - print the contents of a Pineapple device filter list

`PINEAPPLE_DEVICE_FILTER_MODE` - Set the operational mode of the Pineapple device filter (`allow` or `deny`)

### When to use them <a href="#when-to-use-it" id="when-to-use-it"></a>

The [Pineapple filter](/wifi-pineapple-pager/pineapple-open-ap.md#pineapple-filters) system defines the scope of an engagement by controlling what devices are allowed to connect to a Pineapple access point.

The `PINEAPPLE_DEVICE_FILTER_...` commands provide a scriptable interface to manipulating the filter lists.

### PINEAPPLE\_DEVICE\_FILTER\_ADD <a href="#pineapple_device_filter_add" id="pineapple_device_filter_add"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_ADD [list (allow or deny)] {MAC address1 ... MAC addressN}
```

**list (allow or deny)&#x20;*****required***

Add one or more MAC addresses to the `allow` or `deny` device filter list.

**MAC address&#x20;*****required***

MAC addresses to add to the filter. MAC addresses should be of the form `aa:bb:cc:00:11:22`.

### PINEAPPLE\_DEVICE\_FILTER\_ADD\_FILE <a href="#pineapple_device_filter_add_file" id="pineapple_device_filter_add_file"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_ADD_FILE [list (allow or deny)] [file]
```

**list (allow or deny)&#x20;*****required***

Add one or more MAC addresses to the `allow` or `deny` device filter list.

**file&#x20;*****required***

File containing MAC addresses to add to the filter, one MAC address per line. MAC addresses should be of the form `aa:bb:cc:00:11:22`.

### PINEAPPLE\_DEVICE\_FILTER\_DELETE <a href="#pineapple_device_filter_delete" id="pineapple_device_filter_delete"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_DELETE [list (allow or deny)] {MAC address1 ... MAC addressN}
```

**list (allow or deny)&#x20;*****required***

Remove one or more MAC addresses from the `allow` or `deny` device filter list.

**MAC address&#x20;*****required***

MAC addresses to remove from the filter. MAC addresses should be of the form `aa:bb:cc:00:11:22`.

### PINEAPPLE\_DEVICE\_FILTER\_DELETE\_FILE <a href="#pineapple_device_filter_delete_file" id="pineapple_device_filter_delete_file"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_DELETE_FILE [list (allow or deny)] [file]
```

**list (allow or deny)&#x20;*****required***

Remove one or more MAC addresses from the `allow` or `deny` device filter list.

**file&#x20;*****required***

File containing MAC addresses to remove from the filter, one MAC address per line. MAC addresses should be of the form `aa:bb:cc:00:11:22`.

### PINEAPPLE\_DEVICE\_FILTER\_CLEAR <a href="#pineapple_device_filter_clear" id="pineapple_device_filter_clear"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_CLEAR [list (allow or deny)]
```

**list (allow or deny)&#x20;*****required***

List to clear (`allow` or `deny`)

### PINEAPPLE\_DEVICE\_FILTER\_LIST <a href="#pineapple_device_filter_list" id="pineapple_device_filter_list"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_LIST [list (allow or deny)]
```

**list (allow or deny)&#x20;*****required***

List to display (`allow` or `deny`)

### PINEAPPLE\_DEVICE\_FILTER\_MODE <a href="#pineapple_device_filter_mode" id="pineapple_device_filter_mode"></a>

#### Syntax <a href="#syntax" id="syntax"></a>

```none
PINEAPPLE_DEVICE_FILTER_MODE [mode (allow or deny)]
```

**mode (allow or deny)&#x20;*****required***

Filter mode.

`allow` permits *only* connections from devices in the allowed list of MAC addresses.

`deny` blocks connections from any device with a MAC address found in the denied list, and permits connections from all other devices.

### Results <a href="#results" id="results"></a>

The `PINEAPPLE_DEVICE_FILTER_...` commands exit with a return code of 0 on success and non-zero on failure.

The `PINEAPPLE_DEVICE_FILTER_...` commands take effect immediately.

### Examples <a href="#examples" id="examples"></a>

```bash
PINEAPPLE_MIMIC_DISABLE # disable openAP mimic while changing filters
PINEAPPLE_DEVICE_FILTER_CLEAR allow
PINEAPPLE_DEVICE_FILTER_ADD allow 00:DE:AD:BE:EF:00
PINEAPPLE_DEVICE_FILTER_ADD allow 01:02:FE:ED:FA:CE
PINEAPPLE_DEVICE_FILTER_MODE allow
PINEAPPLE_MIMIC_ENABLE # re-enable mimic mode
```

{% hint style="info" %}
Previously, these commands were named `PINEAPPLE_MAC_FILTER_...`; they have been updated to match the terms used in the UI more consistently. The old commands will still work, though!
{% endhint %}


---

# 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://documentation.hak5.org/wifi-pineapple-pager/wifi-pineapple-commands/device_filter.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.
