#!/usr/bin/perl -w # clean.pl # this code will remove the viral infection when run in same dir # as a virus if you add the viral code to the data section local $/; $signature = ; 1 while $signature =~ s/\n$//g; $signature = quotemeta $signature; while (<*>) { next unless $_ =~ m/\.(pl|cgi|pm)$/; open (FILE, "<$_") or die "Unable to check $_ for infection"; $check_if_infected = ; close FILE; if ($check_if_infected =~ s/^$signature//) { open (CLEAN, ">$_") or die "Unable to disinfect $_"; print CLEAN $check_if_infected; close CLEAN; print "Uninfected $_\n"; } } __DATA__ # Viral code goes here as the viral signature