fileclude 攻防世界 web 未完成。
这题给了代码,看

<?php include("flag.php"); highlight_file(__FILE__); if(isset($_GET["file1"]) && isset($_GET["file2"])) { $file1 = $_GET["file1"]; $file2 = $_GET["file2"]; if(!empty($file1) && !empty($file2)) { if(file_get_contents($file2) === "hello ctf") { include($file1); } } else die("NONONO"); }
调用一个名为flag的php文件,高亮。
以get方式接收file1,file2两个,赋值给file1和file2.
if(!empty($file1) && !empty($file2)) 这个的作用主要就是保证这俩变量中有值,然后接
if(file_get_contents($file2) === "hello ctf") 读取file2所有内容,3=于hello ctf。包含并执行由$file1指定的文件内容
如果不全部等于hello ctf就输出nonono。
浙公网安备 33010602011771号