A computer virus is program embedded with a seemingly safe program that when run will produce copies of itself and then embeds into other files/programs which will then perform some sort of malicious damage (like destroying data).
For a virus to replicate it has to be able to execute code and write to memory, this is why they embed themselves in legitimate programs. If the user executes an infected program the virus maybe executed at the same time.
Viruses can be split into two different types depending on what happens once executed, a non resident virus consists of finder & replication component, the finders job is to find other files to infect, once it has found an executable file to infect it calls upon the replication component to infect it. Resident viruses, however, only contain a replication component which can be similar to the one used by a non resident virus, this component is not called by a finder component, the virus loads the replication component into memory and makes sure it loads every time the operating system is started & will infect any suitable programs that are run on the computer.
Computer viruses are always man made, however, once they have been created & released they are not under control & will spread like human viruses, but rather than human to human, computer to computer.
Worms are very much like viruses in that it will produce exact copies of itself, but unlike a virus will not embed itself in another program, but will replicate via network connections / USB drives etc. to other computers & as they are very similar to standard viruses they often referred to as viruses. Worms do not always do damage to the system through which it passes, but will consume bandwidth, although some worms have a payload which are designed to do more than just spread, it may for instance delete files on the host system, encrypt files to extort money to unencrypt, send document via email, install a backdoor to the system, then use the computer as a zombie which would be under the control of the criminals used for spamming email accounts or Denial OfService attacks.
Nowadays Malware tend to be a vehicle of choice for Internet criminals and does not necessarily do any damage to files or spread from computer to computer, but what it can do is redirect searches from your favourite search engine, imagine your computer is infected with malware & you are looking for a new coffee machine, you search Google for instance & click on one of the results, but instead of going to the website you clicked on it redirects to a website of the writers choice as they will probably be getting affiliate kickback for every visit, purchase etc. Some malware will install a fake Anti-virus / Anti-malware program that will run what looks like a genuine scan and tell you that you are infected with possibly hundreds of viruses etc. Once you click on clean, it will more than likely open a webpage for you to pay $50-$70, often you will not be able to run any other programs or get to any other websites other than the one the malware writer wants you to go to.
Computers often get infected with Malware due to the user visiting sites such as porn sites, torrent/ file sharing sites etc.
Microsoft reported in 2011 that 1 in 14 downloads from the Internet may contain some form of malware code.
A Trojan or Trojan Horse is a standalone program or malicious file, these do not infect other files but often pretend to a legitimate program, they can harm their host computer, corrupt the file allocation table on your computer, replicate, install keyloggers, steal bank details, logons to websites, install other software including third party malware, watch what the user is doing on screen, upload files from your computer, give a hacker remote access to the infected computer, take advantage of unpatched systems to run other malware etc.
A backdoor can be a malicious program that can give an attacker (hacker) with unauthorised remote access to an infected system, taking advantage of vulnerabilities or bugs in installed software, A backdoor will work in the background away from the users eyes, it is also one of the most dangerous as it allows the attacker to spy on the user, manage / change files, install extra software, control the system, restart/shutdown the system, but also has the capability to install keylogging, capture the screen, total system destruction.
They will often install themselves in several different locations & start upon system start-up, making it hard to rid the system of infections as well as reinstalling itself.
Rootkits are very clever bits of software/malware that are designed to hide virtually all existence on the infected computer and are therefore extremely hard to detect & remove.
Rootkits have many different uses and are not always malicious but can allow an attacker access via a backdoor, bypass normal authentication, enforce digital rights management (DRM).
Some root kits can be legitimately installed by the user, i.e. installation of laptop anti-theft software, located in the computers bios that reports home at regular intervals, installation of software like Daemon tools or Alcohol 120% etc.
How to keep your system clean & running well
There are lots of things a user will have to do to make sure they do not fall victim to any of the above,
1, Make sure you have a good recognised antivirus along with the latest updates protecting your computer and scan once a week.
2, Make sure your operating system has all the latest updates installed.
3, Do not visit porn, torrent, file sharing type-sites.
4, Use a secure browser like Google Chrome
5, Regularly empty browser/ temp file cache
6, Defrag hard drive on a regular basis.