bugku 变量1

<?php  
error_reporting(0);//关闭php的报错
include "flag1.php";
highlight_file(__file__);
if(isset($_GET['args'])){
    $args = $_GET['args'];
    if(!preg_match("/^\w+$/",$args)){
        die("args error!");
    }
    eval("var_dump($$args);");
}
?>
\w:匹配任何非单词字符。等价于 ‘[^A-Za-z0-9_]’。【所有单个非大小写字母、非数字、非下划线】
 
$GLOBALS:这种全局变量用于在 PHP 脚本中的任意位置访问全局变量
 
调用超级全局变量
 

posted @ 2020-07-25 15:23  N_schema  阅读(138)  评论(0编辑  收藏  举报