Skip to main content
command CX Codex

tools_evasion — Claude Code command: what it does, how to install

The tools_evasion command examines a penetration-testing tool, gathers detection rules, then changes its source code to avoid those rules. It is intended for authorized security work.

MIT ★ 336 updated 2026-04-09

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/tools_evasion.md
Open on GitHub

What tools_evasion does

The command reads a tool’s documentation and source, builds a profile, and collects detection rules such as YARA and Sigma. It matches rule patterns against the code, then stores the inventory and analysis under rules/{tool_name}/.

Source changes start with compiler or build settings before moving to code edits. The command checks whether the modified project compiles, but does not run the tool; its functionality is meant to remain intact. Changes stay within the path supplied by the user, and the final report records edits and remaining detection risks. Use it only for authorized security research.

What it helps with

  • build a profile of a penetration-testing tool
  • find detection rules and map their patterns to source code
  • sort collected rules into type-specific directories
  • modify source code to avoid detection and check compilation
  • record code changes and unresolved detection risks

Example prompts for the agent

  • Analyze the tool at ./tool for an authorized assessment and produce a report of the changes.
  • Run /tools_evasion ./scanner to inspect the source and related detection rules for an approved security test.
  • Create a profile for the tool in ./app and organize the results under rules/.

How to install tools_evasion

Manually: put the files in place

.claude/commands/tools_evasion.md

Call it with /tools_evasion. For all projects use ~/.claude/commands/

Questions about tools_evasion

How do I install tools_evasion in Claude Code?

Save the command file as .claude/commands/tools_evasion.md. Then run /tools_evasion <tool_path>, passing the path to the tool’s file or directory.

What does tools_evasion do?

It examines source code and detection rules, then modifies code to avoid those rules. It checks compilation but does not execute the modified tool.

What path does tools_evasion accept?

Pass the path to a penetration-testing tool’s file or directory. The command confines its edits to that supplied path.

Source text

tools_evasion.md · MIT
---
name: tools_evasion
description: Analyze penetration testing tools and modify source code to evade detection. Usage: /tools_evasion <tool_path>
arguments:
  - name: tool_path
    description: Path to the penetration testing tool directory or file
    required: true
---

You are tasked with analyzing a penetration testing tool and modifying its source code to evade detection.

## Input

Tool Path: {{tool_path}}

## Workflow

Follow these phases in order:

### Phase 1: Tool Understanding

1. Read README and documentation files
2. Analyze source code structure
3. Identify programming language and build system
4. Determine tool purpose and use cases
5. Create tool profile at `rules/{tool_name}/tool_profile.md`

### Phase 2: Open Source Detection (if applicable)

1. Check if the tool is open source
2. Extract keywords (name, author, features)
3. Search GitHub for tool-specific detection rules
4. Save found rules to `rules/{tool_name}/yara/`, `rules/{tool_name}/sigma/`, etc.

### Phase 3: Behavior Analysis

1. Analyze source code for core behavior patterns:
   - Network behavior (HTTP headers, URLs, ports)
   - Process behavior (creation, injection)
   - File behavior (paths, operations)
   - API usage patterns
   - String constants
2. Extract behavioral signatures
3. Search for behavior-based detection rules
4. Save found rules

### Phase 4: Rule Collection

1. Organize all found rules
2. Create rule inventory at `rules/{tool_name}/rule_inventory.md`
3. Categorize by type (YARA, Sigma, Network, etc.)

### Phase 5: Per-Rule Analysis

For EACH detection rule found:
1. Parse all patterns (strings, hex, regex)
2. Identify pattern sources in the tool code
3. Develop evasion strategies (prioritize compiler flags)
4. Create analysis file at `rules/{tool_name}/rule_analysis/{rule_name}.md`

### Phase 6: Source Modification

**CRITICAL: Directly modify source files using Edit tool.**

1. FIRST: Try build configuration changes (compiler flags)
2. SECOND: Apply source code modifications if needed
3. Create tasks for each modification
4. Verify each change

Modification priority:
1. Compiler flags (lowest effort, highest impact)
2. Build configuration
3. String obfuscation
4. API obfuscation
5. Function rename
6. Behavior change (last resort)

### Phase 7: Verification & Summary

1. Verify all patterns are removed from source
2. Test compilation (do NOT run the tool)
3. Create final report at `rules/{tool_name}/modifications_summary.md` including:
   - Tool profile
   - Rules analyzed
   - Modifications applied
   - Unevadable items with reasons
   - Detection risk assessment
   - Recommendations

## Output Directory Structure

```
rules/{tool_name}/
├── yara/
│   └── *.yar
├── sigma/
│   └── *.yml
├── network/
│   └── *.rules
├── other_rules/
├── tool_profile.md
├── behavior_analysis.md
├── rule_inventory.md
├── rule_analysis/
│   └── *.md
└── modifications_summary.md
```

## Important Rules

1. **NEVER skip a rule** - Every detection rule must have an analysis
2. **ALWAYS try compiler flags first** - Lowest effort, highest impact
3. **ONLY modify code in user-provided path** - Never touch other files
4. **PRESERVE functionality** - Tool must work after modification
5. **NEVER run/test modified tools** - Compilation success is sufficient
6. **Document everything** - All changes must be recorded
7. **Report unevadable items** - Explain why evasion is not possible
8. **Direct modification** - Use Edit tool directly, don't just document

## Authorization

This is for authorized security research only:
- Red team assessments with proper authorization
- Security product testing
- Defensive security research

© JDArmy · MIT · JDArmy/Evasion-SubAgents

Similar slash commands

All slash commands for Security →

From the same set22

The whole set →
loader_generate loader_generate spawns an agent to assemble and compile C, C++, or Rust shellcode loaders from a techniques knowledge base. CX Codex +1 ★ 336repo stars rule_inventory The rule_inventory rule catalogues YARA indicators for Stowaway, including binary names, strings, paths, command-line patterns, and hashes. Use it when checking samples for those indicators. CX Codex +1 ★ 336repo stars tool_profile tool_profile — a Claude rule that profiles Stowaway: what the Go multi-hop proxy is built from, how it compiles, and which traces it leaves on a host. CX Codex +1 ★ 336repo stars rule_mapping rule_mapping is a Claude Code rule that analyzes YARA and Sigma signatures for AdaptixC2. It helps assess which signatures are outdated during detection rule reviews. CX Codex +1 ★ 336repo stars rule_inventory A rule file that gives the agent an inventory of SharpHound detections: three YARA rules, one Sigma rule, pattern tables and a difficulty rating for each. CX Codex +1 ★ 336repo stars hex_analysis hex_analysis — a rule file that explains YARA hex signatures for AdaptixC2: which instruction produced each one and which compiler flag moves those bytes. CX Codex +1 ★ 336repo stars lesson_learned The lesson_learned rule explains why string constants must match fixed-width protocol fields. Use it when changing Go code that reads message headers into fixed-size buffers. CX Codex +1 ★ 336repo stars behavior_analysis behavior_analysis — a rule file that tables how SharpHound gives itself away and what the doc suggests changing in the build, the flags and the output files. CX Codex +1 ★ 336repo stars

Project sponsors

Companies that keep this analytics open