Chapter 8

Security Vulnerabilities,
Threats & Countermeasures

A comprehensive, visual study guide — with mnemonics, summaries, and clear explanations across all system layers.

🔧

Hardware Components

CPU execution types & processing models

🧠 Mnemonic — CPU Execution Types
MM  MT
"Many Machines, Many Threads" — the two M's cover the 3 multi- types + threading
M
Multitasking — handling 2+ tasks simultaneously at the OS level
M
Multicore — one chip, multiple independent CPU cores
M
Multiprocessing — multiple physical CPUs; 2 sub-types below
T
Multithreading — concurrent program parts on a single processor

SMP — Symmetric Multiprocessing

All processors share one OS & memory. Think of a team working from the same office — shared resources, tightly coupled.

MPP — Massive Parallel Processing

Each processor has its own OS & memory. Think of separate offices — loosely coupled, highly scalable.

💡Memory: SMP = Shared. MPP = My own.
🛡

Protection Mechanisms

Hardware-level privilege control & process management

1. Protection Rings

Inner = more privilege. The OS kernel sits at the center; user apps are on the outside.

0
OS Kernel / Memory — highest privilege, runs in supervisory (privileged) mode
1
Other OS Components — still privileged
2
Drivers & Protocols — device drivers, network protocols
3
User-Level Programs — lowest privilege, runs in user mode. All requests must be authorized.
🧠 Memory trick

"Rings 0–2 = Supervisory, Ring 3 = Street level"
Or: 0 is the boss, 3 is the employee who needs permission for everything.

2. Operating States

  • Supervisory state — all-access; can execute any instruction & reference any memory
  • Operating/Problem state (User mode) — limited; every access request checked against credentials

3. Process States

Managed by the Process Scheduler:

Ready Running Waiting Terminated
🧠"Real Workers Retire Today" — Ready → Waiting → Running → Terminated
💾

Memory Protection Mechanisms

Primary & secondary memory types + protection techniques

ROM — Read Only Memory

Non-volatile. Data persists without power. Four types:

  • PROM Programmable ROM — write once
  • EPROM Erasable (UV light) then re-writable
  • EEPROM Electronically erasable — used for BIOS
  • Flash Modern EEPROM variant; fast block erasure

RAM — Random Access Memory

Volatile. Data lost when power off. Three levels:

  • Real Main working memory
  • Cache Fast buffer between CPU and RAM
  • Registers Fastest; inside the CPU itself

Why Memory Protection Matters

Prevents one process from accessing another's memory space → preserves data integrity, prevents system crashes, and stops unauthorized data access.

🧠 Mnemonic — Primary Memory Protection Techniques
PAD·PK·KB
P
Paging & Segmentation — divides memory into chunks with specific access rights (read/write/execute)
A
ASLR — Address Space Layout Randomization; randomizes memory addresses to stop attackers finding target code
D
DEP — Data Execution Prevention; marks regions as non-executable to block malware
P
Protection Keys (MPK) — numeric keys for fast permission changes on memory blocks
K
Kernel Protection — protects OS memory from user-level malware
B
Buffer Overflow Mitigation — blocks attacks that overwrite memory to hijack program flow
+ Process Isolation: each app gets its own memory space

Secondary Memory Protection

Protects non-volatile storage (HDD, SSD, USB, cloud). Critical because data survives power-off — prime target for long-term exfiltration.

🧠 Mnemonic — EIAA·P
E
Encryption at-rest — full-disk or file-level; stolen data stays unreadable
I
Immutable Backups — object locking; ransomware can't modify or delete them
A
Air-Gapping — physically separate backups from the network
A
Access Controls & Auth — MFA + strict permissions on storage partitions
P
Physical Security — lock servers, remove removable media
⌨️

Input / Output Devices

Yes, even keyboards and mice can be attack vectors

Device Types

  • Input Keyboards, mice, scanners, mics, cameras
  • Output Monitors, printers, projectors, speakers
  • Storage USB drives, external HDDs, IoT sensors
  • Network Modems, routers

