Skip to content
BoKSA

B6. Attacks, Threats and Vulnerabilities

B6. Attacks, Threats and Vulnerabilities

Level Foundation and Intermediate (with a step towards Advanced: attacks per OSI layer)
Prerequisites B1 OSI model, B2 Operating systems, B5 Essentials, and for Intermediate B4 Protocols
Study time About 10 hours (4 h reading and video, 6 h hands-on)
Source Teach-the-Teachers fiche B6
Next topics B7 Cyber hygiene · B9 Incident response · B11 Penetration testing

Why this matters

To defend, you must think like an attacker. Who would want to attack this organisation, and why? Which weaknesses can they use, and how would the attack unfold? Without that understanding, security measures are a random shopping list. With it, you can prioritise: fix the weaknesses that real adversaries actually exploit, first.

This topic gives you the vocabulary (adversary, threat, vulnerability, risk, attack, exploit) and an overview of the attacks you will meet most: malware, phishing, password attacks, man-in-the-middle, injection, denial of service, ransomware and supply-chain attacks. It also introduces the frameworks professionals use to describe attacks: the Cyber Kill Chain, MITRE ATT&CK, CVE and the OWASP Top 10.

Learning objectives

Foundation. After this topic you can:

  1. Explain what an adversary is and name the main types.
  2. Explain the difference between a vulnerability, a threat and an attack.
  3. Describe the objectives of different attacks (for example a password attack).

Intermediate. In addition you can:

  1. Describe the main kinds of attacks: malware, man-in-the-middle, SQL injection, password attacks, DoS.
  2. Recognise phishing attacks and explain how to avoid them.
  3. Use the OWASP Top 10, CVE and MITRE ATT&CK to look up and describe attacks and weaknesses.

Towards Advanced. You can also link attacks to OSI layers and explain how an adversary goes from information gathering to control of a remote system.

Foundation: the vocabulary of attack

Vulnerability, threat, risk, attack

Term Meaning Example
Asset Something of value that must be protected The customer database
Vulnerability A weakness that a threat could use An unpatched web server; a password Welcome01
Threat Something or someone that could cause harm by using a vulnerability A ransomware group; a disgruntled employee; a flood
Exploit The concrete method or code that abuses a vulnerability A script for CVE-2017-5638 (Apache Struts)
Attack An actual attempt to exploit a vulnerability Running that script against the web server
Risk The chance that a threat exploits a vulnerability, times the impact "Likely, and the damage would be high"
Control / countermeasure A measure that reduces risk Patching, MFA, a WAF, backups

A useful sentence to remember: a threat uses a vulnerability to damage an asset; risk is how likely and how bad that is; controls reduce it.

Adversaries: who attacks, and why?

An adversary (threat actor) is someone who carries out malicious activity.

Adversary Typical goal Capability
Script kiddie Fun, fame, curiosity Low; uses existing tools
Cybercriminal Money: ransomware, fraud, selling data Medium to high; organised like a business ("ransomware-as-a-service")
Hacktivist Political or social message Low to medium; DDoS, defacement, leaks
Nation state / APT Espionage, sabotage, influence Very high; patient and well-funded (Advanced Persistent Threat)
Insider Revenge, money, carelessness Has legitimate access, so is hard to detect
Competitor Trade secrets Varies

Adversaries are also classified as:

  • passive (only observe, for example eavesdropping) versus active (change, inject or disrupt);
  • insider (inside the organisation, with legitimate access) versus outsider.

What attackers want

Attack objectives are often summarised as: steal (data, money, credentials), spy (long-term access), disrupt (make unavailable), deny, degrade, destroy (wipe data or damage equipment), deceive (manipulate information) and extort (ransomware, sextortion). A password attack, for example, aims to gain someone's access rights. It is usually a means, the first step towards one of the other goals.

Intermediate: the main attack types

Malware

Malware (malicious software) is the umbrella term for software designed to cause harm.

Type How it works
Virus Attaches itself to a legitimate file or program; spreads when that is run
Worm Spreads by itself across networks, without user action (WannaCry, 2017)
Trojan Pretends to be useful software but contains a malicious part
Ransomware Encrypts files and demands payment; today usually also steals data and threatens to publish it (double extortion)
Spyware / infostealer Secretly collects data: passwords, browser cookies, crypto wallets
Keylogger Records keystrokes
Adware Shows unwanted ads, often bundled with free software
Rootkit Hides deep in the OS (or firmware) to stay invisible
Botnet A network of infected devices controlled remotely, used for DDoS, spam or proxying

