RULEST v1.4

GPU-Accelerated Hashcat Rule Extraction Engine

OpenCL Powered
BFS Rule Chaining

Core Purpose & Architecture

RULEST v1.4 is an advanced GPU-accelerated engine that analyzes relationships between base and target wordlists to automatically extract optimal Hashcat rule chains. Using parallel OpenCL processing, it discovers transformation patterns that convert base words into target passwords with unprecedented efficiency.

  • Primary Objective: Automatically learn transformation rules that reproduce target passwords from base words
  • Intelligent Output: Ranked list of discovered rulechains fully compatible with Hashcat
  • Advanced Methodology: OpenCL parallel processing with optimized BFS rule chaining

Advanced Technical Stack

• PyOpenCL GPU Processing
• NumPy Optimization
• BFS Algorithm
• Latin-1 Encoding
• Dynamic Batch Processing
• Multi-depth Rule Chaining

Advanced Processing Workflow

Phase 1: Intelligent Initialization & Data Preparation

1. Smart Wordlist Loading
• Optimized Latin-1 encoding
• Intelligent comment/empty line filtering
• Hash-based O(1) lookup sets
• Comprehensive file validation
2. Advanced Rule Generation & Mapping
generate_all_rules() creates 1000+ optimized rules with sequential GPU-friendly IDs
Simple Transform Rules
Leetspeak Substitutions
Advanced Group A/B Rules
3. GPU Memory Optimization
• Smart word padding to uniform length
• Sequential rule ID encoding for GPU efficiency
• Optimized OpenCL buffer allocation
• Advanced null terminator handling

Phase 2: BFS Rule Chaining Engine

Depth 1: Parallel Rule Application
For each base_word in optimized_batch:
  For each rule in rule_set:
    GPU Thread: Apply rule → Hash-based target lookup
    If match: Store (rule_chain, hit_count, effectiveness_score)
Multi-Depth Processing (Intelligent Chain Expansion)
• Optimized temporary file persistence
• Smart chain concatenation algorithms
• Hash-based unique word tracking
• Memory-optimized dynamic batching

Phase 3: Intelligent Output & Resource Management

Advanced Result Processing
• Weighted counter for rule chain effectiveness
• Statistical analysis for optimal extraction
• Native Hashcat-compatible format output
• UTF-8 encoded file output with validation
Comprehensive Cleanup Operations
• Automated temporary depth file removal
• Efficient GPU buffer release
• Optimized file handle management
• Memory leak prevention

Comprehensive Rule Categories & Implementation

Core Transformation Rules

l → Lowercase conversion
u → Uppercase conversion
c → Capitalize first letter
r → Reverse string
d → Duplicate entire word
f → Reflect/mirror word

Leetspeak Substitution Rules

sa@ → a → @ substitution
se3 → e → 3 substitution
si1 → i → 1 substitution
so0 → o → 0 substitution
ss5 → s → 5 substitution
st7 → t → 7 substitution

Positional Manipulation Rules

T3 → Toggle case at position 3
D5 → Delete character at position 5
i2x → Insert 'x' at position 2
o3y → Overwrite position 3 with 'y'

Group A: Global Operations

^X → Prepend character globally
$X → Append character globally
@X → Delete all instances of character

Group B: Advanced Operations

{ } → Rotate left/right operations
[ ] → Delete first/last characters
x25 → Extract character range
O34 → Omit character range
p3 → Duplicate word 3 times

Specialized Advanced Rules

z3 → Duplicate first character 3x
Z2 → Duplicate last character 2x
q → Duplicate all characters
'5 → Truncate at position 5

Advanced OpenCL Kernel Architecture

bfs_kernel - Core Processing Kernel

Optimized Input: Base words + Rules buffers with padding
Efficient Output: Transformed words buffer with validation
Advanced Threading: word_idx × rule_idx grid optimization
Smart Logic: Rule ID-based switching with branch prediction
Enhanced Features: Null termination, bounds checking, error handling

Intelligent Memory Management

Dynamic Batch Processing: Automatic size adjustment based on GPU load
Optimized Padded Buffers: Uniform memory layout for coalesced access
Sequential Rule IDs: Efficient mapping to kernel execution blocks
Robust Error Handling: Comprehensive memory fallback strategies
Encoding Optimization: Latin-1 for consistent byte-level operations

Advanced Kernel Implementation Structure

// Optimized Rule ID blocks for efficient kernel switching
unsigned int start_id_simple = 0;
unsigned int end_id_simple = start_id_simple + 10;
unsigned int start_id_TD = 10;
unsigned int end_id_TD = start_id_TD + 20;
// ... additional optimized rule blocks

// Advanced kernel logic with branch optimization
if (rule_id >= start_id_simple && rule_id < end_id_simple) {
    // Optimized simple rules processing
    switch(rule_id - start_id_simple) {
        case 0: // 'l' (lowercase) - optimized path
            // Enhanced implementation with bounds checking
            break;
        // ... other optimized cases
    }
} else if (rule_id >= start_id_TD && rule_id < end_id_TD) {
    // Advanced T/D rules processing
} // ... continues for all rule categories with optimization

Intelligent Output & Rule Chain Synthesis

Successful transformations are intelligently chained using optimized BFS expansion algorithms. The discovered rulechains undergo statistical analysis and are exported in Hashcat's native .rule format, ready for immediate deployment in password cracking sessions.

Optimized Chain Storage Format

transformed_word<TAB>rule1 rule2 rule3<TAB>effectiveness_score
Memory-efficient temporary files with scoring metadata

Production-Ready Output

optimized_rule_chain<NEWLINE>
Statistically ranked by effectiveness, fully Hashcat compatible

Basic Transformation Chain:

"u r $1 s3e"

Uppercase → Reverse → Append "1" → Replace 3→e

Advanced Multi-step Chain:

"l ^@ $9 so0 sa@ T3"

Lowercase → Prepend @ → Append 9 → o→0 → a→@ → Toggle position 3

Advanced Performance Optimizations

Massive GPU Parallelism
Thousands of concurrent threads applying rules across optimized word batches
Intelligent BFS Memory Management
Depth-wise processing with hash-based duplicate prevention and file persistence
Adaptive Dynamic Batching
Real-time batch size optimization based on GPU memory and performance metrics

Advanced Command Line Interface

python rulest.py -w target_wordlist.txt -b base_words.txt -d 3 -o extracted_rules.rule --batch-size 10000

Core Arguments

  • -w, --wordlist - Target dictionary file path
  • -b, --base-wordlist - Base wordlist (optional: auto-generates)

Advanced Options

  • -d, --chain-depth - Rule chain depth (default: 1, max: 5)
  • -o, --output - Output file for discovered rules
  • --batch-size - GPU batch size optimization (default: 5000)
  • -r, --rules_file - External custom rules file