Where Have the Viruses Gone?
Where have computer viruses gone? Check out this post to read more on one dev's look at the falling number of viruses in malware.
Join the DZone community and get the full member experience.Join For Free
Over the past few years, computer viruses have all but disappeared from malware development. We see rootkits, botnets, exploit kits, worms, and trojans galore, but viruses aren't really common anymore. Even system re-infection doesn't use viruses today — we see programs loaded into registry keys, or installed as tasks or services, but still, no viruses. Why is that? And, will they make a comeback?
First, let's define a few terms quickly. A worm is a program that infects a remote, uninfected computer. A trojan as a program that claims to do one thing, but does something else, too. A virus is just a program that is able to inject itself into other programs and replicate via this mechanism of program insertion. So, where are they?
Well, there's one primary reason you don't see them very much anymore — traditional file and boot infectors are trivial to find. Why is that?
Well, let's look at the CIH virus as an example. This was a pretty sophisticated virus when it was written in 1998. At that point in time, viruses would usually append themselves or some significant portion of the executable virus body at the end of a file. CIH was the first example of a virus that stored the virus body in pieces throughout a PE executable. Most PE executable files have significant empty space within the file body, and CIH took advantage of that by stuffing code into those unused spaces. This way, the infected executable could remain the same size after infection, making infections harder to find. At the time, filesize checks were a common way to determine whether a file had been infected.
Today, we don't rely on filesizes. We use hash functions instead. And, hash functions don't care about the size of the file — they only care about the content. So, if those empty spaces are used, for example, the binary signature of those spaces will change, and the hash signature of that file will change, too. In fact, hash signatures will find any binary change in the file — no matter how small it might be. In order to circumvent this approach, you'd need to exploit a hash collision in the algorithm (a situation where two files create the same signature). That's possible to do with some hash algorithms (MD5, for example) but not modern algorithms, like SHA-256.
Why else? I mean, we see trojans and worms all the time. And, we certainly have use cases where viruses would be useful.
Frankly, I don't really know, besides the fact they can be easier to find. But, I wouldn't count them out. If you have any ideas on why, drop a line in the comments below!
Opinions expressed by DZone contributors are their own.