Executive summary
A zero-day is a vulnerability exploited before a vendor has a patch (the defender has “zero days” of warning). Modern zero-days usually chain multiple bugs—initial code execution → sandbox escape → privilege escalation—and are delivered through browsers, VPN/edge appliances, email/PDF, mobile baseband, or supply-chain channels. This guide breaks down the technical mechanics of discovery and exploitation, then gives a defense blueprint that reduces blast radius even when a patch doesn’t exist yet.
1) Zero-day lifecycle
- Discovery
- Fuzzing: AFL++, libFuzzer, honggfuzz generate inputs to crash parsers (image/PDF/font/JS/codec).
- Static/diff analysis: binary diffing (BinDiff, Diaphora) across releases uncovers silent fixes → “1-day to 0-day” re-weaponization.
- Logic auditing: auth/crypto/state bugs (SSRF, path traversal, deserialization) common in VPN/IDP, SSO, MDM.
- Weaponization
- Build primitives: info leak → ASLR bypass; arbitrary read/write; type confusion; ROP/JOP chains.
- Chain with sandbox escape (broker IPC, kernel driver) and LPE (kernel/UAC/container breakout).
- Add evasion: staged payloads, signed loaders, living-off-the-land.
- Delivery
- Web drive-by, malvertising, watering hole, malicious documents, pre-auth edge appliance RCE, mobile baseband messages, or poisoned updates (supply chain).
- Operationalization
- Persist, dump creds/tokens, move laterally, blend with legitimate admin tools, and rotate infrastructure.
2) Core bug classes & exploitation notes
A) Memory safety (native code)
- Use-After-Free (UAF), OOB read/write, heap overflow, integer overflow.
- Exploit flow: groom heap → free target → re-occupy with controlled object → hijack vtable/return addr.
- Mitigation bypasses:
- DEP/W^X → ROP to call
VirtualProtect/mprotect. - ASLR → info-leak via uninitialized memory, format string, or side-channel.
- CFI/CFG/CET/PAC → pivot to data-only attacks, JIT spraying, COOP (Counterfeit Object-Oriented Programming).
- DEP/W^X → ROP to call
B) Browser/JS engines
- Type confusion (
addrof/fakeobjprimitives), JIT mis-optimization, IC (inline cache) bugs. - Typical chain: renderer RCE → sandbox escape (GPU/IPC) → kernel LPE.
C) Logic & deserialization
- Pre-auth RCE in VPN/IDP gateways via template engines, path traversal → RCE, and insecure deserialization leading to gadget chains (
readObject,ysoserial-style). - SSRF to metadata endpoints → cloud token theft.
D) Kernel & hypervisor
- Race conditions (TOCTOU), ioctl mishandling, reference count bugs, VM exit handlers in hypervisors.
- Kernel exploit grants SYSTEM/root, disables EDR, dumps LSASS/Keychain, or escapes containers.
E) Cloud/SaaS
- AuthN/AuthZ flaws (mis-scoped tokens, confused deputy), tenant isolation gaps, or supply-chain package takeovers.
- Impact is blast-radius-wide despite no local code exec.
3) Example kill chain (pre-auth edge RCE → domain compromise)
- Delivery: attacker hits a vulnerable SSL-VPN endpoint with crafted request → pre-auth command injection.
- Foothold: drop web shell; exfil config & creds; pivot to internal AD CS/IDP.
- Privilege: abuse unconstrained delegation or AD CS ESC(1/8) to mint golden cert → DA.
- Impact: encrypt file shares; exfil to object storage; extort.
Why it wins: internet-exposed management plane + single-sign-on trust + patch lag.
4) Blue-team playbook when a 0-day drops (no patch yet)
A) Reduce exposure (minutes–hours)
- Pull management interfaces behind VPN/ZTNA; geo-fence and rate-limit.
- Apply virtual patches: WAF/IPS rules for request patterns (odd headers, traversal, template tokens).
- Disable risky features (file uploads, SSO auto-provision) temporarily.
B) Hunt & detect (hours–day 1)
- EDR: alert if web processes spawn shells
httpd/nginx/java/w3wp -> {cmd,powershell,bash,sh}
- Network: new outbound from appliances; unusual DNS to dynamic hosts.
- Logs: spikes in HTTP 500/400, strange 8-bit/serialized payloads, ../../ paths,
Content-Typeanomalies.
C) Contain (day 1)
- Rotate creds, revoke tokens, clear SSO/IdP sessions.
- Isolate compromised hosts; rebuild from known-good images.
D) Patch & validate (day 2+)
- Apply vendor fix; re-scan; pen-test the control plane; add regression tests.
5) Detections you can deploy now
Sigma — Web process spawning shell
yamlCopyEdittitle: Web Layer Spawns Shell
logsource: windows
detection:
sel:
ParentImage|endswith:
- '\w3wp.exe'
- '\httpd.exe'
- '\nginx.exe'
- '\java.exe'
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\bash.exe'
condition: sel
level: high
Suricata — crude traversal probe (virtual patch seed)
yamlCopyEditalert http any any -> $HOME_NET any (msg:"Traversal probe";
content:"../"; http_uri; nocase; classtype:web-application-attack; sid:420001;)
KQL — suspicious OAuth app consents (post-exploit)
kustoCopyEditAuditLogs
| where OperationName in ("Consent to application","Add app role assignment to service principal")
| summarize count() by InitiatedBy, bin(TimeGenerated, 1h)
| where count_ > 1
6) Architecture to survive zero-days
- Segmentation & brokers
- Put admin planes behind device posture + MFA; mTLS for consoles; no direct internet to OT/physical-security gear.
- Exploit mitigations on
- CFG/CET/PAC, ASLR, DEP, sandboxing, site isolation; kernel HVCI / SIP; disable legacy scripting.
- App isolation
- Containerize high-risk services; read-only filesystems; drop privileges and seccomp profiles.
- Resilient identity
- Phish-resistant MFA (FIDO2), token binding, short TTLs, conditional access; tiered admin.
- Backups & recovery
- Immutable backups with offline copy; restore runbooks exercised monthly.
- Observability
- Full command-line + network telemetry; crash triage + symbolized stack capture.
7) Programmatic prevention (30-60-90 days)
Days 1–30 — Find & shrink your blast radius
- Inventory internet-facing assets; move admin to private access; add rate-limits/geo-blocks.
- Turn on Exploit Protection/ASR rules for endpoints; enforce EDR tamper-protection.
- Subscribe to CISA KEV, vendor advisories, and VEX (exploitability) feeds.
Days 31–60 — Make patching a pipeline
- Standardize canary rings and emergency change windows.
- Add SBOM generation in CI; track dependency exposure; auto-block builds with known KEVs.
- Start in-house fuzzing for critical parsers and file handlers.
Days 61–90 — Assume 0-day, prove resilience
- Purple-team drills: drive-by → browser → kernel → EDR bypass; edge RCE → AD CS → DA.
- Add deception/canary web endpoints and credentials.
- Measure: MTTD/MTTR, % management services off the internet, exploit blocking rate, patch SLA.
8) Executive FAQ (to align leadership)
- “Can we stop zero-days?” Not all, but we can reduce exposure time and limit impact: isolate control planes, enforce MFA, harden endpoints, and practice recovery.
- “What’s the ROI?” Fewer outages and lower ransom/forensics costs; regulatory relief by demonstrating due diligence and KEV responsiveness.
- “What should we fund first?” Patching pipeline, ZTNA for admin planes, telemetry/EDR coverage, and backup immutability.
Key takeaways
- Zero-days are usually chains; break any link (delivery, sandbox, LPE, identity) to win time.
- Virtual patching + segmentation + exploit mitigations keep you upright until vendor fixes land.
- Treat exposed management planes and edge devices as Tier-0; don’t leave them on the open internet.
- Drill incident runbooks; measure—not hope—your resilience.
Leave a comment