Skip to content
Security
Command

/op-wipe

Securely wipe files, directories, or free space using multi-pass overwrite

From plugin
fsociety
2063 skills7 agents63 commands
Install
$ npx -y skills add ogrodev/fsociety --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/op-wipe

Context preview

What this command does when you run it.

Securely wipe files, directories, or free space using multi-pass overwrite

Command definition

op-wipe.md
description: Securely wipe files, directories, or free space using multi-pass overwrite
allowed-tools: Bash, Read, AskUserQuestion
argument-hint: <path> [--passes 3|7|35] [--method shred|srm|dd]

> **Storage Policy**: ALL output files MUST be saved in the project directory. NEVER write to /tmp/ or any system temporary directory.

Secure File Wipe

Target and options: `$ARGUMENTS`

1. Parse `$ARGUMENTS` for target path, `--passes` (default `3`), and `--method` (default `shred`). Validate that the target path exists and is accessible.

2. **ALWAYS** ask the user for explicit confirmation before wiping via `AskUserQuestion`. Display the exact paths that will be destroyed, the number of passes, and the method. Make clear this operation is **irreversible**.

3. **For files**: Execute the secure wipe using the selected method:

  • `shred`: `shred -vfz -n <passes> <file>` — overwrite with random data, then zero-fill final pass
  • `srm`: `srm -z <file>` — secure remove with zero-fill
  • `dd`: `dd if=/dev/urandom of=<file> bs=4096 count=<filesize/4096> conv=notrunc && sync && rm <file>` — overwrite with urandom then delete

4. **For directories**: Recursively wipe all file contents within the directory first (applying the selected method to each file), then remove the empty directory structure with `rm -rf`.

5. **For free space**: Fill remaining free space on the mount point with random data, sync, then remove:

   dd if=/dev/urandom of=<mount>/wipefile bs=1M
   sync
   rm <mount>/wipefile

6. Log the wipe operation to the ops tracker:

   node "${CLAUDE_PLUGIN_ROOT}/scripts/ops-tracker.js" add <target> secure-wipe <method> "<path>" <passes> <result>

7. Verify the file or directory is completely gone. Attempt to read the path and confirm it no longer exists. For free space wipes, confirm the wipefile was removed.

Read more
Ships withfsociety

Multi-plugin marketplace for Claude Code offensive security plugins

Get the whole plugin, auto-invoked
Stats
20
Stars
0
Views
2
Forks
Maintained
Maintenance
JavaScript
Language
MIT
License
4mo ago
Last commit
5mo ago
Created

Repo: ogrodev/fsociety