Skip to content

Guide · Agent skill

How to use the offensive-toctou agent skill for TOCTOU testing

Updated · written with AI from the project's own documentation and checked against our catalogue data

The offensive-toctou skill is a methodology file that gives an AI agent a structured playbook for time-of-check/time-of-use (TOCTOU) race conditions. A TOCTOU bug happens when a program checks something, such as a file path, a permission, a token or a balance, and then acts on it later after it may have changed. This guide explains what the skill does, how to install it, how to ask for it in plain language, and what you need before running anything. It is written for people doing authorised vulnerability research, penetration testing or study.

Offensive TOCTOU ExploitationSnailSploit/Claude-Red · MIT

Quick start

  1. 1Download the ZIP. Get the offensive-toctou ZIP from the item page on this site.
  2. 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project only.
  3. 3Or upload it in the Claude apps. Go to Settings, then Capabilities, then Skills, and upload the ZIP there.
  4. 4Check your environment. Confirm you have Linux, a C compiler, strace, and Python with fusepy if you plan to run the FUSE example.
  5. 5Confirm authorisation. Make sure the target is a lab system or one you have written permission to test.
  6. 6Ask in plain language. Describe the check-then-act code, the privileged action and your authorised context in a clear request.

What the offensive-toctou skill makes the agent do

The skill is a SKILL.md file that covers TOCTOU race conditions across several layers: binaries, the kernel, filesystems, web APIs and containers. It describes how to identify a check-then-act pattern in code, how to build a swap that replaces the underlying object between the check and the use, and how to stretch that gap so the swap lands reliably.

The source covers filesystem cases such as symbolic-link races, file-descriptor races and /proc races, kernel double-fetch issues, container and Kubernetes escape primitives, web and JWT authorisation splits, and payment or idempotency races. It also covers amplification techniques such as FUSE-backed slow filesystems, cgroup freezing and single-packet HTTP/2 requests. The skill also explains the defensive fixes, such as operating on file descriptors and using O_NOFOLLOW.

How to install the offensive-toctou skill

Agent skills are folders of instructions that an agent loads when a task matches them. To install this one, download the ZIP from the item page on this site and unzip it into your personal skills folder, ~/.claude/skills/, or into a project's .claude/skills/ folder if you want the skill available only in that project.

You can also upload the ZIP in the Claude apps under Settings, then Capabilities, then Skills. Use whichever method suits your setup. The skill ships as a single file, SKILL.md.

  • Download the ZIP from the offensive-toctou page on this site.
  • Unzip it into ~/.claude/skills/ for all projects, or into .claude/skills/ inside one project.
  • Alternatively, open the Claude apps, go to Settings, then Capabilities, then Skills, and upload the ZIP.
  • Start a new session so the agent can see the newly added skill.

What you need before you start

The skill's examples assume a Linux system with a C compiler, strace and standard shell tools. The FUSE example needs Python with the fusepy package. Some mount and cgroup techniques need root privileges or user-namespace privileges.

Use a lab or an authorised test environment. The techniques are intrusive and can cause privilege escalation or data exposure if pointed at systems you do not own or have written permission to test.

  • Linux with a C compiler, strace and standard shell tools
  • Python with fusepy for the FUSE example
  • Root or user-namespace privileges for some mount and cgroup techniques
  • A lab or authorised test environment

How to trigger the skill with natural requests

You do not need a special command. Describe the task in plain language and mention race conditions, TOCTOU or the kind of code you are reviewing. The skill's description says it applies when you have found a check-then-act pattern in code, when you are fuzzing for race conditions, or when you are exploiting concurrency bugs in privileged binaries, kernels or orchestrators.

Include the context the agent needs: the language or binary, the privileged action, and the authorisation under which you are working. Vague requests are less useful than specific ones.

  • I have a setuid binary that calls access() and then open() on a user-supplied path. Review it for a TOCTOU race in our authorised lab.
  • Here is a privileged daemon that checks a file's owner before writing. Identify the check and the use, and explain whether they operate on the same kernel object.
  • We are doing an authorised container escape assessment. Walk through the path-resolution races in this runtime's bind-mount setup.
  • Our payment endpoint checks the balance and then debits it. Look for an idempotency or race window and suggest how to test it safely.

Safety notes: scripts and network access

The skill runs scripts, so the agent may execute commands on the machine it is running on. Run it only in a sandboxed or disposable environment that you control. The skill does not use the network, according to its listed requirements.

Because the content is offensive in nature, confirm written permission before testing any system. Keep test binaries, mounts and cgroups isolated, and remove them when you finish.

  • Run in a lab or disposable VM, not on production or shared hosts.
  • Confirm you have written authorisation for every target.
  • Review any script the agent proposes before it runs, especially those that mount filesystems or change cgroups.

Tips for getting useful results

Give the agent a concrete code path or syscall trace rather than a general question. The skill's own workflow starts by identifying the check and the use, then asking whether they touch the same kernel object. Answering that question yourself first narrows the search.

If you are learning, ask the agent to explain the defensive fix alongside the attack, such as operating on a file descriptor instead of a path, or using O_NOFOLLOW. The skill covers both sides.

  • Name the function calls involved, for example access, open or stat.
  • Ask for the defensive fix as well as the exploit path.
  • Keep one hypothesis per request so results are easy to verify.

What people use it for

  • Reviewing a setuid binary for a check-then-open race between access() and open().
  • Assessing a container runtime's bind-mount or path resolution logic in an authorised engagement.
  • Studying how a TOCTOU bug works and how file-descriptor handling fixes it.
  • Reviewing a web or API flow where an authorisation check and the action it protects can be split.

Frequently asked questions

Is the offensive-toctou skill free to use?

The item is listed under the MIT licence, which is a permissive open-source licence. The source does not mention pricing, so check the licence file in the download for the exact terms.

How do I install the offensive-toctou agent skill?

Download the ZIP from this site and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings, then Capabilities, then Skills.

What do I need to run the offensive-toctou skill?

The examples need Linux with a C compiler, strace and standard shell tools. The FUSE example needs Python with fusepy. Some mount and cgroup techniques need root or user-namespace privileges, and a lab or authorised test environment is recommended.

Does the offensive-toctou skill access the internet?

According to its listed requirements, the skill does not use the network. It does run scripts, so review what the agent proposes to execute before allowing it.

Is this skill only for attacking systems?

It is framed as offensive security knowledge, aimed at vulnerability research and exploit development. It also explains defensive fixes such as operating on file descriptors and O_NOFOLLOW, so students and developers can learn from it too.

What should I use instead if I only want to write safe file handling code?

The skill is oriented toward exploitation rather than hardening. For secure-coding guidance focused on writing safe file handling, a dedicated secure-coding guide will serve you better.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits security researchers reviewing privileged binaries, penetration testers working on authorised container or Kubernetes assessments, and students learning how TOCTOU bugs work and get fixed. It is a poor fit for anyone without written permission to test a target, for developers who only want safe file handling advice, or for non-technical users, because it assumes knowledge of syscalls, kernel internals and container runtimes.

Download the skill