rulest - GPU Rules Extractor
-
Fyi. The OpenCl kernel used by the script has been updated with all Hashcat rules visible at https://hashcat.net/wiki/doku.php?id=rule_based_attack. This slightly increases the rule chain extraction time, but it can also lead to complex rules.
-
Updated to version 2.0. The script now extracts more likely working Hashcat rules as opposed to using BFS up to depth 3. It dynamically calculates the number of needed generated rules for depth 2 and 3 to fit in the given script runtime as well as the size of buffers adjusted to the amount of VRAM to avoid OOM errors.
-
Key improvements
- Extended maximum rule chain depth from 3 to 6, allowing exploration of more complex transformations.
- Adaptive batch sizing based on actual GPU VRAM – now dynamically scales word batches, chain batches, and output buffer sizes according to available memory (tested on RTX 3060 Ti and 1050 Ti without errors).
- Dynamic time budgeting – distributes remaining processing time among depths proportionally, adjusting the number of chains generated for each depth based on actual phase‑1 runtime.
- VRAM‑aware bloom filter sizing – reduces bloom filter size on GPUs with less than 4 GB VRAM to prevent out‑of‑memory errors.
- Per‑depth chain limit overrides – new command‑line options (--depth2-chains, …, --depth6-chains) to manually control the number of chains generated for each depth.
Examples of found_chains.txt
-
Test done on 1050Ti with a target depth of 6 and a target runtime of 8 hours (the job was completed in about 2 hours with 1,311,335 generated chains and 724,887 valid unique chains found - you can think of the --target-hours flag as a multiplier of generated rules for the appropriate depths - on different GPUs these values ​​will be different from each other in automatic mode).
Minor improvements:
- The extracted rules are now sorted by frequency (most hits first) for better prioritization, with the empty rule : placed at the top.
- A short header with metadata (total unique rules and total hits) is added to the output file for clarity.
- Removed global cap limit of generated chains (can be limited with flags).
# Generated by rulest_v2.0.py # Total unique rules: 878446 # Total hits (sum of frequencies): 377080316 : z6 x05 z8 '5 x33 z8 x23 y4 '0 y4 z8 x44 Z3 i4% z7 i8E x74 i60 x22 y4 z5 x30 R0 z7 z9 x26 x55 Z9 i0+ x77 Z5 x44 p4 z9 x73 z7 x16 x44 y5 o0[ x55 p9 x23 y6 x66 Z3 D2 i5m o4. i4v z8 x51 ... -
-
Removed hardcoded depth limit;
--max-depthnow accepts any value, kernel constant set dynamically, enabling arbitrary chain depths via recursive rules expansion. -
The new optional
--seed-rulesparameter allows loading a file with previously successful rules. These seeds are grouped by depth and used at every stage of chain generation. For each target depth, the algorithm first adds existing seeds of that depth, then extends seeds from the previous depth by appending a random rule, and finally fills any remaining budget with random (hot‑biased) chains. Newly generated chains become seeds for deeper levels, enabling a recursive expansion that builds upon proven patterns. This focused approach makes it feasible to efficiently generate and test rule chains well beyond depth 6, leveraging prior knowledge to explore the most promising combinations.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register Login