Rulecat
A rule mutator for use with hashcat, john the ripper and mdxfind
Install / Use
/learn @Cynosureprime/RulecatREADME
Rulecat - Advanced Rule Generation Tool
A sophisticated password rule generator and mutator for password cracking tools (hashcat, John the Ripper, mdxfind) that uses statistical learning to create high-quality transformation rules.
Overview
Rulecat analyzes existing password transformation rules to learn patterns and generate new rules that mimic real-world password creation behaviors. It uses statistical pattern recognition and parameter distribution learning to produce rules that are more likely to crack passwords than purely random generation.
Rulecat can be used independently on existing rule sets or used on the output produced by rulechef. Since rulechef does not introduce unseen rules, rulecat can be used add novel mutations/transformations.
Visual overview of workflow

Core Features
1. Training Mode (-t)
Analyzes existing rule files to build a statistical model:
- Pattern Extraction: Breaks rules into operation sequences (e.g., lowercase ? append ? capitalize)
- Parameter Learning: Records character/position distributions for each operation
- Frequency Analysis: Tracks which operations and patterns appear most often
- Output: Binary
.modelfile containing learned statistics
Statistics Collected:
- Global operation frequencies across all rules
- Character type distributions (lowercase, uppercase, digits, special chars)
- Most common characters for each operation
- Position parameter distributions with averages
- Pattern-specific operation preferences
2. Model Generation Mode (-g model)
Creates entirely new rules from learned patterns:
- Selects patterns probabilistically based on training data frequency
- Generates parameters using learned character/position distributions
- 70% probability of using top learned characters, 30% type-based generation
- Validates rules to avoid conflicts (e.g.,
sXXwhere both chars are identical)
3. Mutation Mode (-g mutate)
Applies random mutations to existing rules (no training dataset needed):
Mutation Features:
- Respects learned parameter distributions when available
- Validates memory operation constraints (
Mmust precedeX/4/6) - Prevents redundant operations (e.g., double lowercase
ll) - Avoids canceling operations (e.g., append + delete last:
$X]) - Configurable mutation count (1-10 per rule)
4. Guided Mode (-g guided)
Hybrid approach combining mutation with trained input:
- Mutates input rules like mutation mode
- Validates each mutation against learned patterns
- Only outputs rules matching ?70% of known patterns
- Falls back to standard mutation after 30 failed attempts
- Ensures generated rules resemble training data style
Use Case: Generate variations of known-good rules while maintaining structural similarity to proven patterns.
Technical Architecture
Pattern Classification System
Operations grouped by behavior impact:
- Idempotent: Can only apply once meaningfully (
l,u,c,r) - Cumulative: Can stack multiple times (
$,^,d) - Destructive: Remove characters (
],[,@) - Positional: Operate on specific positions (
T,i,o,s,*)
Statistical Learning
Character Parameter Statistics:
- Tracks character type ratios (40% lowercase, 30% uppercase, etc.)
- Maintains top-20 most frequent characters with counts
- Uses weighted random selection for generation
Position Parameter Statistics:
- Records position frequency distribution (0-9, A-Z, a-z)
- Calculates average position with variance
- 80% probability uses learned distribution, 20% samples around average
Conflict Detection
Prevents wasteful rule generation:
- Self-conflicts:
sXX(substitute same char),*NN(swap same position) - Canceling pairs:
$X](append then delete),^X[(prepend then delete) - Redundant operations: Multiple identical idempotent ops (
ll,uu) - Sequential conflicts:
iNX DNat same position
Usage
make
Usage
Train a model from existing rules
./rulecat -t password-rules.txt -m output.model
Generate 1000 new rules from model
./rulecat -g model -n 1000 -m output.model > new-rules.txt
Mutate existing rules (max 3 mutations each), no training needed as mutations are done directly on inputs without reference
./rulecat -g mutate -n 500 -i base-rules.txt -x 3 > mutated-rules.txt
Guided mutation (maintains 70% pattern similarity against model)
./rulecat -g guided -n 750 -m output.model -i base-rules.txt -x 2 > guided-rules.txt
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
