Malware is any program created to damage, spy on, hijack or take advantage of a computer, a network or a set of data without the owner’s consent. The word joins malicious and software, in other words a malicious program. It is an umbrella term that includes viruses, worms, trojans, spyware, ransomware and many other threats. In everyday language many people simply call it a virus, although technically it is a broader concept.
The most useful image is that of household pests. There are mice, termites, cockroaches and moths, and each one causes a different kind of damage. But they are all pests, and they are all fought with similar ideas, such as keeping the house clean, sealing the entrances and keeping watch. Malware works the same way. Many different forms, each with its own method and goal, but with a common origin and common defences that apply to all of them.
Malware is the name for every computer pest. Each one does a different kind of damage, but almost all of them come in through the same doors.
What is malware?
The concept of malware covers any program with harmful intent. What defines it is not the technique, but the purpose. A program that steals your passwords, one that encrypts your files to demand a ransom, one that uses your computer to mine cryptocurrency, one that spies through your camera or one that serves as a door for other criminals are all malware. So is one that merely displays unwanted advertising.
There is also malware created by states to spy or to sabotage. These are tools of enormous sophistication, developed by teams of specialists over years, that use unknown flaws and are designed for specific targets. Although they affect few victims, they set trends and, over time, their techniques end up in the hands of ordinary criminals, as the case of the tools leaked in 2017 showed.
How malware works
Almost all malicious programs follow a similar path. First they get into the computer through one of the usual routes and run, often thanks to a moment of carelessness by the user or to an unpatched flaw. Then they seek persistence, in other words a way to stay active after a reboot, for example by adding themselves to the startup programs or creating scheduled tasks.

From there, most of them contact a command and control server, from which the attacker sends orders and receives whatever has been stolen. Finally they run their payload, which is the part that does the damage, such as encrypting files, stealing passwords or adding the computer to a network of zombie machines. Cutting off any of those phases stops the attack, and that is what layered defences are based on.
The most common infection routes
Malware does not turn up on a computer by chance. The most frequent route is still email, with attachments or links that lead to harmful pages. Next come downloads of programs from unofficial sources, including pirated copies, compromised websites that attack the browser and external storage devices, such as USB sticks left lying around in a car park. On the business side, malware also gets in through unpatched vulnerabilities, weak passwords on internet-facing services and suppliers whose software has been compromised. In every case there is a pattern. The attacker looks for the easiest link in the chain, which is almost never the most technical one, but the one that has been neglected.
Types of malware
The types of malware differ in how they spread and in what they do once inside, and the difference matters because it changes the defence. In practice, many modern programs combine several of these techniques in a single campaign.

