0x01、Web
1.NiZhuanSiWei-[ZJCTF 2019]-[PHP伪协议]-[传送门->BUUCTF]
第一步:打开环境,点击题目链接,进行代码审计
<?php
$text = $_GET["text"]; //GET传参:text
$file = $_GET["file"]; //GET传参:file
$password = $_GET["password"]; //GET传参:password
if(isset($text)&&(file_get_contents($text,'r')==="welcome to the zjctf")){
echo "<br><h1>".file_get_contents($text,'r')."</h1></br>";
if(preg_match("/flag/",$file)){
echo "Not now!";
exit();
}else{
include($file); //useless.php //提示文件包含useless.php
$password = unserialize($password); //反序列化password变量
echo $password; //打印password变量
}
}
else{
highlight_file(__FILE__); //高亮显示当前页面源码
}
?>
第二步:思路
条件1:t