CoachnestCoachnest
Sign InGet Started
Back to course

Complete Cybersecurity Bootcamp: Defend, Detect & Respond

…
—
Contents
1

What Is Cybersecurity & Why It Matters

Reading14mFree
2

The CIA Triad & Core Security Principles

Reading16mFree
3

Threat Actors, Motivations & the Attack Surface

Reading14m
4

Setting Up a Safe, Legal Practice Lab

Reading12m
5

Security Domains & Career Paths Overview

Video15m
6

Chapter 1 — Quiz

Quiz10m
7

TCP/IP, the OSI Model & How Data Travels

Reading18m
8

Common Protocols & Their Weaknesses

Reading16m
9

Firewalls, IDS/IPS & Network Segmentation

Reading16m
10

VPNs, TLS in Transit & Secure Remote Access

Reading14m
11

Reading Network Traffic with Wireshark

Video17m
12

Chapter 2 — Networking Quiz

Quiz12m
13

Symmetric vs Asymmetric Encryption

Reading16m
14

Hashing, Salting & Password Storage

Reading16m
15

Digital Signatures, Certificates & PKI

Reading16m
16

Crypto in Practice & Common Mistakes

Reading14m
17

How HTTPS & TLS Work — Visual Walkthrough

Video15m
18

Chapter 3 — Cryptography Quiz

Quiz12m
19

Linux Security Fundamentals & Hardening

Reading18m
20

Windows Security & Active Directory Basics

Reading16m
21

Endpoint Protection: Antivirus, EDR & Application Control

Reading14m
22

Data Protection, Backups & Ransomware Resilience

Reading14m
23

Hardening a Linux Server — Demo

Video16m
24

Chapter 4 — Endpoint Security Quiz

Quiz12m
25

How the Web Works & The HTTP Request Lifecycle

Reading16m
26

Injection Attacks: SQL Injection & Command Injection

Reading18m
27

Broken Access Control & Authentication Failures

Reading16m

Cross-Site Scripting (XSS), CSRF & Security Headers

Reading18m
29

Finding Web Vulnerabilities Safely — Demo

Video17m
30

Chapter 5 — Web Security Quiz

Quiz12m
31

Authentication Factors, MFA & Passwordless

Reading16m
32

OAuth 2.0, OpenID Connect, SAML & JWTs

Reading18m
33

Access Control Models: RBAC, ABAC & Least Privilege

Reading16m
34

Identity Threats: Phishing & Social Engineering

Reading14m
35

Setting Up MFA & SSO — Walkthrough

Video14m
36

Chapter 6 — Identity & Access Quiz

Quiz12m
37

Malware Taxonomy: Viruses, Worms, Trojans & Ransomware

Reading16m
38

The Cyber Kill Chain & MITRE ATT&CK

Reading16m
39

Network Attacks: DoS/DDoS, MITM & Sniffing

Reading14m
40

Vulnerability Management & Penetration Testing

Reading16m
41

Understanding the MITRE ATT&CK Framework — Overview

Video15m
42

Chapter 7 — Threats & Attacks Quiz

Quiz12m
43

The SOC, SIEM & Log Management

Reading16m
44

Detection, Threat Hunting & Threat Intelligence

Reading16m
45

The Incident Response Lifecycle

Reading18m
46

Digital Forensics Fundamentals

Reading14m
47

Inside a SOC: Analyst Workflow — Walkthrough

Video16m
48

Chapter 8 — SecOps & IR Quiz

Quiz12m
49

Cloud Security & the Shared Responsibility Model

Reading16m
50

Container & Kubernetes Security

Reading16m
51

DevSecOps: Shifting Security Left

Reading16m
52

Secure SDLC & Threat Modeling

Reading14m
53

Securing a CI/CD Pipeline — Demo

Video15m
54

Chapter 9 — Cloud & DevSecOps Quiz

Quiz12m
55

Risk Management Fundamentals

Reading16m
56

Security Frameworks, Standards & Compliance

Reading16m
57

Security Awareness, Policy & the Human Factor

Reading14m
58

Cybersecurity Careers, Certifications & Next Steps

Reading16m
59

Cybersecurity Career Roadmap — Overview

Video14m
60

Chapter 10 — GRC & Careers Quiz

Quiz12m
←→navigate lessons
Chapter 5 of 10·Chapter 5 — Web Application Security (OWASP Top 10)
Lesson 28 of 60Reading18 min

Cross-Site Scripting (XSS), CSRF & Security Headers

Cross-Site Scripting (XSS), CSRF & Security Headers¶

Cross-Site Scripting (XSS)¶

XSS injects malicious JavaScript that runs in other users' browsers, in the context of your site — letting attackers steal sessions, log keystrokes, or rewrite the page.

Three Types¶

TypeHow
StoredMalicious script saved in the DB (e.g., a comment), served to every viewer
ReflectedScript bounced off a URL parameter into the response
DOM-basedClient-side JS writes untrusted data into the DOM

The Vulnerable Pattern¶

js
2 lines
1// ❌ Untrusted input written as HTML
2element.innerHTML = userComment;   // <script>steal()</script> executes

Defenses¶

  1. 1.Output encoding — encode data for the context (HTML, attribute, JS, URL). Frameworks like React auto-escape by default; the danger is escape hatches (dangerouslySetInnerHTML).
  2. 2.Input validation — allow-list where possible.
  3. 3.Content Security Policy (CSP) — restrict which scripts may run; blocks most injected scripts even if one slips through.
  4. 4.HttpOnly cookies — keep JS from reading session cookies.
  5. 5.Sanitize HTML with a vetted library (DOMPurify) when you must render user HTML.

Cross-Site Request Forgery (CSRF)¶

CSRF tricks a logged-in user's browser into making an unwanted state-changing request to your site (the browser auto-sends their cookies).

html
2 lines
1<!-- On attacker's site; victim is logged into bank.com -->
2<img src="https://bank.com/transfer?to=attacker&amount=10000">

Defenses¶

  1. 1.Anti-CSRF tokens — a secret per-session token the attacker can't know.
  2. 2.SameSite cookies (Lax/Strict) — browser won't send cookies on cross-site requests (strong modern default).
  3. 3.Re-authentication for sensitive operations.

Security Headers — Cheap, High-Impact Wins¶

HeaderProtects against
Content-Security-PolicyXSS, data injection
Strict-Transport-Security (HSTS)Protocol downgrade, SSL strip
X-Content-Type-Options: nosniffMIME sniffing
X-Frame-Options / frame-ancestorsClickjacking
Referrer-PolicyInfo leakage via Referer
Set-Cookie: HttpOnly; Secure; SameSiteCookie theft, CSRF

Test your headers with tools like securityheaders.com and Mozilla Observatory. Most are a one-line config change for an outsized security improvement.

Secure Development Lifecycle¶

Bake security in: threat modeling at design, secure coding standards, SAST/DAST scanning in CI, dependency scanning (Chapter 9), and code review with a security lens.

Previous

Broken Access Control & Authentication Failures

Next

Finding Web Vulnerabilities Safely — Demo

Use ← → arrow keys to navigate between lessons