Eli5 – How are computer viruses created without destroying the creator’s computer first?

2.42K views

I’ve always wondered how computer viruses are made. If someone creates a virus on their own computer, wouldn’t it infect and potentially destroy their system first before it’s spread to others?

In: 249

53 Answers

Anonymous 0 Comments

The source code is just a text file that sits on your computer and is totally harmless until you make the computer run it. You don’t have to run the code on the same computer you are writing it on. There is a technique called remote debugging, where the code is written on one computer but runs on another one so you can debug it (inspect what the code is doing while it is running). That other computer can be a virtual machine built from an image (a kind of template), so if it gets trashed, you can easily reset it from the template and start over fresh without losing anything. To test the ability for it to spread, you can restrict the network access of the virtual machine so the malware can spread to other virtual machines but not back to the main machine.

The malware author can put backdoors or safety mechanisms in the code so that it won’t perform harmful actions if the machine has a certain name, a certain address or file present, etc. This is sometimes how malware authors get caught because the name or address in the backdoor provides clues that lead back to the author.

You are viewing 1 out of 53 answers, click here to view all answers.