Skip to content

Threat Taxonomy & Malware

The CIA Triad is the foundation every security decision is measured against. Before categorising attacks, you need a shared vocabulary.

┌─────────────────────────────────────────────────────────┐
│ CIA Triad │
│ │
│ Confidentiality ──── Integrity ──── Availability │
│ (who can see it) (has it changed?) (can we use it) │
└─────────────────────────────────────────────────────────┘
PillarGoalAttack that breaks it
ConfidentialityOnly authorized parties can read dataData breach, sniffing, credential theft
IntegrityData is accurate and unmodifiedTampering, MitM injection, hash collision
AvailabilityAuthorized users can access systems when neededDoS/DDoS, ransomware, hardware destruction

TermDefinition
VulnerabilityA flaw in a system that could be exploited
Zero-dayA vulnerability unknown to the vendor but known to an attacker
ExploitCode/technique that takes advantage of a vulnerability
ThreatPotential danger that can exploit a vulnerability
RiskProbability × Impact of a threat materializing
AttackAn active attempt to exploit a vulnerability and cause harm
Attack vectorThe path or method used to gain unauthorized access
Attack surfaceSum of all possible attack vectors in a system

Malware (malicious software) is any code designed to harm, spy on, or take control of a system without the user’s consent.

Malware
├── Self-propagating
│ ├── Virus - attaches to host files; spreads when executed
│ └── Worm - spreads autonomously via network/OS vulns; no host needed
└── Non-propagating (requires user action or manual install)
├── Trojan - disguised as legitimate software
├── Adware - bundled with free software; displays ads
├── Ransomware - encrypts data; demands payment for key
└── Logic Bomb - dormant until a trigger condition fires
TypePrimary GoalReal-World Example
VirusReplicate and infect executablesILOVEYOU (2000) - spread via email attachments
WormSelf-propagate across networksWannaCry (2017) - exploited SMB EternalBlue vuln
TrojanBackdoor disguised as legit softwareZeus - banking Trojan capturing credentials
SpywareSilently monitor and exfiltrate dataFinFisher - commercial stalkerware
KeyloggerRecord keystrokes (passwords, messages)Sub-category of spyware
AdwareDisplay ads; may track browsingOften bundled with freeware installers
RansomwareEncrypt data; extort victimWannaCry, LockBit, REvil
RootkitPersist undetected at OS/kernel levelStuxnet rootkit component
Bot / BotnetRemote-controlled zombie; used for DDoS, spam, crypto miningMirai (IoT botnet, 2016 Dyn attack)
BackdoorCovert re-entry path for attackerSub7, DarkComet
Logic BombActivate on a trigger (date, event)Insider threat - deletes files upon termination

The attacker inserts themselves between two communicating parties. Neither party knows the session is being intercepted.

Normal: Client ──────────────────── Server
MitM: Client ── Attacker ──────── Server
intercepts/modifies traffic

Common MitM techniques:

TechniqueHow it works
ARP PoisoningAttacker floods LAN with fake ARP replies, associating their MAC with victim’s IP
DNS SpoofingPoison DNS cache to redirect domain to attacker-controlled IP
Session HijackingSteal session cookie from HTTP traffic; replay to impersonate authenticated user
SSL StrippingDowngrade HTTPS to HTTP connection by intercepting the redirect
Rogue AP / Evil TwinDeploy a fake Wi-Fi hotspot mimicking a legitimate SSID; victims connect and expose traffic

Defences: HTTPS everywhere, HSTS preloading, certificate pinning, WPA2-Enterprise (802.1X), network monitoring for ARP anomalies.


Goal: exhaust a resource (CPU, memory, bandwidth, connection table) so legitimate users can’t access the service.

DoS: Attacker ──→ Target (single source)
DDoS: Bot 1 ─┐
Bot 2 ─┼──→ Target (thousands of bots via botnet)
Bot N ─┘
Attack TypeLayerMechanism
Ping of DeathNetwork (L3)Malformed oversized ICMP packet causes buffer overflow
Ping Flood (ICMP Flood)Network (L3)Saturation with ICMP echo requests
SYN FloodTransport (L4)Fill connection table with half-open TCP connections; server never receives ACK
UDP FloodTransport (L4)Random UDP packets force target to respond with ICMP Unreachable on each
HTTP FloodApplication (L7)Valid HTTP GET/POST requests at massive scale to exhaust web server
Amplification (Reflected)Network (L3/4)Spoof victim IP; small request to open server elicits large response back to victim (DNS/NTP/memcached)
VolumetricNetwork (L3)Pure bandwidth saturation (Gbps/Tbps scale) - requires botnet or amplification

