in reply to Virus protection for Perl scripts
todie "File $0 has changed ?viral infection?\n" unless $1 == length $me;
update: or even to run this regex on the script: s/#avshc='\d+'//g;#die "File $0 has changed ?viral infection?\n" unless $1 == length $me +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Virus protection for Perl scripts
by tachyon (Chancellor) on Jun 29, 2001 at 03:37 UTC | |
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 | [reply] |
by $code or die (Deacon) on Jun 29, 2001 at 06:06 UTC | |
I think you have that the wrong way round: there will always be ways to break any anti-virus code you try and impliment. If you're writing a virus, you'd find ways around the anti-virus software. This is the nature of regular viruses. It's the anti-virus software companies that need to keep up with the viruses, not the other way around. I'm no virus expert, but there are ways of infecting someone's code without setting off this kind of warning. Not all viruses are benign "worms". Some viruses do much worse things than that. <self-edited because I don't want to give anyone ideas> You said: 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.Why would someone writing a virus to infect your code necessarily care if it breaks your code? Personally, I like the idea Of course a better solution, would be to unplug your modem\dsl\network cable, rip out your cdrom and floppy drives, and don't let anyone near your machine. But then life would be a bit boring! Forgive me if I misunderstood. I'm not attacking you, this is a useful discussion. It's just the thought of open-source virus protection software is a bit strange to me, but I'd love to be proven wrong! $ perldoc perldoc Update: some minor reformatting to empasise the real points I'm trying to convey, and attributed the virus::protect to tye, since he mentioned something similar in the first reply. | [reply] |
by tachyon (Chancellor) on Jun 29, 2001 at 07:01 UTC | |
Of course there will always be a problem for every solution! Some DOS virii have been known to disable antivirus software in various ways. The point of the open source code is that by personally modifying it slightly you require a virus to cope with the modification successfully in order to defeat it. This is a problem with a module per se - they are a stationary target! By making it easy for the good hacker to move the goal posts it becomes very difficult for a bad hacker to kick goals. I was going to post some code that automatically appends a polymorphic form of the original code to every script in your current working directory but as this demonstated both viral design, and worse still polymorphic viral design thought better of it. If you give it a little thought it is easy to write a piece of code that performs a ?have I changed? routine that is never the same and thus hard to defeat. Why would someone writing a virus to infect your code necessarily care if it breaks your code? When it comes to virii the analogy to human disease is strong. EBOLA is a very rapidly fatal and highly contagious virus. HIV is a very slowly fatal and not particulary contagious virus. Yet although EBOLA is more contagious the fact that it quickly kills its victims means they have little chance to spread it. So to with a computer virus. If it breaks the program it infects so that it can not run the virus has shot itself in the head as it can not spread as a result of infecting the executable. As such it is not really a virus at all, just a piece of malicious junk. Ultimately I am less than convinced that we are not discussing the solution to a problem which does not really exist. cheers tachyon | [reply] |