Phishing and social engineering

Phishing is a social engineering attack in which the attacker poses as a trusted party (bank, colleague, parcel service, school) to make you click a link, open an attachment, enter your password or pay. Variants are spear phishing (aimed at one person), whaling (aimed at executives), smishing (SMS), vishing (voice) and quishing (QR codes).

Since 2023, generative AI writes flawless phishing in any language and can clone voices. "Look for spelling mistakes" is therefore no longer a reliable tip. Better habits:

  • Check the channel, not the content: go to the website yourself, or call back on a number you already know.
  • Be suspicious of urgency, authority and secrecy.
  • Never give MFA codes to anyone.
  • Use passkeys where possible; they are resistant to phishing.
  • Report suspicious messages (to your IT department, or in the Netherlands to the Fraudehelpdesk).

Password attacks

Attack How it works Countermeasure
Brute force Try every possible combination Long passwords, lockout or rate limiting
Dictionary attack Try common words and leaked passwords Block known leaked passwords; use passphrases
Credential stuffing Try username/password pairs leaked from another site Unique password per site; MFA
Password spraying Try one common password (Summer2026!) against many accounts MFA; monitoring of failed logins
Offline cracking Crack stolen password hashes with GPUs Slow, salted hashes (bcrypt, Argon2)
Phishing / keylogging Simply steal the password Phishing-resistant MFA / passkeys

Man-in-the-middle (MITM)

In a man-in-the-middle attack the adversary secretly sits between two parties, reading and possibly changing their communication. Classic methods are ARP spoofing on a LAN, a fake Wi-Fi hotspot ("evil twin") and DNS spoofing. TLS with proper certificate checks (HTTPS) defeats most MITM attempts. That is why browsers warn loudly about certificate errors, and why you should never click through those warnings.

SQL injection

Many applications build database queries from user input. If they do so carelessly, an attacker can inject their own SQL.

1
2
3
4
5
6
-- The application builds:
SELECT * FROM users WHERE name = '<input>' AND password = '<input>';

-- The attacker types as name:   admin' --
SELECT * FROM users WHERE name = 'admin' --' AND password = '...';
-- Everything after -- is a comment: the password check is gone.

SQL injection can affect all three CIA goals: reading data (C), changing it (I) or deleting tables (A). The fix is not to "filter dangerous characters" but to use parameterised queries (prepared statements), which keep data and code strictly separate.

Injection (including SQL injection and cross-site scripting) was #1 in the OWASP Top 10 of 2017 and #3 in 2021, and is #5 in the OWASP Top 10:2025:

# OWASP Top 10:2025
A01 Broken Access Control
A02 Security Misconfiguration
A03 Software Supply Chain Failures
A04 Cryptographic Failures
A05 Injection
A06 Insecure Design
A07 Authentication Failures
A08 Software or Data Integrity Failures
A09 Security Logging and Alerting Failures
A10 Mishandling of Exceptional Conditions

Check the official list for the exact descriptions.

Supply-chain attacks

Instead of attacking a target directly, the adversary compromises a supplier: a software update, an open-source library or a managed service provider. One successful compromise then reaches thousands of victims. Examples:

  • SolarWinds (2020): a backdoor in a software update.
  • MOVEit (2023): mass data theft through a file-transfer product.
  • XZ Utils (2024): a backdoor planted over years in an open-source compression library, discovered just before it reached major Linux distributions.

Describing attacks like a professional

  • Lockheed Martin Cyber Kill Chain. Seven phases: reconnaissance → weaponisation → delivery → exploitation → installation → command and control → actions on objectives. Every phase where you break the chain stops the attack.
  • MITRE ATT&CK. A detailed, public knowledge base of adversary tactics (the why, such as Initial Access or Persistence) and techniques (the how, such as T1566 Phishing). Defenders use it to check which techniques they can detect.
  • CVE (Common Vulnerabilities and Exposures). Unique IDs for publicly known vulnerabilities, for example CVE-2021-44228 (Log4Shell). CVSS gives a severity score from 0 to 10. CISA's Known Exploited Vulnerabilities catalogue lists those that attackers are actually using; patch these first.

