bateMD/dnsbin

GitHub: bateMD/dnsbin

一个轻量级的带外(OOB)DNS 与 HTTP 回调日志服务器,通过 Telegram 实时推送回调事件,用于辅助检测和验证无回显的盲类型安全漏洞。

Stars: 1 | Forks: 0

dnsbin

功能安装基本用法高级用法配置许可证

一个带 Telegram 通知的 DNS 和 HTTP 回调日志的带外交互服务器,专为授权的安全测试工作流而构建。 ## 功能 - **DNS 回调日志** - 监听 UDP `:53`,解析查询,并在查询与您配置的域匹配时通过 Telegram 发送通知。 - **HTTP 回调日志** - 捕获所有 HTTP 路由 (`/*`),并通过 Telegram 通知源 IP 和回调路径。 - **Telegram 通知** - 将启动状态和运行时的 DNS/HTTP 事件发送到一个或多个 chat ID。 - **简单的 DNS 响应** - 返回 `A` 记录响应 (`127.0.0.1`) 和可配置的 `TXT` 记录响应 (`txt_value`)。 - **配置文件 + CLI 标志** - 通过 YAML 配置文件 (`--config`) 或直接使用标志运行,以便进行快速测试。 - **Docker 就绪部署** - 包含 `Dockerfile` 和 `docker-compose.yaml`,可快速完成设置。 ## 安装 ### 从 GitHub Releases 安装 从 [Releases](https://github.com/dunghm19/dnsbin/releases) 页面下载最新的预编译二进制文件。 ### 使用 Docker(本地构建,无公共镜像) ``` $ git clone https://github.com/dunghm19/dnsbin.git $ cd dnsbin $ cp config.example.yaml config.yaml # 在运行前编辑 config.yaml $ docker compose up -d ``` ### 从源码构建 Linux/macOS: ``` $ git clone https://github.com/dunghm19/dnsbin.git $ cd dnsbin $ make linux # or: make windows, make mac ``` ## 基本用法 * **步骤 1:** 准备包含域和 Telegram 设置的配置。 ``` $ cp config.example.yaml config.yaml ``` * **步骤 2:** 使用配置文件运行 DNSBin。 ``` $ dnsbin -c config.yaml ``` 或者使用 Docker: ``` $ docker compose up -d $ docker compose logs -f dnslog ``` * **步骤 3:** 触发回调并检查 Telegram 消息。 ``` # DNS 回调 $ dig test.oob.yourdomain.com # DNS TXT 回调 $ dig txt payload.oob.yourdomain.com # HTTP 回调(捕获任何路径) $ curl http://YOUR_SERVER_IP/test-payload ``` ## 高级用法 1. 直接使用标志运行(无需配置文件)。 ``` $ dnsbin \ --dns-domain "oob.yourdomain.com" \ --http-server-address "0.0.0.0:80" \ --http-log "https://oob.yourdomain.com" \ --txt-value "dnsbin" \ --tgtk "123456:ABCDEF..." \ --tgids "123456789,-1001234567890" ``` 2. 快速查看可用的命令和标志。 ``` $ dnsbin --help $ dnsbin version ``` 示例帮助输出: ``` Dnsbin is a DNS and HTTP callback logging server with Telegram notifications. Usage: dnsbin [flags] dnsbin [command] Available Commands: help Help about any command version Print version and exit Flags: -c, --config string Path to the YAML configuration file --debug Enable debug logging with verbose output --dns-domain string Base domain used for DNS query logging -h, --help help for dnsbin --http-log strings HTTP endpoints to capture and log requests --http-server-address string HTTP server listen address (host:port) (default "0.0.0.0:80") --tgids string Comma-separated Telegram chat IDs (numeric; group IDs are usually negative) --tgtk string Telegram bot token from BotFather (format: numeric_id:secret) --txt-value string TXT record response value (default "dnsbin") Use "dnsbin [command] --help" for more information about a command. ``` ## 配置 将 `config.example.yaml` 复制为 `config.yaml` 并调整相应的值: ``` http_server_address: 0.0.0.0:80 dns_domain: "oob.yourdomain.com" txt_value: "dnsbin" http_log: - "https://oob.yourdomain.com" notify: - type: telegram bot_token: "123456:ABCDEF..." chat_ids: "123456789,-1001234567890" ``` ### DNS 设置 使用 NS 委派(推荐): ``` oob.yourdomain.com. IN NS ns1.yourdomain.com. ns1.yourdomain.com. IN A YOUR_SERVER_IP ``` 或使用泛解析记录: ``` *.oob.yourdomain.com. IN A YOUR_SERVER_IP ``` ### 注意事项 - `chat_ids` 必须为数字,多个 chat 可以用逗号分隔。 - 端口 `53` 和 `80` 可能需要 root/管理员权限。 - 当提供 `--config` 时,运行时的值将从配置文件中加载。 ## 许可证 本项目仅用于授权的安全测试和教育目的。
标签:DNSLog, DNS回调, EVTX分析, Go语言, HTTP回调, IP 地址批量处理, OOB, RCE检测, SSRF检测, Telegram通知, XXE检测, 交互式服务器, 域名解析记录, 带外安全测试, 日志审计, 盲打漏洞检测, 程序破解, 网络安全, 请求拦截, 隐私保护