virus?

Thanks guys, I checked my plugins and it looks okay.

Wasn't sure mainly because I thought that if the issue was with Adobe, it might be platform independent. Glad to hear the virus makers have the same problems with cross-platfrom compatibility as the rest of us. 😉

Thanks again for the assistance,
Q
Erin, here's my script to find and clean infected PHP files. Like I said, it is somewhat crude. It works as follows:
It iterates every PHP, HTML and HTM file in the CWD and every sub directory recursively searching for text in the $fingerprints array. If a match is found the file is considered to be infected, and the start and end fingerprints are searched for. If the script cannot find both a start and end fingerprint then the malware patch is cloaked differently than the already known fingerprints, and a warning message is displayed, the HTML is dumped, and it is then an easy process to manually find the start and end of the patch, and add that text to the fingerprint arrays.

If you run this script without passing any parameters then it only searches for the fingerprint and does not repair. Add "?repair=1" to the URL and the script will clean using the start and end fingerprints.

In my case all instances of the infection contained the string '102,117,110,99,116', so I only needed a single fingerprint to find the infected files. These fingerprints may or may not work for you.

Name the file "clean_worm.php", otherwise the script will scan itself, find the fingerprint, and try to clean itself. That filename is ignored.

Code:
<?php

//2009 Dan East

$dorepair=$_GET['repair']==1;

//These are the fingerprints used to recognize an infection.
$fingerprints=array(
   '102,117,110,99,116'
);

//NOTE: If the script finds an infection but reports "Unable to find start or end of infection" then
//examine the dumped html / php and add the appropriate beginning or ending string to the following arrays.

//NOTE: PHP fingerprints must be listed BEFORE html-only fingerprints, otherwise the script will not remove
//the PHP wrappers but only the HTML it inserts

//All encountered beginning text for the injected malware
$startfingerprints=array(
   "<?php echo ''; ?>",
   "<script type=\"text/javascript\">eval(String.fromCharCode(102",
   "<script type=\"text/javascript\">eval(String.fromCharCode(118"
);

//All encountered  ending text for the injcted malware
$endfingerprints=array(
   "49,50,51))</script>'; ?>",
   "49,50,52))</script>'; ?>",
   "56,50,52))</script>'; ?>",
   "50,50,50))</script>'; ?>",
   "51,56,50))</script>'; ?>",
   "49,50,51))</script>",
   "56,50,52))</script>",
   "50,50,50))</script>"
);

$infected = array();

function processDirectory( $path = '.', $level = 0 ){
   global $dorepair, $fingerprints, $startfingerprints, $endfingerprints, $infected;
   
   //Types of files to process
   $filetypes = array( '.html', '.htm', '.php');
   
    // Directories to ignore when listing output. Many hosts   
    // will deny PHP access to the cgi-bin.
    $ignore = array( 'cgi-bin', '.', '..' );
   

    $dh = @opendir( $path );
    // Open the directory to the handle $dh
   
    while( false !== ( $file = readdir( $dh ) ) ){
    // Loop through the directory
   
        if( !in_array( $file, $ignore ) ){
        // Check that this file is not to be ignored
           
            $spaces = str_repeat( '&nbsp;', ( $level * 4 ) );
            // Just to add spacing to the list, to better
            // show the directory tree.
           
            if( is_dir( "$path/$file" ) ){
                // It's a directory, so we need to keep recursing...
                processDirectory( "$path/$file", ($level+1) );           
            } else {
            foreach($filetypes as $type)
               if (substr($file, strlen($file)-strlen($type)) == $type && $file!='clean_worm.php') {
                  //echo "Scanning: $spaces $file<br />";
                  $contents=file_get_contents("$path/$file");
                  foreach ($fingerprints as $fingerprint)
                     if (strpos($contents, $fingerprint) !== FALSE) {
                        echo "<font color=red>Infected: $spaces $file</font><br />";
                        $infected[]="$path/$file";
                        $posstart=$posend=FALSE;
                        foreach ($startfingerprints as $startfingerprint)
                           if (($posstart=strpos($contents, $startfingerprint)) !==FALSE)
                              break;
                        foreach ($endfingerprints as $endfingerprint)
                           if (($posend=strpos($contents, $endfingerprint)) !==FALSE) {
                              $posend+=strlen($endfingerprint);
                              break;
                           }
                        if ($posstart === FALSE || $posend === FALSE) {
                           echo 'Unable to find start or end of infection.<br>';
                           echo htmlspecialchars($contents);   
                        } else if ($posend-$posstart > 1300)
                           //Safety check to make sure we didn't catch some other starting fingerprint that was not the malicious code
                           echo 'Length of injected text too long.<br>';
                        else {
                           //Injected text is between $posstart and $posend
                           echo htmlspecialchars(substr($contents, $posstart, $posend-$posstart)).'<br>';
                           if ($dorepair) {
                              $contents=substr($contents, 0, $posstart).substr($contents, $posend);
                              echo htmlspecialchars($contents).'<br>';
                              $file=fopen("$path/$file", 'wb');
                              if ($file===FALSE)
                                 echo "Unable to open '$path/$file' for writing.";
                              else {
                                 fwrite($file, $contents);
                                 fclose($file);
                              }
                           }
                        }
                        break;
                     }
                  break;
               }                       
            }
       
        }
   
    }
   
    closedir( $dh );
    // Close the directory handle

}

processDirectory();
echo 'Infected files:<br>';
foreach ($infected as $file) {
   echo "$file<br>";
}
?>
Thanks Dan. Fortunately I was just able to reinstall phpBB. Hopefully I'll be able to do the same for the Wiki.
Yay, I'm safe in linux 😀
I have a website that I work on that has been infected. I'm also very new at all of this. How do I find the string that is used for the fingerprint on my site? Thanks
99% it's the arguments of eval() PHP:http://php.net/manual/en/function.eval.php, JAVASCRIPT:http://www.w3schools.com/jsref/jsref_eval.asp i don't know if there are other function like this.

Original thread: https://box2d.org/forum/viewtopic.php?t=4255