Towards Advanced: attacks per OSI layer

Layer What an adversary can do
1–2 Physical / data link Observe, modify or jam messages on the link; ARP spoofing; rogue access points
3 Network Impersonate an address (IP spoofing); disrupt communication (DoS); hijack routes
4 Transport Scan ports; hide intentions by misusing port numbers; SYN floods; reset connections
7 Application Send crafted input that makes the application crash or do the attacker's bidding (injection, XSS, deserialisation)

The general pattern of an intrusion is: gather information (reconnaissance, scanning) → gain access (exploit a vulnerability, phishing) → escalate privileges → persist and move laterally → act on objectives. You will learn how to practise this legally in B11.

In practice

Exercise 1: threat, vulnerability or attack? (Foundation, 20 min)

Classify each item and explain: a ransomware gang; a laptop without disk encryption; an employee who opens a fake invoice; the password Welkom123; a storm that cuts power; a criminal trying leaked passwords on your school's login page.

Exercise 2: check your exposure (Foundation, 15 min)

Check your e-mail address on Have I Been Pwned and take the Google phishing quiz. Which phishing clues did you miss?

Exercise 3: your first SQL injection, legally (Intermediate, 1 h)

  1. Make a free account at the PortSwigger Web Security Academy.
  2. Read the SQL injection topic and solve the first two labs (retrieval of hidden data and subverting application logic).
  3. Write down in your own words why the attack worked and how a parameterised query would have prevented it.

Alternatively, work through the interactive Hacksplaining lessons on SQL injection and cross-site scripting.

Exercise 4: a vulnerable shop in a box (Intermediate, 2+ h)

Run OWASP Juice Shop, a deliberately insecure web shop, locally:

1
docker run --rm -p 3000:3000 bkimminich/juice-shop

Open http://localhost:3000, find the hidden Score Board and solve the one- and two-star challenges. Note for each which OWASP Top 10 category it belongs to.

Exercise 5: dissect a real attack (Intermediate, 1 h)

Pick a recent incident from the news or from the CISA #StopRansomware advisories. Describe the adversary, the vulnerability used, the phases of the Cyber Kill Chain, and two MITRE ATT&CK techniques. Then look up one of the CVEs involved in the NVD and in the CISA KEV catalogue.

Tools

Tool What you use it for Cost
PortSwigger Web Security Academy Free, high-quality labs on web attacks Free (account)
OWASP Juice Shop Practise web attacks on a deliberately vulnerable app Free, open source
Hacksplaining Short interactive lessons on common vulnerabilities Free
MITRE ATT&CK Look up adversary tactics and techniques Free
NVD / CVE.org Look up vulnerabilities and their scores Free
CISA KEV catalogue Vulnerabilities known to be exploited in the wild Free

Videos and podcasts

Handouts and reading

Literature and courses

Common mistakes

  • Using "threat" and "vulnerability" as synonyms. A vulnerability is your weakness; a threat is the actor or event that could use it.
  • "Nobody would target us." Most attacks are opportunistic and automated: scanners try every IP address on the Internet. Being small does not protect you.
  • Fixing SQL injection with a blacklist. Filtering quotes or keywords is always incomplete. Use parameterised queries.
  • Practising on real sites. Testing a "small" SQL injection on a real website is a criminal offence. Use labs.

Check yourself

  1. What can be the aims of an attacker? Name four.
  2. What is the difference between an insider and an outsider attacker, and why are insiders hard to detect?
  3. What is the difference between a vulnerability and a threat?
  4. What is the difference between a worm and a virus?
  5. Which CIA goals can an SQL injection attack affect, and what is the correct fix?
  6. Someone floods a target with requests from many systems at once. What is this called?
  7. Why do supply-chain attacks have such a large impact?
Answers

1. For example: steal data or money, spy, disrupt or destroy, deceive, extort.
2. An insider has legitimate access inside the organisation; an outsider does not. Insiders are hard to detect because their activity looks like normal work.
3. A vulnerability is a weakness; a threat is something or someone that could exploit it to cause harm.
4. A virus needs a host file and user action to spread; a worm spreads by itself across networks.
5. Confidentiality, integrity and availability. Use parameterised queries (prepared statements).
6. A distributed denial-of-service (DDoS) attack.
7. One compromised supplier or component is trusted by many customers, so a single compromise reaches all of them at once.