<?php
Class clear_virus{
  public $index  ='b.html';
  public $filepath =array('b.html'); 
  public $virus_type ="<script src=http://%61%76%65%33%2E%63%6E></script>";
  
  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();
?>
上面的代码可以把感染文件与病毒文件保存到一txt文本中去再用file函数读取,这样会更方便,上面只是最简单的,过几天再修改一编
本站原创转载请注明:http://www.111cn.cn