target.php:
xas xjahs dajdh ajdhjas da d xxxx na dh ada hd
main.php:
<?php
// removal malicious script by forzadraco
$filename="target.php";
$existfile=@fopen($filename,"w");
if($existfile){
echo "file berhasil dibaca \n\n";
}else{
echo "file gagal dibaca \n\n";
}
if( false == ($str=file_get_contents( $filename )))
echo "Could not read file.";
else
echo "File contents: ".htmlspecialchars($str);
$hsl=preg_replace("/xxxx/i","draco",$str);
echo "<hr />".htmlspecialchars($hsl);
fwrite($existfile,$hsl);
fclose($existfile);
?>
why is not work ? and why target.php become empty file..?
thanks