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
.claude/commands/tools_evasion.mdWhat 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
./toolfor an authorized assessment and produce a report of the changes. - Run
/tools_evasion ./scannerto inspect the source and related detection rules for an approved security test. - Create a profile for the tool in
./appand organize the results underrules/.
How to install tools_evasion
Manually: put the files in place
.claude/commands/tools_evasion.mdCall it with /tools_evasion. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/tools_evasion.mdCall it with /prompts:tools_evasion. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/tools_evasion.prompt.mdManually: put the files in place
.gemini/commands/tools_evasion.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
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