> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/hacking-wifi/wpa-wpa2-psk-network-attacks/fundamentals/mac-address-spoofing-and-tips.md).

# MAC 地址欺骗与提示

在有范围限制的无线评估中安全检查、更改、验证并恢复适配器的 MAC 地址。

更改适配器的 MAC 地址可用于隐私测试和有限范围的无线评估。请仅在你拥有或已获授权评估的设备上进行测试。

{% hint style="warning" %}
不要使用 MAC 地址冒充其他设备或绕过访问控制。
{% endhint %}

### 开始之前

记录适配器的永久 MAC 地址。稍后恢复正常操作时需要用到它。

替换 `wlan0mon` 在本指南中始终使用你的活动无线接口。

### 1. 检查当前地址

查看当前和永久 MAC 地址：

```bash
macchanger -s wlan0mon
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FfMoCl3IxKiZVif0DYpaj%2F%7BEBE2303B-FEA8-454A-BA9C-12F25254BEC7%7D.png?alt=media&amp;token=cfc40f07-ee16-4bd5-83e1-84762b07b825" alt=""><figcaption></figcaption></figure>

永久地址属于适配器硬件。当前地址可以临时更改。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F2MgLcus5UUOwGajCTfW2%2Fimage.png?alt=media&amp;token=3597f615-8957-4843-b0a7-b57d21367dc2" alt="" width="405"><figcaption></figcaption></figure>

### 2. 更改地址

在更改其 MAC 地址之前，先将接口关闭：

```bash
ip link set dev wlan0mon down
```

分配一个随机 MAC 地址：

```bash
macchanger -r wlan0mon
```

将接口重新启用：

```bash
ip link set dev wlan0mon up
```

### 3. 验证更改

确认新地址：

```bash
macchanger -s wlan0mon
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FajeSJE98NV8dW8cNtSiU%2Fimage.png?alt=media&amp;token=99ae0196-322c-494a-9043-cec226977343" alt=""><figcaption></figcaption></figure>

### 4. 恢复永久地址

实验结束后恢复硬件 MAC 地址：

```bash
ip link set dev wlan0mon down
macchanger -p wlan0mon
ip link set dev wlan0mon up
```

### 操作说明

* 更改后的地址通常会在重启适配器或系统后重置。
* 更改 MAC 地址可能会中断现有的 Wi‑Fi 或 DHCP 连接。
* 对于有限范围的测试，请使用本地管理或随机生成的地址。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/hacking-wifi/wpa-wpa2-psk-network-attacks/fundamentals/mac-address-spoofing-and-tips.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