⚠️ Can basic devices be risky?

Yes! A USB drive can inject malware. A compromised keyboard can log keystrokes. A malicious router can intercept all traffic.

🧠 Mnemonic — I/O Protection: PPSANE·I
P
Physical Security — lock devices, use surveillance, access badges
P
Port Control — disable/remove unused USB, CD/DVD ports
S
Software Updates — patch firmware and drivers regularly
A
Authentication & Access Control — strong passwords or biometrics
N
Network Segmentation — isolate IoT/peripherals from main network
E
Encryption (TLS) — encrypt data in transit between devices
I
Input Validation — ensure data integrity, block malicious code via input
⚙️

Firmware

Microcode stored in ROM — the software closest to hardware

BIOS

Basic Input/Output System. Stored on EEPROM chip.
Updating it = "flashing the BIOS".
Threat: Phlashing — malicious code embedding itself into BIOS (very hard to remove!)

UEFI

Unified Extensible Firmware Interface. Replaced BIOS since 2011. More advanced interface between hardware and OS — supports larger drives, faster boot, Secure Boot feature.

Hardware Device Firmware

Printers, modems, routers each have mini-OS stored as firmware in EEPROM. If compromised, they become persistent attack footholds.

⚠️Key exam point: Firmware attacks are especially dangerous because they survive OS reinstalls and are very difficult to detect or remove.

The Software Stack (Bottom → Top)

🔩 Hardware — the physical chips and circuits
⚙️ Firmware — BIOS/UEFI, device microcode
💻 Operating Systems — Windows, Linux, macOS
🔗 Middleware — APIs, runtime environments
📱 Software — user applications
🖥

Protecting Client & Server Systems

Endpoint security + server hardening

Client-Side Security

Secures the user endpoint (laptops, mobiles, browsers).
Attack example: malicious website injects code into a vulnerable browser.

  • Endpoint Security (EDR) — antivirus + detection & response
  • Browser Security — Content Security Policy (CSP), HttpOnly/Secure cookies
  • Input Sanitization — validate all inputs client & server side
  • Code Obfuscation — make JS hard to reverse engineer
  • Patching — keep browsers & OS updated

Server-Side Security

Servers = primary target (sensitive data, central control). Key concerns: data flow control, load balancing, throughput, DoS/DDoS defence.

  • NGFW & WAF — filter network & app-layer traffic
  • Patch Management — regular OS/app updates
  • MFA + RBAC — access control & least privilege
  • Encryption — protect data at rest
  • IDS/IPS — monitor & block suspicious traffic
  • Server Hardening — disable unused ports/services
  • DDoS Mitigation — tools to absorb volumetric attacks
🧠 Server Protection — "NPMEDIS"
N
NGFW / WAF
P
Patch Management
M
MFA + RBAC
E
Encryption
D
Detection (IDS/IPS)
I
Isolate (Server Hardening)
S
Stop DDoS
🗄

Database Systems Security

CIA Triad for stored data — Confidentiality, Integrity, Availability

📌DB security covers: the DBMS itself + applications + physical servers + network infrastructure, through access controls, encryption, and auditing.

⚠️ Common Threats

  • SQL/NoSQL Injection — malicious code in queries manipulates the DB
  • Insider Threats — malicious or careless authorized employees
  • Misconfigured DB — default passwords, open ports
  • Weak/Missing Encryption — data readable if system is breached
  • Ransomware — data encrypted or stolen, ransom demanded

✅ Best Practices

  • Least Privilege — users get minimum necessary access
  • Data Masking — hide sensitive data in non-production environments
  • Secure Backups — regular, encrypted backups
  • Vulnerability Scanning & Pen Testing
  • Physical Security — secure servers hosting the DB
🧠 DB Threats — "SIM·WR"
S
SQL Injection
I
Insider Threats
M
Misconfiguration
W
Weak Encryption
R
Ransomware
☁️

Cloud Computing Security

AWS, Azure, Google, Alibaba — protecting data, apps & infrastructure

Cloud Service Models

