GPU-Accelerated Hashcat Rule Ranking with Multi-Armed Bandits
RANKER v4.0 transforms brute-force O(n²) rule ranking into intelligent O(n log n) selection using Thompson Sampling Multi-Armed Bandits. Each rule is treated as an "arm", with the algorithm dynamically balancing exploration of new rules and exploitation of proven performers.
MAB Algorithm Stack
α = cracks_found + 1
β = (words_tested - cracks_found) + 1
P(success) = α / (α + β)
1. FOR each active rule: 2. Sample θ ~ Beta(α × exploration_factor, β) 3. IF exploration_phase: 4. Add UCB bonus: √(2·ln(total_selections)/(trials+ε)) 5. ELSE: 6. Use θ directly 7. ENDIF 8. ENDFOR 9. SELECT top-N rules by sampled score 10. UPDATE trials count for selected rules
| Scenario | Traditional Ops | MAB Ops | Speedup | Memory Saved |
|---|---|---|---|---|
| 10k rules × 100k words | 1B operations | 100M operations | 10× | 90% |
| 100k rules × 1M words | 100B operations | 1-10B operations | 10-100× | 90-99% |
| 1M rules × 10M words | 10T operations | 10-100B operations | 100-1000× | 99-99.9% |
Controls exploration vs exploitation balance in Beta distribution sampling.
0.5: More exploitation, less exploration
1.0: Standard Thompson Sampling (default)
1.5: More exploration, less exploitation
2.0: Maximum exploration for new rule sets
Minimum number of tests before a rule can be considered for pruning.
30: Aggressive pruning, fast but risky
100: Balanced approach (default)
200: Conservative, gives rules more chances
500: Very conservative, minimal pruning
--mab-exploration 1.0 --mab-min-trials 100
--mab-exploration 0.8 --mab-min-trials 50
--mab-exploration 1.5 --mab-min-trials 200
MAB STATS: Active rules: 25,000/100,000 |
Avg trials: 45.2 |
Success rate: 0.125% |
Exploration: 0.285 |
Pruned: 50,000 (50.0%)
Progress: 45% | Speed: 250k words/sec
Unique: 1,250,000 | Cracked: 12,500
Batch: 150/500 | Time remaining: 25m 30s
Rank,Combined_Score,Effectiveness_Score,Uniqueness_Score,MAB_Success_Prob,Rule_Data 1,12542.35,1250,42,0.9542,"s@a" 2,11987.21,1195,37,0.9421,"u" 3,11542.89,1150,42,0.9315,"c" 4,10987.45,1095,37,0.9152,"l" 5,10432.12,1040,32,0.9012,"r" 6,9876.78,985,27,0.8845,"d" 7,9321.44,930,22,0.8678,"f" 8,8766.10,875,17,0.8511,"$1" 9,8210.76,820,12,0.8344,"^!" 10,7655.42,765,7,0.8177,"sa@"
python ranker_mab.py -w wordlist.txt -r rules.txt -c cracked.txt -o results.csv --mab-exploration 1.5 --mab-min-trials 50 --device 0
Required Arguments
-w, --wordlist - Base wordlist file-r, --rules - Hashcat rules to rank-c, --cracked - Cracked passwords for effectiveness-o, --output - Ranking output CSV (default: ranker_output.csv)MAB & Performance
--mab-exploration - MAB exploration factor (default: 1.0)--mab-min-trials - Minimum trials before pruning (default: 100)--batch-size - Words per GPU batch (auto-calculated)--preset - Memory preset: low_memory, medium_memory, high_memory, recommend--device - OpenCL device ID--list-devices - List available OpenCL devicespython ranker_mab.py -w rockyou.txt -r best64.rule -c cracked.txt -o ranked.csv
python ranker_mab.py -w biglist.txt -r all.rule -c cracked.txt -o results.csv --mab-exploration 0.8 --mab-min-trials 30 --preset recommend