Notable DDoS events:

YearTargetScaleMethod
2013Spamhaus300 GbpsDNS amplification
2016Dyn DNS~1.2 TbpsMirai IoT botnet
2018GitHub1.35 TbpsMemcached amplification (51,000× amplification factor)
2020AWS Shield2.3 TbpsCLDAP reflection

Defences:

  • Rate limiting and traffic shaping at edge routers
  • SYN cookies on TCP stacks
  • Anycast CDN absorption (Cloudflare, Akamai)
  • Upstream scrubbing centres (ISP-level BGP blackholing)
  • fail2ban for single-source volumetric attacks at host level

Attacker injects a forged DNS record into a resolver’s cache. All clients using that resolver are redirected to the attacker’s IP until the TTL expires.

Attack flow:
1. Attacker sends forged DNS response to resolver
(race with legitimate response - Kaminsky Attack)
2. Resolver caches fake record
3. All clients querying for example.com get attacker's IP
4. Attacker serves fake site or intercepts traffic

Defence: DNSSEC (cryptographically signs records), use of DNS over HTTPS/TLS (DoH/DoT), randomised source ports and query IDs (RFC 5452).


Injection attacks occur when untrusted data is sent to an interpreter as part of a query or command.

TypeTargetPayload Example
SQL Injection (SQLi)SQL databases' OR '1'='1 - bypasses authentication
Cross-Site Scripting (XSS)Browser/users<script>document.cookie</script> injected into page
Command InjectionOS shell; rm -rf / appended to a shell-executing input
LDAP InjectionDirectory servicesManipulated LDAP filter to bypass auth

SQLi mental model:

-- Intended query:
SELECT * FROM users WHERE username='alice' AND password='secret';
-- Attacker input: username = admin'--
-- Resulting query (password check bypassed by comment):
SELECT * FROM users WHERE username='admin'--' AND password='anything';

Defences:

  • Parameterised queries / prepared statements (never concatenate user input into SQL)
  • Input validation and allowlisting
  • Web Application Firewall (WAF)
  • Least privilege on DB accounts

AttackMethodMitigation
Brute ForceTry every combinationRate limiting, account lockout, long passwords
Dictionary AttackWordlist of common passwordsComplexity requirements, check against HaveIBeenPwned
Credential StuffingUse breached credentials from other sitesMFA, breach detection, passwordless auth
Rainbow TablePrecomputed hash lookup tablePassword salting (makes precomputation infeasible)
Pass-the-Hash (PtH)Replay stolen NTLM hash directlyNetwork authentication guard, Kerberos, Protected Users group
KeyloggingRecord keystrokes to capture passwordsEDR, hardware key authenticators (FIDO2)

Malware Detection & Removal - Practical Procedure

Section titled “Malware Detection & Removal - Practical Procedure”
Terminal window
# On Linux: check for suspicious processes
ps aux | sort -k3 -rn | head -20 # top CPU consumers
ss -tulnp # open sockets + owning process
ls -la /proc/$(pidof suspicious)/exe # real binary path for a PID
Terminal window
# On Windows: check processes and network connections
Get-Process | Sort-Object CPU -Descending | Select-Object -First 20
Get-NetTCPConnection -State Established | Sort-Object RemoteAddress
  • Disconnect network: disable Wi-Fi, unplug Ethernet
  • Disable auto-backups: prevents malware getting baked into a restore point
  • Do NOT power off if performing forensics - running memory contains artifacts (encryption keys, C2 addresses)

Boot from a clean live USB (e.g., Ubuntu, Windows PE) and run scanner against the mounted drive to avoid the malware subverting its own detection.

Terminal window
# Example: ClamAV offline scan
clamscan -r --remove /mnt/suspicious_drive/
  • If removal fails → restore from last known-clean backup
  • If no backup → rebuild from scratch (reinstall OS)
  • Patch the vulnerability that allowed the initial infection
  • Create a clean restore point
  • Re-enable automatic updates and AV definitions
  • Document the incident (what, when, how, impact)

ControlAddresses
Patch management / automatic updatesExploitable known CVEs
Endpoint antivirus/EDRKnown malware signatures + behavioural detection
Principle of least privilegeLimits blast radius of any compromise
Network segmentation (VLANs)Limits lateral movement
Firewall (host-based + perimeter)Blocks unwanted inbound/outbound traffic
MFA on all accountsCredential theft (phishing, brute force)
Regular, tested backups (3-2-1 rule)Ransomware, physical damage
IDS/IPSDetects/blocks known attack patterns
User security trainingSocial engineering (covered in the next note)