## 一、简介
- 在我们取得目标哈希或者遇到受密码保护的文件时,需要取得解密密码或明文密码,此时就可以使用`hashcat`、`john`来进行密码破解,以此取得我们想要的。
## 二、示例
### 2.1 使用格式
- `hashcat`:`hashcat -m modle <hash/hash_file> <dict.list>`
- `john`:`john hash_file --wordlist=dict.list`
### 2.2 使用须知
#### 2.2.1 john
- 对于文件而言,需要率先使用 `*2john*` 将指定文件转换为特定哈希,而后配合 `john` 对文件加密密码进行破解
- 查找 `office` 文件转换哈希
- `locate *2john* | grep office`

#### 2.2.2 hashcat
- `hashcat` 支持多种破解方式,可以使用 `hashcat -h` 配合 `grep` 快速筛选定位
- 查找指定加密方式的破解编号
- `hashcat -h | grep sha512`

### 2.1 NTLM破解
- `hashcat -m 1000 a3210b00e1f55f00d6c1f9ddaafbb5e8 /usr/share/wordlists/rockyou.txt`

### 2.2 Linux哈希破解
- 常用加密方式
| 关键字 | 加密方式 | 解密模式 |
| ------ | ----------- | -------- |
| $1$ | MD5 | 500 |
| $2a$ | Blowfish | 3200 |
| $2y$ | Eksblowfish | |
| $5$ | SHA-256 | 7400 |
| $6$ | SHA-512 | 1800 |
- `hashcat -m 1800 '$6$zDoTvOy/LYaXkQ4e$6PEm.1XYLp2ojaXoGf7WkTjdzgHNclE36qcPy6xIqRcO9EsWmW9sCuLYHQK329/b33nSNCoWAiqlwaTnRxS2.1' /usr/share/wordlists/rockyou.txt`

### 2.3 私钥密码破解
- 将文件转换为特定哈希保存
- `ssh2john id_rsa > ssh.hash`
- 破解指定哈希文件
- `john ssh.hash --wordlist=mut_password1.list`

### 2.4 压缩包密码破解
- 将文件转换为特定哈希保存
- `zip2john flag.zip > zip.hash`
- 破解指定哈希文件
- `john zip.hash --wordlist=mut_password1.list`

### 2.5 密码管理器加密破解
- 补充:[keeppass](https://keepass.info/) 是一款密码管理器,用以保存用户的文件免于被第三方打开使用

### 2.6 BitLocker加密破解
- 补充:[BitLocker](https://learn.microsoft.com/en-us/windows/security/operating-system-security/data-protection/bitlocker/) 是`windows`自带的安全机制,用以保存用户的文件免于被第三方打开使用

## 三、在线解密网站
- https://www.cmd5.com/
- https://crackstation.net/
## 四、参考链接
- [hashcat使用](https://zhuanlan.zhihu.com/p/652772880)
- [john使用](https://www.cnblogs.com/HelloCTF/p/13346125.html)

密码突破