
Offensive TOCTOU Exploitation
Guides an agent through finding and exploiting time-of-check/time-of-use race conditions in binaries, kernels and containers.
- Repository
- SnailSploit/Claude-Red
- Stars
- 10,230
- Licence
- MIT
- Files
- 1 file
What it does
This skill gives an AI agent a detailed playbook for time-of-check/time-of-use (TOCTOU) race conditions: bugs where a program checks something (a file path, permission, token or balance) and then acts on it later, after the thing may have changed. The agent learns how to spot these patterns in code, how to swap objects inside the gap, and how to stretch that gap using techniques such as FUSE slow filesystems, userfaultfd, cgroup freezing and single-packet HTTP/2 requests. It is framed as offensive security knowledge, so it is aimed at people doing vulnerability research or exploit development, and it also explains the defensive fixes such as operating on file descriptors and O_NOFOLLOW.
Great for
- Security researchers reviewing privileged binaries or setuid programs for race conditions
- Penetration testers assessing container or Kubernetes escape paths in authorised engagements
- Students learning how TOCTOU bugs work and how they are fixed
Skip it if
- Attacking systems you do not own or have written permission to test, since the techniques are intrusive and can cause privilege escalation or data exposure
- Developers simply wanting to write safe file handling code; the document is oriented to exploitation rather than hardening, so a secure-coding guide would serve them better
- Non-technical users, because the content assumes knowledge of syscalls, kernel internals and container runtimes
Try asking
- “Review this setuid binary's source for access()-then-open() patterns and explain which paths could be swapped by a symlink race”
- “Help me build a race harness to test whether our upload service's check-then-write logic is exploitable in an authorised test”
- “Explain how a FUSE-based slow filesystem can widen a TOCTOU window and write a minimal proof-of-concept for my lab VM”
- “Walk me through the JWT claim TOCTOU risk between our API gateway and backend service”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the MIT licence and an attribution note.
offensive-toctou.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip offensive-toctou.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip offensive-toctou.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Scope the task to a specific authorised target and state that scope in the request so the agent keeps its work bounded
- Provide the source code or strace output of the target; the skill is most useful when it can trace the actual check and use calls
- Test exploit primitives in an isolated VM or container snapshot, since race loops and mount manipulation can destabilise the host
What's inside
- SKILL.md
Redistributed unmodified from SnailSploit/Claude-Red under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.