直接看题源代码
1 <?php 2 ????$MY = create_function("","die(`cat flag.php`);"); 3 ????$hash = bin2hex(openssl_random_pseudo_bytes(32)); 4 ????eval("function SUCTF_$hash(){" 5 ????????."global \$MY;" 6 ????????."\$MY();" 7 ????????."}"); 8 ????if(isset($_GET[‘func_name‘])){ 9 ????????$_GET["func_name"]();10 ????????die();11 ????}12 ????show_source(__FILE__);
create_function的匿名函数也是有名字的,名字是\x00lambda_%d,其中%d代表他是当前进程中的第几个匿名函数,直接burp开启跑
SUCTF 2018——Anonymous(php匿名函数 \x00lambda_)
原文地址:https://www.cnblogs.com/leixiao-/p/9818602.html