📱 SaaS — Software as a Service (Gmail, Office 365) — you use the app
🔧 PaaS — Platform as a Service (Heroku, Azure) — you build the app
🖥 IaaS — Infrastructure as a Service (raw VM/storage) — you manage the OS up

Key Concepts

  • Hypervisor/VMM Creates, manages, and operates virtual machines
  • Elasticity Cloud's ability to expand or shrink resources on demand
  • Shared Responsibility CSP secures "of" the cloud; customer secures "in" the cloud

Shared Responsibility Model — The Golden Rule

☁️ CSP is responsible FOR:

Physical data centers, networking, storage hardware, virtualization layer — the cloud itself

👤 Customer is responsible FOR:

Data, applications, identity management, access controls — what's IN the cloud

⚠️ Common Cloud Threats

  • Misconfigurations — #1 cause of cloud breaches
  • Account Hijacking — weak credentials exploited
  • Insecure APIs — vulnerabilities in cloud management interfaces
  • Insider Threats — risks from within the organization

✅ Cloud Security Strategies

  • IAM + MFA — control who accesses what
  • Data Encryption — at rest and in transit
  • CSPM — Cloud Security Posture Management for compliance
  • CWPP + CNAPP — workload & cloud-native app protection
  • Secure Backups — encrypted, off-site
📡

IoT Security

Cameras, sensors, smart devices — insecure by design

⚠️Key stat: 83% of medical IoT devices run on unsupported operating systems — critical attack surface!

⚠️ Key Threats & Challenges

  • Weak Firmware — rushed to market, little security testing
  • No Encryption — most IoT traffic is unencrypted
  • Default Credentials — never changed from factory defaults
  • Gateway Risk — compromised device = entry to entire network
  • Unsupported Software — no patches, ever-growing vulnerabilities

✅ Best Practices

  • Change Default Passwords immediately
  • Update Firmware regularly
  • Network Segmentation — IoT on its own VLAN
  • Zero Trust — authenticate every device continuously
  • Disable Unused Features (Bluetooth, remote access)
  • MFA whenever available
🧠 IoT Best Practices — "CUNZD·M"
C
Change default passwords
U
Update firmware
N
Network segmentation
Z
Zero Trust
D
Disable unused features
M
MFA
🌐

Web-Based Security

Protecting websites, APIs & web applications

Threat What it does Mitigation
SQL Injection (SQLi) Malicious code injected into DB queries to extract/alter data Validate & sanitize all user inputs; use parameterized queries
XSS (Cross-Site Scripting) Malicious scripts injected into trusted websites Escape user-provided content; use Content Security Policy
DDoS Flood servers with traffic to make services unavailable DDoS mitigation services, rate limiting, traffic scrubbing
Broken Access Control Unauthorized access to accounts or data Strict authentication mechanisms, RBAC

Key Web Security Components

  • WAF — Web Application Firewall; filters HTTP traffic between app and internet
  • Vulnerability Scanning — automated tools find known weaknesses
  • Secure Coding (OWASP Top 10) — build security in from the start
  • API Security — protect interfaces from unauthorized access
  • SSL/TLS — encrypt data in transit

Pen Test Checklist for Web

  • View hosted web pages for exposed info
  • Explore automation technologies in use
  • Check file and backup handling
  • Evaluate SSL/TLS transmission security
  • Test authentication & session management
  • Review cryptography & data validation
  • Check DoS defences & error handling
🧠 Web Threats — "SXDBr" (Sx + D + B)
S
SQL Injection
X
XSS — Cross-Site Scripting
D
DDoS
B
Broken Access Control
📱

Mobile Device Security

Device security + app security + BYOD concerns

Device Security Features

Useless if not activated!

  • Full device encryption
  • Remote wiping
  • Screen locks & lockout
  • GPS tracking
  • Application control
  • Storage segmentation
  • Disabling unused features

Application Security

  • Key Management — most crypto failures are from bad key mgmt, not algorithms
  • Credential Management — central, secure storage of creds
  • Authentication — passwords + biometrics
  • Geotagging — can reveal routine patterns; use carefully
  • Encryption — enable if available
  • App Whitelisting — deny by default, allow by exception (opposite of blacklisting)

