Skills for Real Engineers. Straight from my .agents directory.
offensive-toctou
Agent skill fromSnailSploit/Claude-Red
Time-of-Check / Time-of-Use (TOCTOU) race condition exploitation methodology across binary, kernel, filesystem, web, and container layers. Covers symbolic-link races (open/access/stat split), file-descriptor races, fopen/realpath traversal races, /proc and procfs races, FUSE-backed slow-fs races to widen the window, ptrace and signal races, kernel double-fetch / userspace pointer races, container/runc/symlink escape primitives, kubernetes admission/authz TOCTOU, web auth-vs-authz TOCTOU, JWT-claim TOCTOU at gateway vs service, payment/idempotency races, and modern race-amplification techniques (single-packet attack, slow loris, FUSE pause, cgroup freeze, scheduler shaping). Use when you've identified a 'check then act' pattern in code, when fuzzing for race conditions, or when exploiting concurrency bugs in privileged binaries / kernel / orchestrators.
How to install offensive-toctou
npx skills add SnailSploit/Claude-Red# or add only this skill to Claude Code: copy the folder
Skills/exploit-dev/offensive-toctou/
# into
~/.claude/skills/offensive-toctou/ (all projects)
.claude/skills/offensive-toctou/ (one project)
1# TOCTOU — Time-of-Check / Time-of-Use Exploitation23A TOCTOU bug exists wherever code checks a property (file owner, path target, token validity, balance) and then acts on it as if the property still holds. Between check and use is a window — your job is to widen it and swap the underlying object.45## Quick Workflow671. Identify the **check** (syscall, function, validation step) and the **use** (the privileged action)82. Confirm the check and use don't operate on the same kernel object (FD, inode, atomic snapshot)93. Build a primitive that swaps the object between check and use (symlink, mount, mv, parallel request)104. **Widen the window** with FUSE, slow filesystems, scheduler tricks, or single-packet HTTP/2115. Run a tight loop and confirm the post-use state corresponds to the swapped target1213---1415## The Core Pattern1617```c18// Vulnerable19if (access(path, W_OK) == 0) { // check — resolves "path" now20 fd = open(path, O_WRONLY); // use — re-resolves "path" later21 write(fd, attacker_data, n);22}23```2425Between `access` and `open`, an attacker replaces `path` with a symlink to `/etc/shadow`. The check sees an attacker-owned file; the use opens shadow as root.2627The fix is always: **operate on the kernel object, not the path.** Use `O_NOFOLLOW`, `openat` with `AT_SYMLINK_NOFOLLOW`, `fstat` on the FD, etc.2829---3031## Filesystem TOCTOU3233### Symlink Swap (Classic)3435```bash36# Setup target — privileged binary that writes to user-supplied path after access() check37…
Excerpt shown under the repository's MIT license.
More skills in Claude-Red
Similar skill repositories
An agentic skills framework & software development methodology that works.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
Editorial diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi. 45 diagram types. Self-contained HTML + SVG. No shadows. No Mermaid slop.
2,955+ reusable AI agent skills for Claude Code, Codex, Cursor and Gemini CLI. AAS Core adds local catalog discovery, agent-owned selection and plan preview. CLI, MCP and plugins.
