> For the complete documentation index, see [llms.txt](https://jtz.gitbook.io/web-security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jtz.gitbook.io/web-security/gong-ju/mi-ma-jie-mi/po-jie-hash/hashcat.md).

# Hashcat

## Hashid

> 检测各种哈希值
>
> * 哈希类型与其对应的编号---> [网页跳转](https://hashcat.net/wiki/doku.php?id=example_hashes)

```shell
# hashes.txt 是一个存储哈希值的文本文件
hashid hashes.txt 
```

## Hashcat

```shell
# Hashcat 语法
hashcat -a <type> -m <hash type> <hash file> <wordlist>

# 字典攻击
hashcat -a 0 -m 1400 sha256_hash_example ./rockyou.txt

# 组合攻击
hashcat -a 1 -m 0 combination_md5 wordlist1 wordlist2

# 掩码攻击 注解①
hashcat -a 3 -m 0 md5_mask_example_hash -1 01 'ILFREIGHT?l?l?l?l?l20?1?d'

# 使用单词列表的混合攻击，这条命令的作用是是在每一个单词的末尾加一个数字和特殊字符
hashcat -a 6 -m 0 ./rockyou.txt '?d?s'

# 使用带有掩码的单词列表的混合攻击
hashcat -a 7 -m 0 hybrid_hash_prefix -1 01 '20?1?d' ./rockyou.txt

# 破解哈希
hashcat -m 100 SHA1_hashes ./rockyou.txt
```

| 占位符 | 意义                                                        |
| --- | --------------------------------------------------------- |
| ?l  | 小写 ASCII 字母 (az)                                          |
| ?u  | 大写 ASCII 字母 (AZ)                                          |
| ?d  | 数字 (0-9)                                                  |
| ?h  | 0123456789abcdef                                          |
| ?H  | 0123456789ABCDEF                                          |
| ?s  | 特殊字符 («空格»!"#$%\&amp;'()\*+,-./:;\&lt;=\&gt; ?@ \[]^\_\`{ |
| ?a  | ?l?u?d?s                                                  |
| ?b  | 0x00 - 0xff                                               |


---

# 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://jtz.gitbook.io/web-security/gong-ju/mi-ma-jie-mi/po-jie-hash/hashcat.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.
