题目描述
<?php include 'flag.php' ;
if (isset( $_GET [ 'code' ])){ $code = $_GET [ 'code' ];
if ( strlen ( $code )>35){
die ( "Long." );
}
if (preg_match( "/[A-Za-z0-9_$]+/" , $code )){
die ( "NO." );
}
@evaal( $code );
} else {
highlight_file( __FILE__ );
}
?>
|
初看到这题还以为是个原题,可以看phithon牛的一篇文章https://www.leavesongs.com/penetration/webshell-without-alphanum.html,但是这道题
不一样之处在于过滤了$,这个php变量符,导致我们无法继续像文中所说那样构造payload,不过这里还有一个办法,这办法不能getshell,也就只能读文件,
在于linux下可以用 "?" "*" "%" 当作命令替代符,经过测试 /bin/cat 可以用 /???/??? 来替代,那么我们便可以用cat命令打印出flag.
思路如下:
1.打印出flag.php的内容
2.继续匹配flag文件

Comments NOTHING