Viruses
A virus attaches itself to other programs or files and spreads when they are run or shared. It needs someone to do something, such as opening a file or a document with macros. Melissa, in 1999, travelled inside a Word document and forwarded itself to the first contacts in each victim’s address book, until it overwhelmed mail servers across half the world.
Worms
A worm is more autonomous, copying itself from one computer to another across networks without human intervention, and it can infect thousands of machines in minutes. Against worms, the decisive factor is keeping systems updated, because they exploit known flaws, as Conficker did at the end of 2008 with a Windows vulnerability that had already been patched.
Trojans
A trojan disguises itself as a useful program, such as a game, a free tool or a fake browser update, but does something harmful behind the scenes. Against viruses and trojans, the user’s caution is key, because they depend on someone running something they should not.
Spyware and keyloggers
Another family of malware seeks to quietly observe what the victim does. Spyware collects information about your activity, from the pages you visit to the passwords you type, and keyloggers copy every keystroke. These programs rarely cause visible damage, and their value lies in staying unnoticed. They can sit on a computer for months without anyone noticing.
Backdoors
Backdoors open a hidden way in so that the attacker can return whenever they want. A backdoor installed today can be used a year from now to bring in ransomware, which is why serious clean-ups do not stop at removing the visible symptom, but look for every access point and change the credentials.
Ransomware
Data hostage malware, or ransomware, encrypts the victim’s files and demands a payment to return them, and increasingly it also threatens to publish what has been stolen. Today it is one of the most profitable and damaging threats for companies of every size. Against ransomware, backups are the decisive defence, because they make it possible to recover without paying.
Hidden cryptocurrency mining
Hidden mining uses the power of the computer or the server to generate cryptocurrency for the attacker, at the cost of the victim’s slowness and electricity bill. Monitoring resource consumption and the programs that are running helps detect it early, before it turns into a significant expense.
Adware
Adware fills the browser with adverts and redirects searches, and although it is usually more annoying than dangerous, it opens the door to other threats. It often comes bundled in free installers that offer it as a box that is already ticked.
Botnets
Botnets are networks of thousands of infected computers, called zombies, which the attacker controls remotely to send spam, steal credentials or launch denial-of-service attacks. Each infected computer is both a victim and a weapon against third parties.
Rootkits
Rootkits hide deep inside the system, sometimes in the kernel or even in the firmware, to conceal their presence and that of other malicious programs. When one is suspected, the safest option is to reinstall the system from scratch rather than trying to clean it.
Information stealers
Information stealers, or infostealers, grab in one go the passwords saved in the browser, session cookies and cryptocurrency wallets, and send them to the attacker within seconds. Stolen cookies make it possible to log into accounts without going through the second factor, which is why these programs fuel a large share of corporate intrusions.
Wipers
Wipers erase or destroy data without asking for a ransom, with the sole aim of causing destruction. NotPetya, in 2017, presented itself as ransomware, but in reality it did not allow files to be recovered, and it paralysed large transport, pharmaceutical and logistics companies around the world for weeks.
Malware on mobile phones and Macs
Mobile phones can also get infected with malware in several ways. On Android, most cases come from apps installed outside the official store or from seemingly useful apps that, after an update, start stealing banking details or signing the user up to paid services. On iPhone, infections are rare because of the system’s restrictions, although there are very sophisticated commercial spyware programs, such as Pegasus, that have exploited unknown flaws to monitor journalists and politicians.
The myth that Macs do not get malware no longer holds. Their growing market share has made them a target, and in recent years information stealers designed for macOS have circulated, distributed as pirated programs or fake updates. The same rules protect against malware on every system, update, install only from official sources and be wary of excessive permissions.
Malware on a website
For a website, whether it is a content management system such as WordPress, Joomla or Drupal, a shop on PrestaShop, Magento or OpenCart or a custom build, malware is a very real threat. It usually gets in through outdated extensions and templates, vulnerable libraries, downloads from unofficial sites or weak passwords, and it shows up as strange redirects, unwanted adverts, emails leaving the server, search engine warnings or a website that suddenly becomes slow. Sometimes it hides for weeks, showing normal content to administrators and malicious content to visitors.
Preventing malware on a website comes down to the usual measures. Update the system, the extensions and the dependencies, use only components from official sources, remove what is not used, use strong passwords with a second factor and keep permissions tight. A web application firewall and a file monitoring tool add layers of protection and raise alerts about changes. And isolated backups make it possible to recover the website quickly if something does slip through.
If an infection is confirmed, it pays to act methodically. Isolate the website, change every password from a clean computer, restore from a backup taken before the intrusion or clean thoroughly with professional help, and find out how the attacker got in before putting the website back online. Cleaning up without closing the way in is the most common cause of the reinfections that drive website owners to despair.
Detecting malicious code and evasion techniques
How antivirus software detects malware
Classic antivirus programs compare each file with a database of signatures, fingerprints of malicious programs that are already known. It is a fast and precise method, but it only detects what has already been seen. For new threats, heuristic analysis is used, which looks for suspicious traits in the code, along with execution in an isolated environment, known as a sandbox, where the program’s behaviour is observed before it is allowed to act. Endpoint detection and response tools, or EDR, go further and continuously monitor the behaviour of the whole system.
Fileless malware and evasion techniques
A worrying trend is malware that leaves no files on the disk. It runs in memory or uses the system’s own legitimate tools for its purposes, so defences based on examining files do not see it. Other strains hide their code under layers of obfuscation, detect whether they are in an analysis environment so they can stay quiet, or wait for days before activating.
Against these tricks, modern defences focus mainly on behaviour. A system tool that suddenly downloads and runs something from the internet looks suspicious, even if the tool is legitimate. That is why solutions that monitor activity, not just files, are valued, and that is why user training is still key, because whatever does not get in through a malicious attachment does not need to be detected afterwards.
How to tell whether you are infected
The symptoms of a malware infection vary, but there are patterns. Computers that are slow for no reason. Unknown programs. Unexpected pop-up windows. Files that disappear, get renamed or stop opening. A browser with a changed home page. Accounts with activity you do not recognise. On a website, redirects, strange adverts and search engine warnings. None of these is conclusive on its own, but several together justify a review.
If you suspect something, use an up-to-date scanning tool from a recognised vendor, and if possible a second opinion from another tool. For websites, external review services that compare your files with the originals are very useful. If the result is positive, do not just remove what is visible. Find the source, change the passwords and review the rest of your systems. To clean up a hacked website it is not enough to delete what you can see, you also have to find the backdoors.
It is also wise to prepare before an infection happens. Backups out of reach of the computer or the server, a simple plan of what to do, a trusted contact to call and the habit of keeping everything updated. Historic cases, from ILOVEYOU to Stuxnet, show that malware changes shape, but the essential defences remain the same. Whoever applies them consistently suffers far less than whoever trusts to luck.
The evolution of malware since the first viruses
The idea of a program that can copy itself predates personal computers. In 1949 the mathematician John von Neumann described in his lectures the theory of self-reproducing automata. In 1971 Bob Thomas created Creeper, an experimental program that jumped between computers on the ARPANET network displaying a message, and shortly afterwards Reaper appeared to remove it, considered the first antivirus. In 1982 a fifteen-year-old student, Rich Skrenta, wrote Elk Cloner for the Apple II, one of the first viruses to spread outside an experimental environment.
The term computer virus was first used by Fred Cohen in 1983, and in 1986 Brain appeared, the first virus for IBM-compatible computers, written by two brothers in Pakistan. In 1988 the Morris worm paralysed a significant part of the internet, and the word malware is attributed to the Israeli researcher Yisrael Radai, who used it in 1990.
The first harmful programs, from the 1980s, were in many cases pranks or displays of ingenuity, and their authors were looking for notoriety. With the arrival of the internet and ecommerce, the landscape changed. Today malware is above all a business, with organised groups, marketplaces where tools are bought and sold and rental services, complete with customer support and profit sharing, that let anyone launch attacks without knowing how to program.
The goals of malware have also broadened over the years. Data and money theft have been joined by espionage between states, sabotage of infrastructure and extortion through file encryption. Modern malware is stealthier, more modular and more adaptable, and it is often downloaded in stages so that each piece, on its own, looks harmless.
Two malicious programs that marked an era
On 4 May 2000, emails with the subject line ILOVEYOU and an attachment that looked like a love letter began circulating around the world. Anyone who opened it unleashed a worm that sent itself to every contact in their address book and destroyed files on the computer. Within hours, it overwhelmed the mail servers of governments and companies. It is estimated to have infected between ten and forty-five million computers.
The losses caused by that worm are hard to estimate. Published figures range between three and fifteen billion dollars, mainly because of the cost of clean-up work and downtime. What mattered was the lesson. A global threat had worked by exploiting people’s curiosity and trust, not a technical flaw. For the first time, the general public understood that an email could be a weapon.
The second malware case is of a different nature. In 2010 Stuxnet was discovered, a program of extraordinary complexity designed to attack specific industrial equipment. Researchers from several companies linked it to the sabotage of the uranium enrichment plant at Natanz, in Iran. According to independent analyses, around a thousand centrifuges were taken out of service. Iran has never officially confirmed that it was because of this program.
As the plant was not connected to the internet, the program is believed to have arrived through removable devices. Stuxnet proved that malware could cause real physical damage to infrastructure, not just to computers. It changed the way people think about industrial security, and it is considered the first known digital weapon. Its techniques were studied, imitated and reused by other groups in the years that followed.