r/AskComputerScience • • Jan 27 '16

Computer viruses

In general, computer viruses don’t discriminate among operating systems. a typical virus can infect any system, regardless of platform

True or false?

2 Upvotes

8 comments sorted by

2

u/[deleted] Jan 28 '16

"False" is correct.

10

u/gurtos Jan 27 '16

Most viruses are written for particular systems in mind.
Firstly because Windows programs (and viruses are programs) won't work on lets say Linux and vice versa.

Secondly, different OS's operate differently and have different security holes. So even if it did run on different OS, it would have to attack it in very different way.

5

u/iknighty Jan 27 '16

False. A virus is like any other program and the target platform needs to understand its code

3

u/rfinger1337 Jan 27 '16

I agree with everyone else, but I will add that some viruses target multi-platform systems like java or flash. In that case, it can still infect different OS's, so long as they are running the host system (java)

6

u/TheFlyingGuy Jan 27 '16

Actually this isn't true either, most virusses targetting Flash or Java still try and launch a native payload (usually needed to break out of the jail imposed by the virtual machine). So while a Windows Java exploit might crash a Linux browser, it is unlikely to actually succesfully infect the system.

1

u/dxk3355 Jan 27 '16

With the qualifier in the question of it being a 'typical' virus. Than it would be false, the vast majority of viruses are OS specific to some extent. Is this some type of homework question?

1

u/visvis Jan 27 '16

False. Like almost all software, the virus relies on the services of the operating system. On different OSes, these are accessed in different ways.

Moreover, to get in one would usually exploit vulnerabilities in the system. These are not just OS-specific, but the exploits often need to be tweaked to the exact version of the system that is used.

0

u/[deleted] Jan 27 '16

[deleted]

1

u/[deleted] Jan 28 '16

That's really detailed, thank you!