Free tech learning for everyone, from basics to pro

Cyber Security FundamentalsCyber SecurityBeginner

Common types of cyber attack and how to defend against each

In short: Most incidents come from a small set of attack families: malware, phishing, credential attacks, denial of service, interception, injection, exploited flaws, supply chain compromise and insider misuse. Each family has well-known defences, and a handful of basic controls blocks a large share of them.

Why learn attack families?

New attack names appear every month, but almost all of them are variations on a few old ideas. If you understand the families, you can read a news story or an alert and quickly ask the right questions: how did it get in, what did it want, and which control should have stopped it? This note gives a defender's overview. For the basics of viruses, worms and Trojans see threats, vulnerabilities and risk.

Common attack typesMalwareransomware, stealersPhishingfake messagesCredential attacksstuffing, sprayingDenial of serviceflood or crashInterceptionman-in-the-middleInjectionSQL, commandSupply chaintrusted supplier abusedExploiting flawsunpatched systemsInsider misusestaff or contractors
Figure 1. Nine families of attack that come up again and again in incident reports and exams.

The families and their defences

AttackWhat happensMain defences
MalwareHarmful software runs on a device. Ransomware encrypts files; infostealers grab saved passwords and session cookies.EDR, patching, application control, offline backups
PhishingA fake email, text or call tricks someone into clicking, paying or giving a password.Email filtering, training, phishing-resistant MFA, verify requests another way
Credential attacksLeaked passwords are reused (stuffing) or common passwords are tried on many accounts (spraying).MFA, unique passwords, lockout and sign-in monitoring
Denial of service (DoS/DDoS)A service is flooded or crashed so real users cannot reach it.Upstream DDoS protection, rate limiting, spare capacity
Interception (man-in-the-middle)Traffic is read or altered between two parties, for example on a rogue Wi-Fi hotspot.TLS everywhere, certificate checks, VPNs, secure Wi-Fi
InjectionUntrusted input is treated as a command, as in SQL injection.Parameterised queries, input validation, secure frameworks
Exploiting known flawsAttackers scan for unpatched internet-facing systems such as VPNs and firewalls.Fast patching of exposed systems, reducing what is exposed
Supply chainA trusted supplier, software update or library is compromised and used as a way in.Supplier checks, least privilege for vendors, software inventories
Insider misuseStaff or contractors misuse access, on purpose or by mistake.Least privilege, logging, prompt leaver processes

Opportunistic and targeted attacks

Opportunistic versus targetedOpportunisticScans the whole internetUses known, easy flawsWants quick moneyStopped by basic hygieneTargetedPicks one organisationResearches staff and systemsPatient and persistentNeeds layered defences
Figure 2. Most attacks are opportunistic, which is why the basics block so many of them.

Most organisations are hit by opportunistic attacks: automated tools that try leaked passwords or a newly published flaw against anything that answers. They are not personal, and they succeed against whoever is easiest. Targeted attacks are rarer but more determined; the attacker studies one organisation and keeps trying. Basic hygiene defeats most opportunistic attacks, while targeted ones need layers of defence plus good detection and response.

Real-world example: a dental practice

A receptionist at a fictional dental practice receives an email that looks like a delivery notice and opens the attachment. It installs an infostealer that copies passwords saved in the browser, including the practice's booking system login. Two days later an attacker signs in to the booking system from abroad. Because the practice had turned on MFA for the booking system the month before, the sign-in fails and an alert goes to the IT supplier. The supplier rebuilds the PC, resets the saved passwords and turns off password saving in the browser. Three families appear in one incident (phishing, malware and credential theft) and one control broke the chain.

Attack goals

Families describe how an attack works; it also helps to ask what the attacker wants. Most criminal attacks aim for money, through ransom, fraud or selling stolen data. Others aim to disrupt a service, to spy, or to make a political point. The goal shapes what happens after the way in: a ransomware group moves towards backups and file servers, while a spy stays quiet and copies email for months. Thinking about goals helps you decide which systems to protect and watch most closely.

Tip: when you read about any attack, write one line each for "way in", "goal" and "control that would have helped". It is a quick way to build real understanding.

Practice

What is the difference between credential stuffing and password spraying?
Stuffing reuses username and password pairs leaked from another breach. Spraying tries a few common passwords against many accounts to avoid lockouts.
Which defence is most effective against SQL injection?
Parameterised queries (prepared statements), so user input is always treated as data rather than as part of the command.
Why do basic controls stop so many attacks?
Most attacks are opportunistic and automated. They move on to easier targets when MFA, patching and backups are in place.

Key takeaways

  • A few attack families explain most incidents.
  • Each family has standard defences, such as MFA, patching, TLS and parameterised queries.
  • Real incidents often chain several families together.
  • Most attacks are opportunistic, so basic hygiene blocks a large share.
  • Targeted attacks need layered defences plus detection and response.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.