Cyber attacks are attempts to disrupt or disable computer systems or steal valuable data. From the Experian data breach to the Colonial Pipeline ransomware attack, cyber attacks are a part of just about every news cycle and have very real consequences. In this article, we’ll take a closer look at what cyber attacks are, why they happen, and how to prevent them.

Cyber attack basics

Cyber attacks can compromise sensitive personal data, including Social Security numbers, birthdates, medical information, credit card numbers, bank account numbers, and more. This can lead to identity theft, which is time-consuming, frustrating, and expensive to resolve.

Cyber attacks are also very expensive for companies. Cybersecurity Ventures expects global cybercrime costs to grow to $10.5 trillion annually by 2025, with over $6 trillion in damages alone this year.

But why is cybercrime so expensive? Cyber attacks often bring down computer networks, and downtime costs companies money. It also takes time and money to back up and evaluate compromised systems and data.

Companies also have to notify their customers if their data was compromised and take measures to restore their reputations. That doesn’t include the costs of attempting to prevent cyber attacks in the first place, which requires professional expertise, investments in hardware and software, and lots of time.

Types of cyber attacks

There are several types of cyber attacks. Here are some of the most common:


Malware are software like spyware and ransomware that are used to attack information systems.

Spyware is installed on devices without a user’s knowledge. It can be used to steal information, including login credentials, and invades privacy. Trojans are one example of spyware.

Trojans hide in legitimate software programs, which gives them access to a computer. From there, it can delete or encrypt files or access user information.

Ransomware is software used to encrypt and hijack computer systems, which are only released after a ransom has been paid. The Colonial Pipeline shutdown was one example of this. The Pipeline is one of the main fuel pipelines in the United States, and shutting it down caused fuel shortages across the east coast. Colonial paid $4.4 million to the hacking group to bring their systems back online.


Phishing is when cybercriminals send emails or texts to unsuspecting people who then click on a link or attachment that downloads malware onto their device. Another variation is when the link takes the user to a fake website that tricks them into entering sensitive information.

Phishing emails and texts have become increasingly sophisticated, so it’s critical to be vigilant about not clicking links or opening any emails you don’t recognize.


This attack is when a cybercriminal inserts themselves between two parties. For example, they might intercept connections on public, unsecured WiFi networks to steal data from someone logging into their work email or bank account.

Distributed denial-of-service attack (DDoS)

DDoS attacks bombard systems with traffic that exhausts their resources and bandwidth. They make servers unable to handle requests, making systems unusable.

SQL injection

SQL injections involve using the SQL programming language to collect data from servers and databases. The cyber criminal will be able to act as an administrator and change passwords or usernames of users, or manipulate data without permission.

Zero-day exploits

Software have vulnerabilities. Zero-day exploits are when cybercriminals exploit vulnerabilities within software before they’re patched.

DNS tunneling

DNS tunneling hides the data of other programs in DNS queries and responses. It allows data to be removed from a system without being detected.

Why do cyber attacks happen?

Criminals engage in cyber attacks for several reasons:

  • Money: Perhaps the most obvious reason — money drives a lot of cyber attacks. Cybercriminals can bring in millions with ransomware. They can sell personal and corporate data.
  • Disruption: Some hackers just want to disrupt the status quo. They enjoy the chaos. Or they may want to damage a specific organization or entity.
  • Cyberwarfare: Governments are also involved in cyber attacks. They use cyber attacks to weaken political opponents and expose vulnerabilities.

How to prevent cyber attacks

Organizations and individuals can take steps to prevent cyber attacks.

  • Education: You can only prevent what you’re aware of, so keep an eye on evolving cyber threats. Organizations should educate employees on common cyber threats, including phishing and social engineering, which involve manipulating someone into providing access to sensitive information. For example, someone could pretend to be tech support to gain access to protected servers.
  • Install perimeter defenses: These include firewalls, which should be kept up to date.
  • Malware detection: Consider adding malware protection on your computers and other devices. Corporations should have state-of-the-art antivirus software that’s continually updated to address threats.
  • Patch management: Those pesky security updates might seem annoying, but they prevent vulnerabilities from being exploited.
  • User access: Multi-factor authentication and strong passwords play a huge role in preventing cyber attacks.

Along with the steps listed above, businesses should also have a clear response plan to deal with security breaches.

Getting involved in cybersecurity

Since cyber attacks are constantly evolving, cybersecurity professionals are in high demand. If you’re interested in a career in cybersecurity, you can get started in several ways.

One option is learning a programming language that’s commonly used in cybersecurity. Some options include:

We also offer an Introduction to Cybersecurity course. It covers cybersecurity standards, cyber threats, cryptography, network security basics, and more. In other words, it’s a great way to take your first steps toward a rewarding career!

Cybersecurity Courses & Tutorials | Codecademy
Cybersecurity is a fast-growing field that addresses the security risks of our increasingly connected digital world. Learn cybersecurity, and you will learn how users, companies, and even governments protect themselves and recover from, cyber threats and attacks. Start defending yourself, or your or…

Related articles

7 articles

What Is Social Engineering?

8 minutes
By Codecademy Team

What is social engineering? If you want to know how to spot and avoid online scammers, hackers, and anyone out for your password, then be sure to check out this article.