Clear Web page virus Method _php Tutorial

Source: Internet
Author: User
Clear Web page virus method haha, this time upgrade, previously saved in the data are now all in TXT file saved in the outside, such a benefit is not easy to be modified Oh,
Exit ();
Class clear_virus{
Public $content;
Public $infectFile = ' virus.txt ';//virus file list file
Public $savefile = "save.txt";//The list of files where the virus is viewed
Public $TIMEP = ' time.txt ';//Some records clear the virus time
Public $checkFile = ' index.php ';
Public $run = 0;
Public $virus _type;
Public $replace;
Public $filepath;

function Open_file () {
$this->check_file ();
if ($this->run) {
$this->update_time ();
foreach ($this->filepath as $tmppath) {
if (file_exists ($tmppath)) {
$tmp =file_get_contents ($tmppath);
if (Strrpos ($tmp, $this->virus_type)!== false) {
$temp =str_replace ($this->replace, ", $tmp);
$handle =fopen ($tmppath, ' w ');
Fwrite ($handle, $temp);
Fclose ($handle);
Unset ($temp);
}else{
;
}
}else{
;
}
}
}
}

function Check_file () {
if (file_exists ($this->checkfile)) {
$temp =file_get_contents ($this->checkfile);
if (Strrpos ($temp, $this->virus_type)!== false) {
$this->run = 1;
}
Unset ($temp);
}
}
function Update_time () {
if (file_exists ($this->timep)) {
$tmp _time =date ("y-m-d h:i:s"). Chr (13). ' | ';
$tmp _fp =fopen ($this->timep, ' A + ');
Fwrite ($tmp _fp, $tmp _time);
Fclose ($tmp _fp);
}

}


function Read_file () {
if (file_exists ($this->savefile)) {
$this->content =file ($this->savefile);
if (Is_array ($this->content)) {
$this->filepath = $this->content;
}else{
;
}
}else{
;
}
}


function Read_virus () {
if (file_exists ($this->infectfile)) {
$this->replace =file ($this->infectfile);
if (Is_array ($this->replace)) {
$this $virus _type = $this->replace;
}else{
;
}
}else{
;
}
}

}
$virus =new Clear_virus;
$virus->open_file ();
?>
Please make it clear that the original article on this site, please specify to place. Www.111cn.cn/phper/php.html

http://www.bkjia.com/PHPjc/630496.html www.bkjia.com true http://www.bkjia.com/PHPjc/630496.html techarticle Clear Web page virus method haha, this upgrade, previously saved in the data are now all saved in the TXT file outside, so the benefits are not easy to be modified Oh,? PHP exit (); Class clear_virus{//...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.