In fiction, anyone can write a computer virus overnight. While physicists might be more skilled to do so, even journalists demonstrate the skills to write computer viruses that can wipe out a complete technologically advanced alien fleet within minutes. There's no need to find a vulnerability in the system to exploit, no need for a development environment, heck you don't even need to know if the alien computers use ones and zeros (maybe they use threes, tens and tomatoes).

Just to clear things up: Computer viruses exploit security holes/vulnerabilities specific to certain programs -- preferrably server programs, so you can do a remote attack. In order to discover and exploit such holes you need to study the software in question -- a pretty difficult thing to do if you don't have the source code, access to a copy of the target system allowing you to run a selection of penetration testing tools against it (doing so on the real target may well alert its owners that some dirty work is afoot), or at the very least access to the executable file. More commonly, a virus author waits until a security update by the software developer uncovers a security hole in the program. If you are fast, you can act then and write a virus. Most users are lazy with updates (or company policies might get in the way), allowing the virus to spread to versions of the program missing the security update. But in order to write a virus, even if you know the security hole, you need advanced knowledge about programming. That's something you only possess if you're studying computer science or are a complete geek/nerd that has taught himself/herself programming at the age of six. Writing and testing a virus so it works the way you want and doesn't get detected prematurely might take a bit longer than an overnight hacking session. (Well, there are exceptionally skilled long trained hackers who might indeed be able to do this.) In any case you definitely need the following things in order to complete this task:

A compiler or assembler (not needed for scripts) that generates code for the target system.

The software with the security hole in order to test your virus.

The target hardware on which the virus shall be executed.

Profound knowledge in computer science (being a programmer for a living).

Having said this, there are virus building kits, built by (groups of) black hat hackers as per the above description, allowing essentially anyone with nefarious purposes, capable of wielding a mouse, and only little if any knowledge of the target system (usually called "script kiddies") to whip up a virus, worm or Trojan in a relatively limited time. The resulting malware is generally meant to work against known security weaknesses in widely-used programs or operating systems, on the basis that someone, somewhere will not yet have his system patched, and the larger the installed base, the higher the number of unpatched systems and the higher the chance of getting a sufficiently large number of them infected (a measurement of the success of a virus). But even those kits require getting familiar with their workings, just like any other computer program, and they will certainly work no better against the command and control systems of an invading alien fleet than throwing toothpicks at them.

Contents

Yu-Gi-Oh! does this early on: Seto Kaiba uses the supercomputer in his basement to whip up and send a computer virus that will weaken and destroy a hologram of his Blue Eyes White Dragon in only minutes. His method for finding a hole in Pegasus' security? Take over and literally crash a satellite into the building housing the main servers.

In Infinite Crisis, Batman tells Oracle to upload every computer virus on Earth to Brother Eye as a way of slowing it down. Even if Batman had Oracle so Crazy Prepared as to have every computer virus on file and ready for launch, a) Brother Eye would be immune to most of them, as Batman created him most likely with all kinds of attacks in mind (and he was later augmented by Alexander Luthor), and b) it would be amazingly stupid to let in anything that didn't come from one of his OMACs and was of the wrong size or file type -- it's not like he's torrenting on the side while he's repelling the heroes. It's also apparent Swayzak was one of these viruses.

In Independence Day a computer genius from MIT writes a computer virus overnight that wipes out the attacking technologically superior alien fleet. A lot of people found it implausible that a human computer could interface with alien technology and that the virus just happens to be compatible with the alien system. A deleted scene would have shown the guy studying the aliens' computer system in a crashed ship. It's also implied that human technology has been largely reverse-engineered from alien tech. The aliens were also established to be using Earth's satellites to relay messages, so their systems must have been compatible to some degree.

In The Net, the main character is a computer programmer who collects the viruses that she combats. In one of the opening scenes, she's fixed a virus that was afflicting Doom.

The Parole Officer features a caper that relies on a computer virus, uploaded from a porn site, that sets off every building alarm in Manchester.

In The Matrix Trilogy, the Big Bad Agent Smith goes from being a program created to police the Matrix to being able to copy himself over other programs and even people after being killed by Neo at the end of the first movie. It's ironic considering his "humans are a virus" rant to Morpheus earlier in the same film.

In the Stargate SG-1 episode Avenger 2.0, Jay Felger and Major Carter write a computer virus that disables a DHD by scrambling its symbols and corresponding coordinates. While it is not clear whether these two studied computer science, all other work they do just concerns physics.

Although Major Carter did write the dialing program which imitates a DHD for the (American) Earth gate, so it's not the first programming she has done along those lines.

Physicists as a rule are versed in at least one, if not many more programming languages. It's very difficult to simulate things without knowing how to tell the computer what to do.

Subverted on Buffy the Vampire Slayer when Giles asks if they can use a computer virus to defeat a demon uploaded onto the internet. Jenny replies that he's seen too many movies.

The way the Cylons disabled the Colonial Fleet in Battlestar Galactica Reimagined was often described as a Virus, though in reality it was a backdoor that the Cylons placed during the development of a navigation program that most Colonial ships (military and civilian) used.

An actual computer virus is, however, used in Valley of Darkness and gives the Fleet quite a lot of headaches in the following episodes before being purged.

Depending on your choices in Uplink, you will be tasked with either spreading a computer virus intended to destroy the Internet, or spreading the antivirus meant specifically to stop it. You can also run the virus on your own gateway computer, but it's not recommended.

In Tron Evolution and Tron 2.0, virus-infected Programs are major enemies, and the source of the virus comprises one of the major boss battles. Of course, with the universe in question, computer viruses are treated as a de facto Zombie Apocalypse.

Webseries

Viciously parodied in Red vs. Blue. When Simmons is attempting to gain control of an enemy computer system and explaining the complications of doing so , Griff says "try uploading a virus into the mainframe, I find one with a laughing skull works the best."

Virtumonde has become the overnight virus of choice and, due to its effectiveness and the ease with which it can be put together, dozens of variants exist and, combined with variants of the My Web Search infection, make up the majority of viruses professionally cleaned from computers. Catching it can mean a 3-figure trip to the computer guys or a hard drive wipe for most people.