> 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/precomputed-attacks/cracking-with-pyrit.md).

# 使用 Pyrit 破解

比较 Pyrit 和 Hashcat 的 WPA/WPA2 密码恢复速度。

此测试比较 Pyrit 和 Hashcat 的密码恢复性能。两个工具都使用相同的抓包和密码列表。

目标密码是 `92212345`.

### 提取哈希值

{% code overflow="wrap" %}

```bash
wpapcap2john Capture-01.cap > Hash
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FBgJnQlqevUGwHctHQEOu%2Fimage.png?alt=media&amp;token=ad68a432-389d-4f4e-a659-6a83b956a6bd" alt=""><figcaption></figcaption></figure>

查看提取出的哈希值：

{% code overflow="wrap" %}

```bash
cat Hash
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FAcUPjOW6i3nhuTgLGQ9j%2Fimage.png?alt=media&amp;token=1af8b366-7219-4145-8a8c-a67e9113ce5c" alt=""><figcaption></figcaption></figure>

### 创建密码列表

创建一个 `passwords.txt` 包含 100,000 个候选项的文件：

{% code overflow="wrap" %}

```bash
seq 92162345 92262345 > passwords.txt
```

{% endcode %}

### 使用 John 测试

运行恢复：

{% code overflow="wrap" %}

```bash
john --format=wpapsk -w=passwords.txt Hash
```

{% endcode %}

这大约需要 1 分 40 秒。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FDxzShpvXwL4QwYzEMbTF%2Fimage.png?alt=media&amp;token=5b09cae9-5833-46c6-8aa1-f34a2c96b0ba" alt=""><figcaption></figcaption></figure>

### 使用 Pyrit 测试

接下来，识别接入点名称。它是 `乔丹`.

{% code overflow="wrap" %}

```bash
echo -n "$(cat hash.22000 | cut -d'*' -f6)" | xxd -r -p
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FqopoiOvGLihEVzf1gSqY%2Fimage.png?alt=media&amp;token=f797d59c-bd2a-46d8-ae09-457cd5e1fa2b" alt=""><figcaption></figcaption></figure>

Pyrit 使用 `attack_passthrough` 用于计算 `PMK = PBKDF2(ESSID, password)` 对每个 `passwords.txt` 条目。它将每个结果与握手进行比较。

{% code overflow="wrap" %}

```bash
pyrit -r Capture-01.cap -e Jordan -i passwords.txt attack_passthrough
```

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FLETEIGXPISdlEAdv6XMi%2Fimage.png?alt=media&amp;token=0aa4de3a-be87-4d66-9ac6-b082d9d2ff1d" alt=""><figcaption></figcaption></figure>

这需要 1 分 29 秒。

### 与 Hashcat 比较

对应的 Hashcat 工作流程首先将抓包转换为：

```bash
hcxpcapngtool -o hash.22000 Capture-01.cap
```

然后运行恢复：

{% code overflow="wrap" %}

```bash
hashcat -m 22000 hash.22000 passwords.txt
```

{% endcode %}

这大约需要 1 分 30 秒。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FTu7R3kHyW2IE7T92ZEJx%2Fimage.png?alt=media&amp;token=5f641671-85ad-4152-ac26-43bf0f0522fc" alt=""><figcaption></figcaption></figure>


---

# 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/precomputed-attacks/cracking-with-pyrit.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.
