No a virus could be easily written to defeat this particular code. This presumes that you install this *exact* code. However you can easily change the checkstring to *whatever*, and/or the message thus defeating a virus using a regex to disable this type of code. Polymorphic protection if you want. Using file length could be defeated by a virus that deleted the same number of bytes as it adds but this significantly ups the difficulty factor as the virus needs to delete some 'code' without breaking the target file.
The problem with any *standard* modular solution would be that s/use Virus::Protect;// (just like s/#avshc='\d+'//g; etc) would be far too easy to implement in a virus so you would need to hard code antiviral protection into the Perl core and run it automatically. There are a large number of difficulties with this solution revolving on how Perl is supposed to differentiate between a valid request to change a file from by a script and a virally initiated one?
cheers
tachyon
In reply to Re: Re: Virus protection for Perl scripts
by tachyon
in thread Virus protection for Perl scripts
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |