ItsMeBrille/ctf-tools
GitHub: ItsMeBrille/ctf-tools
CTF工具速查集合,涵盖多类别安全工具的快速入门命令和Docker使用示例。
Stars: 5 | Forks: 0
# CTF 工具
这是一个 CTF 工具集合,附带了快速入门命令指南。
## 目录
## Linux 常用工具
### 更改 IP
```
ip addr add 192.168.1.1/24 dev eth0
```
### 快速 SSH 文件复制
```
echo "tar cvfz - ." | ssh server > loot.tgz
tar -xvzf loot.tgz
```
### 修复 GitHub remote origin SSH 认证
```
git remote set-url origin $(git remote get-url origin | sed -E 's#https://github.com/#git@github.com:#')
```
## 密码学 (Crypto)
### dCode.fr
[密码标识器](https://www.dcode.fr/cipher-identifier)
[哈希标识器](https://www.dcode.fr/hash-identifier)
### RsaCtfTool
该工具旨在解密来自弱公钥的数据,并尝试恢复相应的私钥。此外,该工具提供了全面的攻击选项,使用户能够应用各种策略来破解加密。RSA 的安全性核心在于整数分解问题的复杂性。该项目通过结合多种整数分解算法,有效地增强了整体解密能力,是一个宝贵的资源。
```
docker run -it --rm -v "$PWD":/data rsactftool/rsactftool
[-h]
[--publickey PUBLICKEY]
[--output OUTPUT]
[--timeout TIMEOUT]
[--createpub]
[--dumpkey]
[--ext]
[--decryptfile DECRYPTFILE]
[--decrypt DECRYPT]
```
欲了解更多用法,请参阅 [RsaCtfTool](https://github.com/RsaCtfTool/RsaCtfTool)。
## 破解 (Cracking)
### CrackStation
使用彩虹表攻击查找哈希密码。
[crackstation.net](https://crackstation.net/)
### Hashcat
尝试识别哈希类型:
```
hashcat -a 0 hash.txt rockyou.txt
```
#### 设置 `-m` 以破解特定的哈希类型。
- `-a 0` — **Straight / Dictionary(直接/字典)**。尝试字典中的单词(可使用规则)。
- `-a 1` — **Combination(组合)**。连接两个字典中的单词。
- `-a 3` — **Brute-force / Mask(暴力/掩码)**。尝试字符集掩码的所有组合。
- `-a 6` — **Hybrid (wordlist + mask)(混合:字典 + 掩码)**。字典条目 + 掩码。
- `-a 7` — **Hybrid (mask + wordlist)(混合:掩码 + 字典)**。掩码 + 字典条目。
使用字典破解哈希(-m 设置哈希类型)
hashcat 列表:https://hashcat.net/wiki/doku.php?id=example_hashes
```
hashcat -m 0 -a 0 hash.txt rockyou.txt
```
暴力破解特定模式:
```
hashcat -m 0 -a 3 hash.txt ?u?u?d?d?d?d?d
```
### CeWLeR
[roys/cewler](https://github.com/roys/cewler) 是一个用于从 URL 生成字典的程序。
```
docker run --rm -v "$PWD":/w ghcr.io/ItsMeBrille/cewler:latest --output /w/wordlist.txt https://example.com
```
### bkcrack
你可以像这样查看名为 `archive.zip` 的归档文件中的条目名称和元数据列表:
```
./bkcrack -L archive.zip
```
使用 ZipCrypto 加密的条目容易受到已知明文攻击。
```
bkcrack -j 4 -C challenge.zip -c challenge.iso -x 0x8001 4344303031 -x 0x8010
202020202020202020202020202020202020202020202020
```
找到密钥后移除密码
```
./bkcrack -C secrets.zip -k c4490e28 b414a23d 91404b31 -D secrets_without_password.zip
```
| **选项** | **描述** |
|---|---|
| `-C `| 包含密文条目的 Zip 归档 |
| `-c ` | 包含密文的 Zip 条目/文件 |
| `-p ` | 包含明文的 Zip 条目/文件 |
| `-P ` | 包含明文条目的 Zip 归档|
| `-x ` | 从给定偏移量开始的十六进制额外明文(可为负数)|
| `--continue-attack `| 继续中断攻击的起点|
| `-j `| 并行操作的线程数|
| `-L `| 列出 zip 归档中的条目并退出|
| `-k `| 作为三个 32 位十六进制整数的内部密码表示|
| `-D ` | 创建带有解密条目的 zip 归档副本(移除密码保护)|
| `-r .. ` | 创建带有解密条目的 zip 归档副本(移除密码保护)|
恢复密码:
```
./bkcrack -k 18f285c6 881f2169 b35d661d -r 9..12 ?p
```
暴力破解的字符集如下:
| **快捷方式** | **描述** |
|--------------|----------------------------|
| `?l` | 小写字母 |
| `?d` | 十进制数字 |
| `?a` | 字母数字字符 |
| `?p` | 可打印 ASCII 字符 |
| `?b` | 全范围 (0x00 - 0xff) |
## 取证 (Forensics)
### Eric Zimmerman's tools
[Eric Zimmerman's tools](https://ericzimmerman.github.io/#!index.md)
| 名称 | 用途 |
|--------------------|---------|
| [Timeline Explorer](https://download.ericzimmermanstools.com/net9/TimelineExplorer.zip) | 轻松查看 CSV 和 Excel 文件,进行过滤、分组、排序等 |
| [Registry Explorer](https://download.ericzimmermanstools.com/net9/RegistryExplorer.zip) | 注册表查看器,支持搜索、多 Hive 支持、插件等。可处理锁定文件 |
| [EvtxECmd](https://download.ericzimmermanstools.com/net9/EvtxECmd.zip) | 事件日志 解析器,具有标准化的 CSV、XML 和 JSON 输出;支持锁定文件 |
| [RECmd](https://download.ericzimmermanstools.com/net9/RECmd.zip) | 强大的命令行注册表工具,支持搜索、多 Hive 支持、插件 |
### Volatility
Volatility 是世界上用于从易失性内存 (RAM) 样本中提取数字 artifacts 最广泛使用的框架。提取技术完全独立于被调查的系统,但能提供对系统运行时状态的可见性。该框架旨在向人们介绍与从易失性内存样本中提取数字 artifacts 相关的技术和复杂性,并为进一步研究这一激动人心的领域提供一个平台。
链接:[Volatility](https://github.com/volatilityfoundation/volatility) / [Volatility 3](https://github.com/volatilityfoundation/volatility3)
如何使用 Volatility 3:
```
docker run -it --rm -v "$PWD":/workspace sk4la/volatility3 -f dump.dmp windows.pslist
```
通过追加你想要的插件来修改命令:
| **Plugin** | **描述** | **命令行示例** |
| --- | --- | --- |
| **pslist** | 通过扫描内存中的进程结构列出活动进程,提供 PID、名称等。 | `windows.pslist` |
| **pstree** | 以树状格式显示进程,展示父子关系。 | `windows.pstree` |
| **dlllist** | 列出每个进程加载的 DLL,用于识别注入的 DLL 或异常库。 | `windows.dlllist --pid ` |
| **handles** | 显示每个进程的打开句柄,可包括文件、注册表键或其他对象。 | `windows.handles --pid ` |
| **malfind** | 检测潜在的恶意代码注入和可执行内存区域,突出显示可疑活动。 | `windows.malfind --pid ` |
| **cmdline** | 提取每个进程的命令行参数,用于识别可疑的进程启动。 | `windows.cmdline --pid ` |
| **netscan** | 列出网络连接和监听端口,提供对活动或已终止网络连接的洞察。 | `windows.netscan` |
| **ssdt** | 显示系统服务描述符表 (SSDT),帮助识别 rootkit 的系统调用挂钩。 | `windows.ssdt` |
| **filescan** | 扫描内存中的文件对象,用于恢复文件或识别已删除/恶意文件。 | `windows.filescan` |
| **registry** | 从内存中提取注册表 Hive,允许恢复关键系统和用户信息。 | `windows.registry` |
## 逆向 (Reversing)
## PWN
### pwntools
文档:[pwntools.com](https://docs.pwntools.com/)
```
pip install pwntools
```
快速缓冲区溢出示例:
```
from pwn import *
# process('./binary')
p = remote(host, port)
offset = 20
payload = b'A'*offset + p32(0x00000000)
p.sendline(payload)
p.interactive()
```
## OSINT
### Overpass turbo
解释器:https://overpass-turbo.eu/
关于[如何使用 Overpass QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL) 的文档。以下是查询时使用的不同键的列表:
[键值对](https://taginfo.openstreetmap.org/search#keys) 数据库
简单用法:
```
area["name:en"="Norway"];
node(area)[highway=bus_stop];
node(around:100)[amenity=cinema];
out;
```
有用的键以及查找更多信息的链接:
| **Key** | **Way** | **Node** |
|---------|----------|-----------|
| [highway](https://wiki.openstreetmap.org/wiki/Key:highway) | motorway, road, footway, cycleway, pedestrian, service, track | bus_stop |
| [amenity](https://wiki.openstreetmap.org/wiki/Key:amenity) | hospital, restaurant, library, school, pharmacy, place_of_worship, cafe, kindergarten, police | fountain, bench, toilet, bank, charging_station, fuel |
| [leisure](https://wiki.openstreetmap.org/wiki/Key:leisure) | park, garden, playground, swimming_pool, pitch, stadium, golf_course | — |
| [shop](https://wiki.openstreetmap.org/wiki/Key:shop) | — | bakery, supermarket, clothes, electronics, furniture, hairdresser, bookstore, pet, jeweller, music |
| [railway](https://wiki.openstreetmap.org/wiki/Key:railway) | rail, subway, tram, tunnel | platform, halt, crossing, station |
| [building](https://wiki.openstreetmap.org/wiki/Key:building) | house, apartment, barn, church, school, hospital, office, warehouse, museum, hotel, post_office, cinema, theatre | — |
| [aeroway](https://wiki.openstreetmap.org/wiki/Key:aeroway) | runway | helipad |
| [power](https://wiki.openstreetmap.org/wiki/Key:power) | line, generator | substation, tower |
| [man_made](https://wiki.openstreetmap.org/wiki/Key:man_made) | pier, bridge, tower | - |
| [military](https://wiki.openstreetmap.org/wiki/Key:military) | camp, base | bunker, checkpoint |
| [water](https://wiki.openstreetmap.org/wiki/Key:water) | reservoir, tank | well, spring |
以下是一些有用的设置元素:
| **Element** | **Description** |
|------------------------------------|-----------------------------------------------------------------------------------|
| `[out:json];` | 将结果格式指定为 JSON(备选:`out:xml`, `out:csv`)。 |
| `timeout` | 设置查询超时时间(秒)(例如 `[timeout:30];` 表示 30 秒)。 |
| `{{bbox}}` | 表示当前边界框,将查询限制在可见区域。 |
| `(.result;.result >;) -> .result;` | 扩展结果以包含相关元素,例如将路径显示为节点。 |
| `,i` | 使标签匹配不区分大小写。 |
| `~` | 匹配包含指定模式的标签值。 |
| Settings for Output | 控制返回的数据量,例如 `out body`, `out skel`, 或 `out count`. |
#### 高级示例
```
area["name"="Oslo"]->.a;
node(area.a)[shop=electronics][brand~"power", i]->.result;
```
```
// Area
area[name="Oslo"]->.a;
// Secondary Schools
way(area.a)[amenity=school][grades~"8-10|1-10"]->.schools;
// Count schools
.schools out count;
// Display schools
(.schools;.schools >;) -> .display;
.display out;
```
```
[out:json];
// Area
(
area["name"="Oslo"];
area["name"="Bærum"];
)->.a;
// Bus stops
node(area.a)[highway=bus_stop]->.bus_stops;
// Elkjøp (not phonehouse) close to bus stops
(
node(around.bus_stops: 1000)[shop][name~"elkjøp", i];
- node(area.a)[shop][name~"phone", i];
)->.result;
.result out;
```
## 渗透测试
### Nmap
Nmap 是一款免费的网络扫描工具,用于通过分析对各种数据包和请求的响应来发现网络上的主机和服务。
安装:
```
sudo apt-get install nmap
```
用法:
```
nmap [] []
```
[速查表](https://www.geeksforgeeks.org/nmap-cheat-sheet/)
## Web
### PayloadsAllTheThings
[PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings) 是一个包含大量 payload 的大合集,用于 XSS、SQLi 和模板注入等攻击。
### tshark
#### 安装:
```
apt install tshark
```
#### 用法:
```
tshark -f "port 31337" -w capture.pcap
```
跟踪 tcp 流:
```
tshark -r capture.pcap -qz follow,tcp,ascii,0
```
你可以像在应用程序中一样在命令行中使用 `-Y` 进行过滤:
```
tshark -r capture.pcap -Y 'frame contains "flag"' -V
```
### Webhook
[Webhook.site](https://webhook.site/) 是一个用于接收 HTTP 请求的工具。它提供了一个唯一的 URL 来捕获和检查传入的请求,包括标头、payload 和元数据。
1. 在 [Webhook.site](https://webhook.site/) 生成一个唯一的 URL。
2. 使用你的工具或应用程序发送请求:
curl -X POST -d "param=value" https://webhook.site/
### Gobuster
Gobuster 是一个用于对 Web 服务器进行目录和文件暴力破解的工具。它可以通过猜测目录、文件或 DNS 子域名来发现 Web 服务器上的隐藏资源。
它通常与 [CeWLeR](#cewler) 结合使用
```
docker run --rm -v "$PWD":/mnt ghcr.io/oj/gobuster:latest dir -u www.example.com -w /mnt/common.txt
```
Gobuster 常用的字典是 [common.txt](Scripts/common.txt)。要将其与上面的示例一起使用,请下载该文件并在同一目录中运行命令。
| `Short Name` | `Description` | `Example Command` |
|---|---|---|
| `dir` | 使用字典对 Web 服务器上的目录和文件进行暴力破解,以发现隐藏资源,如 `/admin`, `/backup` 等。 | `dir -u www.example.com -w /mnt/` |
| `fuzz` | 使用字典对 URL 中的自定义模糊测试点进行暴力破解,以发现隐藏参数或端点。 | `fuzz -u www.example.com/FUZZ -w /mnt/` |
| `dns` | 使用字典对给定域名的子域名进行暴力破解,以查找隐藏或未记录的子域名(例如 `test.example.com`)。 | `dns -d example.com -w /mnt/` |
| `vhost` | 通过使用不同的主机名暴力破解虚拟主机,以发现托管在同一服务器上的不同网站。 | `vhost -u www.example.com -w /mnt/` |
| `s3` | 通过暴力破解存储桶名称来扫描公开可访问的 AWS S3 存储桶。 | `s3 -b -w /mnt/` |
标签:AlienVault OTX, Bitdefender, CTI, Cutter, DNS 反向解析, Hashcat, meg, RSA, RsaCtfTool, StruQ, VEH, 信息安全, 加密解密, 反病毒测试, 字典攻击, 安全脚本, 密码学, 应用安全, 彩虹表, 手动系统调用, 数据编码, 离线攻击, 网络安全, 请求拦截, 资源汇总, 逆向工具, 速查表, 隐私保护