Home >Backend Development >PHP Tutorial >How to remove web viruses with PHP_PHP tutorial

How to remove web viruses with PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:35:505628browse

It seems to be some replacement operations, you can test it

Class clear_virus{
public $index =b.html;
public $filepath =array(b.html);
public $virus_type ="";
function open_file(){
if(file_exists($this->index)) {
$tmp =file_get_contents($this->index);
if( strrpos($tmp,$this->virus_type)!== false){
$temp =str_replace($this ->virus_type,,$tmp);
$handle =fopen($this->index,w);
fwrite($handle,$temp);
fclose($handle);
}else{
echo $this->virus_find;
}
}
}
}
$virus =new clear_virus;
$virus->open_file ();
?>
Clear script virus

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508291.htmlTechArticleIt seems to be doing some replacement operations. You can test it?php Class clear_virus{ public $index =b.html; public $filepath =array(b.html); public $virus_type ="script src=http://%61%76...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn