If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Computer malware and attacks

Cybercrime can target a single computer or a network of computers. Malware is any malicious software that's unknowingly installed onto a computer. The most dangerous malware are self-replicating viruses and worms.
Once a cybercriminal successfully installs malware onto a massive number of machines, they can run a botnet and wreak havoc at scale. Many times, botnets are used to launch DDoS attacks on web servers and render the web server useless.

Malware

Malware can take many forms:
A Trojan horse is a harmful program that masquerades as a legitimate program, and is often downloaded onto computers by unknowing users. Once the user runs the program, it can start inflicting its damage.
Diagram of a laptop with a file on it. File is named "safe.exe" but has an icon of a skull and crossbones inside, signifying malicious code.
A virus is a program that hides within the source code of a legitimate program. A virus is self-replicating: it contains code that copies itself into other files on the system.
Diagram of a laptop with 3 files on it. First file is named "real.exe" and contains a string of binary data plus a skull and crossbones. Arrows go from the first file to two other files with similar contents.
A worm is also self-replicating, but it copies itself into entirely different computers within the network. It can travel along networked protocols like email, file sharing, or instant messaging. Many worms don't take any harmful action besides replicate themselves, but even those worms can disrupt a network by hogging bandwidth.
Diagram of 3 laptops. First laptop has a file with a skull & crossbones inside it, signifying malicious code. Arrows go from the first laptop to 2 other laptops, and the 2 laptops also have the same file on them.

The effects of malware

Once malware gets onto a computer, it can cause damage in multiple ways:
  • Spyware steals data and sends it back to the malware creators. A common form of spyware are keyloggers, programs that monitor everything a user types including, of course, their many passwords.
  • Adware pops up advertising to users, which typically earns money for the malware creators.
  • Ransomware holds a computer hostage (by encrypting user data or blocking access to applications), and demands the user pay a ransom to the anonymous malware creators.
  • Cryptomining malware utilizes a computer's resources to mine for cryptocurrency. That allows the creators to earn cryptocurrency without spending any money on powering their own computers.

Botnets

A botnet is a collection of computers that are all infected by the same malware; all running the same "bot". The cyber criminal behind the botnet will often have the ability to remotely access the machines, and can use a botnet to launch a large-scale attack.
Diagram with 6 laptops. The laptop at the top has the face of a cybercriminal on it, and arrows going out to 5 laptops under it. Each of the bottom laptops has an icon signifying a malware file on it.
Botnets may be as small as a few hundred computers but can grow as large as thousands or millions of computers. The largest botnet so far was Conficker, affecting 10.5 million computers. At those scales, the damage caused by malware adds up fast - and for cyber criminals, damage often equals profit.

DDoS Attacks

A common use of botnets is to attack web servers with a Distributed Denial-of-Service (DDoS) attack.
A web server is any computer that's responsible for responding to HTTP requests from users. Web servers are typically set up to handle an expected number of requests per minute, and often struggle to handle much more than that.
A DDoS attack floods a web server with way more requests than expected, overwhelming the server so that it cannot respond to requests from legitimate users.
Diagram of DDoS attack. At the top, a cybercriminal is shown with arrows pointing to 5 laptops with malware on them. Each laptop sends multiple arrows to a server. On the side, two users are shown, with arrows that attempt to reach the server but are blocked by the other arrows.
A DDoS attack can significantly slow down a website or bring it down entirely, which definitely distresses its users and can lose money for the company.
Why do cyber criminals launch DDoS attacks? Sometimes they are seeking revenge against a company or country for personal or political reasons. Other times, a DDoS attack can be used to distract a company while the cyber criminal infiltrates the systems in more sinister ways.

Protection

Cyber criminals are constantly finding new ways to compromise systems. Fortunately, at the same time, security engineers are coming up with protection mechanisms.
A security patch is an update to the code of an application or the entire operating system, and often fixes a bug that's been exploited by malware. Computers, including mobile phones and hardware devices, should always keep up to date with security patches to reduce the risk of malware.
A firewall is a system that monitors incoming and outgoing network traffic to a computer or internal network, and determines what traffic to allow. Firewalls can do automated detection of suspicious traffic and can also be configured manually. Firewalls cannot identify and block all malware, but they are a useful line of defense for what they can identify.
Antivirus software protects an individual computer by constantly scanning files and identifying malware. Once an antivirus program finds a piece of malware, it can guide the user through deleting or repairing the file to be safe again. Of course, cyber criminals come up with new malware all the time, so antivirus programs must constantly update their list of known malware.
Oftentimes, the best protection mechanism is a well-informed computer user. In the next article, we'll discuss the ways that cyber criminals trick users and the ways we can protect our computers and data.

Want to join the conversation?