BYOD — Bring Your Own Device

Policy allowing employees to use personal devices for work. Improves morale but introduces significant security risks.

📋 Key BYOD Concerns
  • Data Ownership — who owns the data? Remote wipe issues
  • Support Ownership — who pays for repairs?
  • Patch Management — who ensures updates?
  • Antivirus — required or optional?
  • Privacy — employee loses some privacy
  • Forensics — how are devices investigated?
  • Onboarding/Offboarding — processes for enrollment & departure
🔄 BYOD Alternatives
  • COPE Company Owned, Personally Enabled — company provides device, employee personalizes
  • CYOD Choose Your Own Device — employee picks from approved list
  • VDI/VMI Virtual Desktop/Mobile Infrastructure — apps run in a virtual environment, not on the device
🧠 BYOD Concerns — "Data Support Patches Antivirus For Privacy On/Off"

D-S-P-A-F-P-O: Data ownership, Support, Patching, Antivirus, Forensics, Privacy, Onboarding/Offboarding

💻

Operating System Security

Technical & policy mechanisms + OS hardening

⚙️ Technical Mechanisms

  • Layering — ring-model structure for OS privilege levels
  • Abstraction — access rights assigned to groups of objects, not individuals
  • Data Hiding — objects placed in different security containers from subjects (need-to-know)
  • Process Isolation — separate memory spaces for each process's instructions & data
  • Hardware Segmentation — like process isolation but enforced by physical hardware controls

📋 Policy Mechanisms

  • Least Privilege — users get only the minimum access needed for their job. Nothing more.
  • Separation of Duties — critical tasks split across multiple people; reduces insider fraud
  • Accountability — all privileged actions logged; "who did what?"
🧠 "LSA"

Least Privilege · Separation of Duties · Accountability

OS Hardening — The 6-Point Shield

🗑
Remove Unnecessary Software

Less software = smaller attack surface

🔧
Change Default Configurations

Defaults are publicly known; change them

🔥
Enable Firewall

Block unauthorized network traffic

🔑
Use Strong Passwords

Complex, unique credentials across all accounts

🔐
Enforce MFA

Multi-Factor Authentication for all privileged access

🔍
Enable Audit & Monitoring

Log everything; detect anomalies early

🧠 OS Hardening — "RCFSMEA"

Remove unnecessary software · Change defaults · Firewall · Strong passwords · MFA · Enable auditing

Phrase: "Really Careful Firewalls Seem More Effective Always"

📊

Master Summary Table

All layers at a glance — great for last-minute review

Layer Key Threats Key Defences Mnemonic
Hardware / CPU Side-channel attacks, privilege escalation Protection rings, operating states, process isolation MM·MT
Memory Buffer overflow, process injection ASLR, DEP, paging, MMU PAD·PK·KB
I/O Devices Malicious USB, keyloggers, rogue devices Port control, physical security, input validation PPSANE·I
Firmware Phlashing, BIOS rootkits Secure Boot (UEFI), firmware updates, integrity checks
Client Systems Drive-by downloads, XSS, malware EDR, CSP, patching, code obfuscation
Server Systems DDoS, SQL injection, unauthorized access WAF, NGFW, IDS/IPS, MFA, server hardening NPMEDIS
Database SQL injection, insider threats, ransomware Least privilege, encryption, masking, auditing SIM·WR
Cloud Misconfigurations, account hijacking, insecure APIs IAM, CSPM, shared responsibility model, MFA
IoT Default creds, no encryption, botnets Network segmentation, Zero Trust, firmware updates CUNZD·M
Web SQLi, XSS, DDoS, broken access control WAF, input validation, TLS, OWASP guidelines SXDBr
Mobile Malicious apps, BYOD risks, geotracking App whitelisting, encryption, MFA, remote wipe D-S-P-A-F-P-O
Operating System Privilege escalation, rootkits Least privilege, separation of duties, OS hardening LSA / RCFSMEA