hacktricks/cryptography/crypto-ctfs-tricks.md

316 lines
14 KiB
Markdown
Raw Normal View History

2023-08-03 19:12:22 +00:00
# Crypto CTFs 技巧
2022-04-28 16:01:33 +00:00
<details>
2023-08-03 19:12:22 +00:00
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks 云 ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 你在一家**网络安全公司**工作吗?想要在 HackTricks 中看到你的**公司广告**吗?或者你想要**获取最新版本的 PEASS 或下载 HackTricks 的 PDF**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 发现我们的独家 NFT 收藏品[**The PEASS Family**](https://opensea.io/collection/the-peass-family)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 获取[**官方 PEASS & HackTricks 商品**](https://peass.creator-spring.com)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**telegram 群组**](https://t.me/peass),或者**关注**我在**Twitter**上的[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- **通过向[hacktricks 仓库](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud 仓库](https://github.com/carlospolop/hacktricks-cloud)提交 PR 来分享你的黑客技巧。**
2022-04-28 16:01:33 +00:00
</details>
2023-08-03 19:12:22 +00:00
## 在线哈希数据库
2023-08-03 19:12:22 +00:00
* _**谷歌搜索**_
* [http://hashtoolkit.com/reverse-hash?hash=4d186321c1a7f0f354b297e8914ab240](http://hashtoolkit.com/reverse-hash?hash=4d186321c1a7f0f354b297e8914ab240)
* [https://www.onlinehashcrack.com/](https://www.onlinehashcrack.com)
* [https://crackstation.net/](https://crackstation.net)
* [https://md5decrypt.net/](https://md5decrypt.net)
* [https://www.onlinehashcrack.com](https://www.onlinehashcrack.com)
* [https://gpuhash.me/](https://gpuhash.me)
* [https://hashes.org/search.php](https://hashes.org/search.php)
* [https://www.cmd5.org/](https://www.cmd5.org)
* [https://hashkiller.co.uk/Cracker/MD5](https://hashkiller.co.uk/Cracker/MD5)
* [https://www.md5online.org/md5-decrypt.html](https://www.md5online.org/md5-decrypt.html)
2021-09-22 10:45:02 +00:00
2023-08-03 19:12:22 +00:00
## 魔术自动求解器
2021-09-22 10:45:02 +00:00
2022-04-05 22:24:52 +00:00
* [**https://github.com/Ciphey/Ciphey**](https://github.com/Ciphey/Ciphey)
2023-08-03 19:12:22 +00:00
* [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/) (魔术模块)
2022-04-05 22:24:52 +00:00
* [https://github.com/dhondta/python-codext](https://github.com/dhondta/python-codext)
2022-07-05 17:49:17 +00:00
* [https://www.boxentriq.com/code-breaking](https://www.boxentriq.com/code-breaking)
2023-08-03 19:12:22 +00:00
## 编码器
2023-08-03 19:12:22 +00:00
大多数编码数据可以使用以下两个资源进行解码:
* [https://www.dcode.fr/tools-list](https://www.dcode.fr/tools-list)
* [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/)
2023-08-03 19:12:22 +00:00
### 替换自动求解器
* [https://www.boxentriq.com/code-breaking/cryptogram](https://www.boxentriq.com/code-breaking/cryptogram)
2023-08-03 19:12:22 +00:00
* [https://quipqiup.com/](https://quipqiup.com) - 非常好!
2023-08-03 19:12:22 +00:00
#### 凯撒密码 - ROTx 自动求解器
* [https://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript](https://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript)
2023-08-03 19:12:22 +00:00
#### Atbash 密码
* [http://rumkin.com/tools/cipher/atbash.php](http://rumkin.com/tools/cipher/atbash.php)
2023-08-03 19:12:22 +00:00
### 基础编码自动求解器
2023-08-03 19:12:22 +00:00
使用以下链接检查所有这些基础编码:[https://github.com/dhondta/python-codext](https://github.com/dhondta/python-codext)
2022-02-05 13:50:50 +00:00
* **Ascii85**
2023-08-03 19:12:22 +00:00
* `BQ%]q@psCd@rH0l`
2022-02-05 13:50:50 +00:00
* **Base26** \[_A-Z_]
2023-08-03 19:12:22 +00:00
* `BQEKGAHRJKHQMVZGKUXNT`
* **Base32** \[_A-Z2-7=_]
2023-08-03 19:12:22 +00:00
* `NBXWYYLDMFZGCY3PNRQQ====`
2022-02-05 13:50:50 +00:00
* **Zbase32** \[_ybndrfg8ejkmcpqxot1uwisza345h769_]
2023-08-03 19:12:22 +00:00
* `pbzsaamdcf3gna5xptoo====`
2022-02-05 13:50:50 +00:00
* **Base32 Geohash** \[_0-9b-hjkmnp-z_]
2023-08-03 19:12:22 +00:00
* `e1rqssc3d5t62svgejhh====`
2022-02-05 13:50:50 +00:00
* **Base32 Crockford** \[_0-9A-HJKMNP-TV-Z_]
2023-08-03 19:12:22 +00:00
* `D1QPRRB3C5S62RVFDHGG====`
2022-02-05 13:50:50 +00:00
* **Base32 Extended Hexadecimal** \[_0-9A-V_]
2023-08-03 19:12:22 +00:00
* `D1NMOOB3C5P62ORFDHGG====`
2022-07-05 17:49:17 +00:00
* **Base45** \[_0-9A-Z $%\*+-./:_]
2023-08-03 19:12:22 +00:00
* `59DPVDGPCVKEUPCPVD`
2022-02-05 13:50:50 +00:00
* **Base58 (bitcoin)** \[_1-9A-HJ-NP-Za-km-z_]
2023-08-03 19:12:22 +00:00
* `2yJiRg5BF9gmsU6AC`
2022-02-05 13:50:50 +00:00
* **Base58 (flickr)** \[_1-9a-km-zA-HJ-NP-Z_]
2023-08-03 19:12:22 +00:00
* `2YiHqF5bf9FLSt6ac`
2022-02-05 13:50:50 +00:00
* **Base58 (ripple)** \[_rpshnaf39wBUDNEGHJKLM4PQ-T7V-Z2b-eCg65jkm8oFqi1tuvAxyz_]
2023-08-03 19:12:22 +00:00
* `pyJ5RgnBE9gm17awU`
* **Base62** \[_0-9A-Za-z_]
2023-08-03 19:12:22 +00:00
* `g2AextRZpBKRBzQ9`
* **Base64** \[_A-Za-z0-9+/=_]
2023-08-03 19:12:22 +00:00
* `aG9sYWNhcmFjb2xh`
2022-07-05 17:49:17 +00:00
* **Base67** \[_A-Za-z0-9-_.!\~\_]
2023-08-03 19:12:22 +00:00
* `NI9JKX0cSUdqhr!p`
2022-07-05 17:49:17 +00:00
* **Base85 (Ascii85)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_]
2023-08-03 19:12:22 +00:00
* `BQ%]q@psCd@rH0l`
2022-07-05 17:49:17 +00:00
* **Base85 (Adobe)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_]
2023-08-03 19:12:22 +00:00
* `<~BQ%]q@psCd@rH0l~>`
2022-07-05 17:49:17 +00:00
* **Base85 (IPv6 or RFC1924)** \[_0-9A-Za-z!#$%&()\*+-;<=>?@^_\`{|}\~\_]
2023-08-03 19:12:22 +00:00
* `Xm4y`V\_|Y(V{dF>\`
2022-07-05 17:49:17 +00:00
* **Base85 (xbtoa)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_]
2023-08-03 19:12:22 +00:00
* `xbtoa Begin\nBQ%]q@psCd@rH0l\nxbtoa End N 12 c E 1a S 4e6 R 6991d`
2022-07-05 17:49:17 +00:00
* **Base85 (XML)** \[_0-9A-Za-y!#$()\*+,-./:;=?@^\`{|}\~z\__]
2023-08-03 19:12:22 +00:00
* `Xm4y|V{~Y+V}dF?`
2022-07-05 17:49:17 +00:00
* **Base91** \[_A-Za-z0-9!#$%&()\*+,./:;<=>?@\[]^\_\`{|}\~"_]
2023-08-03 19:12:22 +00:00
* `frDg[*jNN!7&BQM`
2022-02-05 13:50:50 +00:00
* **Base100** \[]
2023-08-03 19:12:22 +00:00
* `👟👦👣👘👚👘👩👘👚👦👣👘`
2022-02-05 13:50:50 +00:00
* **Base122** \[]
2023-08-03 19:12:22 +00:00
* `4F ˂r0Xmvc`
* **ATOM-128** \[_/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC_]
2023-08-03 19:12:22 +00:00
* `MIc3KiXa+Ihz+lrXMIc3KbCC`
* **HAZZ15** \[_HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5_]
2023-08-03 19:12:22 +00:00
* `DmPsv8J7qrlKEoY7`
2022-02-05 13:50:50 +00:00
* **MEGAN35** \[_3G-Ub=c-pW-Z/12+406-9Vaq-zA-F5_]
2023-08-03 19:12:22 +00:00
* `kLD8iwKsigSalLJ5`
* **ZONG22** \[_ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2_]
2023-08-03 19:12:22 +00:00
* `ayRiIo1gpO+uUc7g`
* **ESAB46** \[]
2023-08-03 19:12:22 +00:00
* `3sHcL2NR8WrT7mhR`
* **MEGAN45** \[]
2023-08-03 19:12:22 +00:00
* `kLD8igSXm2KZlwrX`
* **TIGO3FX** \[]
2023-08-03 19:12:22 +00:00
* `7AP9mIzdmltYmIP9mWXX`
* **TRIPO5** \[]
2023-08-03 19:12:22 +00:00
* `UE9vSbnBW6psVzxB`
* **FERON74** \[]
2023-08-03 19:12:22 +00:00
* `PbGkNudxCzaKBm0x`
* **GILA7** \[]
2023-08-03 19:12:22 +00:00
* `D+nkv8C1qIKMErY1`
* **Citrix CTX1** \[]
2023-08-03 19:12:22 +00:00
* `MNGIKCAHMOGLKPAKMMGJKNAINPHKLOBLNNHILCBHNOHLLPBK`
2022-07-05 17:49:17 +00:00
[http://k4.cba.pl/dw/crypo/tools/eng\_atom128c.html](http://k4.cba.pl/dw/crypo/tools/eng\_atom128c.html) - 404 Dead: [https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html)
2022-07-05 17:49:17 +00:00
### HackerizeXS \[_╫Λ↻├☰┏_]
```
╫☐↑Λ↻Λ┏Λ↻☐↑Λ
```
2023-08-03 19:12:22 +00:00
* [http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html) - 404 页面不存在: [https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html)
2023-08-03 19:12:22 +00:00
### 摩尔斯密码
```
.... --- .-.. -.-. .- .-. .- -.-. --- .-.. .-
```
2023-08-03 19:12:22 +00:00
* [http://k4.cba.pl/dw/crypo/tools/eng\_morse-encode.html](http://k4.cba.pl/dw/crypo/tools/eng\_morse-encode.html) - 404 页面不存在: [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/)
2023-08-03 19:12:22 +00:00
### UU编码器
```
begin 644 webutils_pl
M2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(
M3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/
F3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$$`
`
end
```
* [http://www.webutils.pl/index.php?idx=uu](http://www.webutils.pl/index.php?idx=uu)
2023-08-03 19:12:22 +00:00
### XX编码器
```
begin 644 webutils_pl
hG2xAEIVDH236Hol-G2xAEIVDH236Hol-G2xAEIVDH236Hol-G2xAEIVDH236
5Hol-G2xAEE++
end
```
* [www.webutils.pl/index.php?idx=xx](https://github.com/carlospolop/hacktricks/tree/bf578e4c5a955b4f6cdbe67eb4a543e16a3f848d/crypto/www.webutils.pl/index.php?idx=xx)
2022-07-05 17:49:17 +00:00
### YEncoder
2023-08-03 19:12:22 +00:00
### YEncoder
YEncoder是一种简单的编码技术用于将二进制数据转换为可打印字符。它通常用于绕过防火墙或过滤器以便在网络上传输二进制数据。
YEncoder的工作原理如下
1. 将每个字节拆分为两个4位的字节。
2. 将每个4位的字节转换为可打印字符。
3. 将所有转换后的字符连接起来,形成编码后的字符串。
要解码YEncoder编码的数据只需按照相反的步骤进行操作即可。
在CTF比赛中YEncoder常常用于隐藏敏感信息或绕过简单的过滤器。因此了解如何使用YEncoder进行编码和解码是非常有用的。
```
=ybegin line=128 size=28 name=webutils_pl
ryvkryvkryvkryvkryvkryvkryvk
=yend size=28 crc32=35834c86
```
* [http://www.webutils.pl/index.php?idx=yenc](http://www.webutils.pl/index.php?idx=yenc)
2022-07-05 17:49:17 +00:00
### BinHex
2023-08-03 19:12:22 +00:00
BinHex是一种将二进制数据转换为可打印ASCII字符的编码方法。它通常用于在电子邮件或其他文本传输中传输二进制文件。BinHex编码使用16进制数字和字母来表示二进制数据。要解码BinHex编码的文件可以使用专门的解码工具或在线解码服务。
```
(This file must be converted with BinHex 4.0)
:#hGPBR9dD@acAh"X!$mr2cmr2cmr!!!!!!!8!!!!!-ka5%p-38K26%&)6da"5%p
-38K26%'d9J!!:
```
* [http://www.webutils.pl/index.php?idx=binhex](http://www.webutils.pl/index.php?idx=binhex)
2022-07-05 17:49:17 +00:00
### ASCII85
2023-08-03 19:12:22 +00:00
ASCII85是一种编码方案用于将二进制数据转换为可打印的ASCII字符。它类似于Base64编码但具有更高的密度。在CTF比赛中你可能会遇到使用ASCII85编码的加密数据。要解码ASCII85编码你可以使用在线工具或编写自己的解码脚本。
```
<~85DoF85DoF85DoF85DoF85DoF85DoF~>
```
* [http://www.webutils.pl/index.php?idx=ascii85](http://www.webutils.pl/index.php?idx=ascii85)
2023-08-03 19:12:22 +00:00
### Dvorak键盘
```
drnajapajrna
```
2023-08-03 19:12:22 +00:00
* [https://www.geocachingtoolbox.com/index.php?lang=zh\&page=dvorakKeyboard](https://www.geocachingtoolbox.com/index.php?lang=zh\&page=dvorakKeyboard)
2022-07-05 17:49:17 +00:00
### A1Z26
2023-08-03 19:12:22 +00:00
字母对应的数字值
```
8 15 12 1 3 1 18 1 3 15 12 1
```
2023-08-03 19:12:22 +00:00
### 仿射密码编码
2023-08-03 19:12:22 +00:00
将字母转换为数字 `(ax+b)%26`(其中 _a__b_ 是密钥_x_ 是字母),然后将结果转换回字母
```
krodfdudfrod
```
2023-08-03 19:12:22 +00:00
### 短信代码
2023-08-03 19:12:22 +00:00
**多键输入法** [通过对应的按键代码在手机[键盘](https://www.dcode.fr/phone-keypad-cipher)上重复数字来替换字母](https://www.dcode.fr/word-letter-change)(在编写短信时使用此模式)。\
例如2=A22=B222=C3=D...\
您可以通过看到\*\*多个重复的数字\*\*来识别此代码。
2023-08-03 19:12:22 +00:00
您可以在以下网址解码此代码:[https://www.dcode.fr/multitap-abc-cipher](https://www.dcode.fr/multitap-abc-cipher)
2023-08-03 19:12:22 +00:00
### 培根密码
2023-08-03 19:12:22 +00:00
将每个字母替换为4个A或B或1和0
```
00111 01101 01010 00000 00010 00000 10000 00000 00010 01101 01010 00000
AABBB ABBAB ABABA AAAAA AAABA AAAAA BAAAA AAAAA AAABA ABBAB ABABA AAAAA
```
2023-08-03 19:12:22 +00:00
### 符文
![](../.gitbook/assets/runes.jpg)
2023-08-03 19:12:22 +00:00
## 压缩
2023-08-03 19:12:22 +00:00
**Raw Deflate** 和 **Raw Inflate**(你可以在 Cyberchef 中找到)可以在没有头部的情况下压缩和解压数据。
2023-08-03 19:12:22 +00:00
## 简单加密
2023-08-03 19:12:22 +00:00
### 异或 - 自动求解器
* [https://wiremask.eu/tools/xor-cracker/](https://wiremask.eu/tools/xor-cracker/)
2022-07-05 17:49:17 +00:00
### Bifid
2023-08-03 19:12:22 +00:00
需要一个关键词
```
fgaargaamnlunesuneoa
```
2023-08-03 19:12:22 +00:00
### 维吉尼亚密码
2023-08-03 19:12:22 +00:00
需要一个关键字
```
wodsyoidrods
```
* [https://www.guballa.de/vigenere-solver](https://www.guballa.de/vigenere-solver)
* [https://www.dcode.fr/vigenere-cipher](https://www.dcode.fr/vigenere-cipher)
* [https://www.mygeocachingprofile.com/codebreaker.vigenerecipher.aspx](https://www.mygeocachingprofile.com/codebreaker.vigenerecipher.aspx)
2023-08-03 19:12:22 +00:00
## 强加密
2022-07-05 17:49:17 +00:00
### Fernet
2023-08-03 19:12:22 +00:00
2个base64字符串令牌和密钥
```
Token:
gAAAAABWC9P7-9RsxTz_dwxh9-O2VUB7Ih8UCQL1_Zk4suxnkCvb26Ie4i8HSUJ4caHZuiNtjLl3qfmCv_fS3_VpjL7HxCz7_Q==
Key:
-s6eI5hyNh8liH7Gq0urPC-vzPgNnxauKvRO4g03oYI=
```
* [https://asecuritysite.com/encryption/ferdecode](https://asecuritysite.com/encryption/ferdecode)
2023-08-03 19:12:22 +00:00
### Samir秘密分享
2023-08-03 19:12:22 +00:00
一个秘密被分成X个部分要恢复它你需要Y个部分_Y <=X_
```
8019f8fa5879aa3e07858d08308dc1a8b45
80223035713295bddf0b0bd1b10a5340b89
803bc8cf294b3f83d88e86d9818792e80cd
```
2023-08-03 19:12:22 +00:00
### OpenSSL暴力破解
* [https://github.com/glv2/bruteforce-salted-openssl](https://github.com/glv2/bruteforce-salted-openssl)
2022-07-05 17:49:17 +00:00
* [https://github.com/carlospolop/easy\_BFopensslCTF](https://github.com/carlospolop/easy\_BFopensslCTF)
2023-08-03 19:12:22 +00:00
## 工具
* [https://github.com/Ganapati/RsaCtfTool](https://github.com/Ganapati/RsaCtfTool)
* [https://github.com/lockedbyte/cryptovenom](https://github.com/lockedbyte/cryptovenom)
* [https://github.com/nccgroup/featherduster](https://github.com/nccgroup/featherduster)
2022-04-28 16:01:33 +00:00
<details>
2023-08-03 19:12:22 +00:00
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks云 ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 你在一个**网络安全公司**工作吗想要在HackTricks中**宣传你的公司**吗?或者你想要**获取PEASS的最新版本或下载HackTricks的PDF**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品——[**The PEASS Family**](https://opensea.io/collection/the-peass-family)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- 获取[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**电报群组**](https://t.me/peass),或者**关注**我在**Twitter**上的[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
- **通过向[hacktricks repo](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享你的黑客技巧**。
2022-04-28 16:01:33 +00:00
</details>