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

Injection Attacks: SQL Injection & Command Injection

Reading18m
27

Broken Access Control & Authentication Failures

Reading16m
28

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 26 of 60Reading18 min

Injection Attacks: SQL Injection & Command Injection

Injection Attacks: SQL Injection & Command Injection¶

Injection happens when untrusted input is interpreted as code or commands. It remains one of the most damaging web vulnerabilities.

SQL Injection (SQLi)¶

When user input is concatenated directly into a SQL query, an attacker can alter the query's logic.

The Vulnerable Pattern¶

js
2 lines
1// ❌ NEVER do this — string concatenation
2const q = "SELECT * FROM users WHERE email = '" + email + "'";

If email is ' OR '1'='1, the query becomes:

sql
1 line
1SELECT * FROM users WHERE email = '' OR '1'='1'

...which returns every user. Worse payloads can read other tables, dump password hashes, or (with stacked queries) modify data.

The Fix: Parameterized Queries¶

js
5 lines
1// ✅ Parameterized / prepared statement
2const user = await db.query(
3  "SELECT * FROM users WHERE email = $1",
4  [email]
5);

The database treats email strictly as data, never as SQL. This is the single most important defense. ORMs (Prisma, etc.) parameterize by default — but raw queries can still be vulnerable.

Defense in Depth for SQLi¶

  1. 1.Parameterized queries / prepared statements (primary).
  2. 2.Least-privilege DB accounts — the web app's DB user shouldn't be able to drop tables.
  3. 3.Input validation — allow-list expected formats.
  4. 4.WAF — catches common patterns (secondary, not a substitute).

Command Injection¶

When user input reaches a shell command:

js
2 lines
1// ❌ Vulnerable
2exec("ping -c 1 " + userInput);

Input like 8.8.8.8; rm -rf / runs arbitrary commands. Fix: avoid shelling out; if you must, use APIs that pass arguments as an array (no shell), and strictly validate input.

js
2 lines
1// ✅ Safer — no shell interpretation, args array
2execFile("ping", ["-c", "1", userInput]);

Other Injection Variants¶

  • LDAP injection, NoSQL injection, XML/XXE, template injection — same root cause, different interpreter.
  • The universal fix: separate code from data, validate input, and apply least privilege.

Detection¶

Watch logs for SQL syntax in parameters, sudden errors, or unusual query volumes. Database activity monitoring and WAF logs are valuable detection sources.

Previous

How the Web Works & The HTTP Request Lifecycle

Next

Broken Access Control & Authentication Failures

Use ← → arrow keys to navigate between lessons