thc-BloodMiamiAI 聊天框渗透测试工具,使用 C 编写。向聊天界面发送 语言(SQL/NoSQL/XSS/SSTI)和 提示词 注入载荷,并标记出成功触发的那些——DB 错误字符串、反射的脚本标记、模型越狱信号。快速、多线程、基于 libcurl。
功能说明语言注入(-i L)——SQLi、NoSQL、XSS、JS 注入探测;将响应与错误/特征列表进行匹配(mysql_fetch_array、ORA-01756、<script>、onerror= 等)提示词注入(-i P)——越狱/提示词覆盖探测;将命中结果分级为 Low(模型混淆)、Medium(可能绕过)、Critical(越狱信号)多线程 发送器——可调并发数(-c,默认 10)自定义请求头、user-agent、超时、详细 模式、结果输出到文件(-o)wordlist/language.txt、wordlist/prompt.txt构建git clone https://github.com/foxcornlab/thc-BloodMiami.git
cd thc-BloodMiami
# deps: gcc, make, libcurl dev headers
sudo apt install libcurl4-openssl-dev # debian/ubuntu
make
用法# language injection scan
./build/bloodmiami -t https://example.com/chat -i L -d wordlist/language.txt
# prompt injection scan, verbose, results to file
./build/bloodmiami -t https://example.com/chat -i P -d wordlist/prompt.txt -v -o results.txt
# 20 threads, 10s timeout, custom header
./build/bloodmiami -t https://example.com/chat -i L -d wordlist/language.txt -c 20 -T 10 \
-H "Authorization: Bearer <token>"
Usage: bloodmiami [OPTIONS]
Required:
-t, --target URL Target chat interface URL
-i, --injection TYPE Injection type: L (language) or P (prompt)
-d, --dictionary FILE Dictionary file with payloads
Optional:
-v, --verbose Enable verbose output
-T, --timeout SEC Request timeout in seconds (default: 5)
-U, --user-agent STR Custom User-Agent string
-H, --header STR Add custom HTTP header
-c, --concurrency NUM Concurrent requests (default: 10)
-o, --output FILE Save results to file
-h, --help Show help
-V, --version Show version
工作原理字典中的每一行都会变成一个 POST 请求(Content-Type: application/json),载荷嵌入到聊天风格的 JSON 请求体中。响应体会被扫描以查找:
SQL 错误——mysql_fetch_array、ORA-01756、Unclosed quotation mark、PostgreSQL query failed 等NoSQL 错误——MongoError、BSONObj、WriteResult 等XSS 标记——<script>、javascript:、onerror=、document.cookie 等JS 错误——SyntaxError、ReferenceError、eval( 等HTTP 5xx——标记为可能的注入触发的服务器错误载荷在嵌入前会进行 JSON 转义,因此字典中的引号/反斜杠不会破坏请求体。TLS 验证被有意禁用(CURLOPT_SSL_VERIFYPEER=0)——这是一个测试工具,请仅在实验/授权目标上使用。
载荷字典wordlist/language.txt——SQLi(UNION、基于错误、基于时间)、NoSQL 操作符、XSS 向量、SSTI 探测wordlist/prompt.txt——越狱尝试、角色扮演覆盖、系统提示词提取探测、间接注入标记添加你自己的:每行一个载荷,# 用于注释。载荷会原样发送到目标,因此请仅将其指向你被允许测试的系统。
免责声明仅用于授权的安全测试和研究。在将此工具指向任何你不拥有的目标之前,你有责任获得许可。
致谢开源安全社区——载荷思路和特征列表libcurl——承担所有繁重的 HTTP 工作由
Vineeth Kumar(foxcornlab)研究。发现 bug 或想要新功能,请提交issue。