Skip to content
A113LPublic

About

Local-first tools for building, selecting and refining Hashcat rules - full lifecycle.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

RULEOPS — A GPU-Accelerated Toolchain for Hashcat Rule Generation, Ranking, and Optimization

RULEOPS

RULEOPS is a cybersecurity research workbench for building, benchmarking, scoring, and compressing password-cracking rulesets used with Hashcat. It brings together a set of complementary tools behind one authenticated local web UI (plus standalone CLIs for each), aimed at studying how rule-based password transformations can be generated and selected more efficiently than hand-tuned rule lists.

Cybersecurity research use. This project was built as a cybersecurity research toolchain for studying rule-based password guessing and set-coverage optimization (CELF / greedy max-coverage algorithms applied to rule selection). It is intended for authorized password-security research and password-strength auditing on data you are permitted to test.

Table of contents

Motivation

Hashcat rules transform guessed base words (e.g. password) into likely password variants (e.g. Passw0rd!). Large public rule sets contain tens of thousands of such transformations, many of which are redundant or low-yield for a given target distribution. RULEOPS explores three related questions:

  1. Generation — can plausible rule chains be derived empirically from paired base/target wordlists rather than written by hand? (rulest, rulestripper)
  2. Ranking — given a candidate rule set and a cracked-password sample, which rules contribute the most unique coverage, and can this be scored efficiently on a GPU? (rule_ranker)
  3. Compression — once ranked, how small a rule subset can reproduce (or approximate) the same coverage, using greedy/CELF-style submodular selection, and how many rules are simply behaviorally redundant? (rule_ranker postprocessing, programs/minimizer.py)

Components

Tool Purpose
RULEST Generates candidate rule sets from BASE/TARGET wordlist pairs (optional Stage 0 pass and genetic-algorithm refinement), GPU-accelerated.
Rule Ranker Scores a candidate .rule file against a wordlist + cracked-password list; supports an adaptive multi-armed-bandit (MAB) mode and a legacy exhaustive mode.
Ranker CELF optimizer Runs greedy/CELF max-coverage selection over ranked candidates using GPU recomputation for exact marginal-coverage scoring and host-side candidate coordination.
Concentrator Extracts, generates, and cleans rule collections from existing material.
Aether Benchmarks Hashcat rule throughput on an OpenCL GPU using device-side event profiling, reports separate GPU Kernel Time and host End-to-End Time metrics, produces per-file dashboards, and can build a fastest-first ruleset under a cumulative GPU-kernel-time budget.
Rulestripper Empirically derives rule chains by decomposing TARGET words into BASE-word stems and transformations (14 extraction modes).
PCFG Corpus Profiler Produces aggregate-only length and character-class statistics for password-security auditing; it does not emit candidate values or rules.
Rule Minimizer Removes functionally/behaviorally equivalent rules by comparing their output over a probe word set.
Email Rule Extractor Browser-only utility that derives candidate rules from email-address-style naming patterns.

All server-side tools share one password-protected local web UI (live log, job monitor, run-storage manager, download area); each is also runnable as a standalone CLI.

Hashcat 8.0 byte-oriented rule operators (h, H, S, vNX, BNX) are supported by RULEOPS CPU interpreters and the RULEST, Rule Ranker and Aether OpenCL paths. Aether preflight validation separately identifies malformed, CLI-only, and valid rules that its single-operation benchmark cannot execute.

Architecture overview

  • programs/ — runnable applications and standalone engines: Control Center, Aether, Concentrator and Minimizer.
  • programs/cli/ — command-line entry points for RULEST, Rule Ranker, Rulestripper, Top-N Seed Generator and PCFG Profiler.
  • utilities/ — shared Hashcat parsing, validation, rule operations, GPU diagnostics and Aether validation.
  • rulest/ — RULEST core engine (OpenCL/GPU kernels, CPU fallback, genetic-algorithm stage, token stripping and shared-memory utilities).
  • rule_ranker/ — ranking, CSV post-processing and CELF selection package.
  • scripts/ — Linux/macOS and Windows launchers and GPU diagnostic helpers.
  • deployment/ — systemd service template and deployment-related assets.
  • web/ — front-end assets for the Control Center and browser-only Email Rule Extractor.
  • tests/ — unit and integration tests for engines, GUI control and GPU code paths.

The old root-level command paths have been moved into these folders; use the paths shown in the examples below.

Requirements

  • Python 3.9+
  • numpy, pyopencl, tqdm, msgpack>=1.0 (see requirements.txt)
  • A working OpenCL runtime and compatible GPU driver for GPU-accelerated stages of RULEST, Rule Ranker ranking, and CELF selection (CSV-only analysis is CPU-only)

Installation

git clone https://github.com/A113L/RULEOPS.git
cd RULEOPS
python -m pip install -r requirements.txt

Quick start

Windows

scripts/start_gui.bat

Linux / macOS

chmod +x scripts/start_gui.sh
./scripts/start_gui.sh

The terminal prints a local URL (and any detected LAN URL). On first visit, set an application password (12+ characters) to complete one-time setup; see the security notes in the full install docs for LAN-exposure guidance.

To run on a specific host/port instead of the default launcher:

python programs/app.py --host 127.0.0.1 --port 8765

Resetting the admin password

If you forget the application password, reset it from the command line (run from the project root, with the same Python environment used to run programs/app.py):

python3 -c "import getpass; from programs import app; p=getpass.getpass('New admin password: '); assert len(p)>=12, 'Minimum 12 characters'; app.save_admin_password(p); print('Admin password updated successfully.')"

You'll be prompted to enter a new password (12+ characters, not echoed to the terminal) which replaces the existing one immediately.

Typical pipeline

# 1. Generate candidate rules from a base/target wordlist pair
python programs/cli/run_rulest.py BASE.txt TARGET.txt --output candidates.rule

# 2. Rank candidate rules against a wordlist + cracked-password sample (GPU)
python programs/cli/run_ranker.py rank -w wordlist.txt -r candidates.rule -c cracked.txt -o ranking.csv

# 3. Greedy/CELF max-coverage selection down to a target budget
python programs/cli/run_ranker.py postprocess -r ranking.csv -w wordlist.txt -k cracked.txt \
    -o celf_selected.rule --candidates 20000 --budget 5000

# 4. Remove any remaining behaviorally equivalent rules
python programs/minimizer.py celf_selected.rule --output final.rule --workers 4

Each step is also available from the Control Center UI.

Curated rule-file candidates in RULEST CELF

RULEST can add curated Hashcat rules directly to its CELF candidate pool. The imported rules are checked for GPU compatibility, chain depth and duplicates, then receive the same exact marginal-coverage scoring as generated rules. They are candidates only: CELF does not force them into the output. The input-file order is preserved. The default import cap is 1,000 unique rules; --celf-seed-max-rules accepts any positive integer and has no fixed upper bound. Full CLI/UI instructions and validation details are in the seed-file guide.

python programs/cli/run_rulest.py BASE.txt TARGET.txt --select-mode greedy \
    --select-budget 5000 --celf-seed-rules curated.rule \
    --celf-seed-max-rules 500 --output celf_selected.rule

Repeat --celf-seed-rules PATH to read multiple files; the cap applies across them all. Raise --celf-seed-max-rules above 1,000 when importing larger files. --celf-seed-rules requires --select-mode greedy. The existing --seed-rules option remains unchanged and continues to feed STAGE S. In the web UI, enable Inject custom seed file into CELF in Rule selection to reuse the uploaded Custom seed rules file as CELF candidates; the cap field has no fixed upper bound.

PCFG Corpus Profiling

Create an aggregate-only profile of a target wordlist with weighted and unweighted length and character-class statistics, input acceptance coverage, class-combination diversity, and consistency checks. The profiler does not emit password values, substrings, affixes, candidates, or rule suggestions.

python programs/cli/run_pcfg_profile.py TARGET.txt --output reports/target-profile.json

Compare a new input against a previously generated profile:

python programs/cli/run_pcfg_profile.py MEDIUM.txt --compare reports/small-profile.json \
  --output reports/medium-profile.json

See docs/guides/PCFG_PROFILE.md for the report schema, comparison behavior, and frequency-list handling details.

Repeatable runs (RNG seed)

RULEST accepts an optional --seed value (an unsigned 32-bit integer) to make randomized generation steps repeatable when the inputs, options, software version and execution environment are otherwise identical. The Control Center exposes the same setting as RNG seed; leave it unset to use a fresh random seed. A seed of 0 is valid.

GPU/OpenCL execution can still show rare differences because parallel reduction and scheduling order may vary between devices and driver versions; a matching seed is a reproducibility aid, not a guarantee of byte-identical results across different GPU vendors or software stacks.

Project structure

The repository is organized by responsibility: runnable applications live in programs/, reusable cross-tool code lives in utilities/, and the two main algorithm packages (rulest/ and rule_ranker/) stay separate from the UI and command-line wrappers.

RULEOPS/
├── programs/                         # Runnable applications
│   ├── app.py                        # Authenticated local Control Center
│   ├── aether.py                     # OpenCL benchmarking application
│   ├── concentrator.py               # Rule collection and extraction tool
│   ├── minimizer.py                  # Standalone rule minimizer
│   └── cli/                           # Standalone command-line entry points
│       ├── run_rulest.py
│       ├── run_ranker.py
│       ├── run_rulestripper.py
│       ├── run_topn_seedgen.py
│       └── run_pcfg_profile.py
│
├── utilities/                        # Shared cross-tool helpers
│   ├── hashcat_rule_validation.py    # Shared Hashcat rule parser/validator
│   ├── hashcat_rule_format.py        # Hashcat rule formatting helpers
│   ├── hashcat_rule_ops.py           # Shared rule-operation semantics
│   ├── gpu_diagnostics.py            # OpenCL/PyOpenCL/device diagnostics
│   └── aether_validation.py          # Aether-specific preflight validation
│
├── rulest/                           # RULEST generation and optimization engine
│   ├── cli.py                        # RULEST CLI implementation
│   ├── gpu_engine.py                 # OpenCL execution engine
│   ├── multi_gpu.py                  # Multi-device orchestration
│   ├── genetic.py                    # Genetic-algorithm refinement
│   ├── selection.py                  # Greedy/CELF selection logic
│   ├── rulestripper.py               # Rule-chain decomposition
│   ├── topn_seedgen.py               # Top-N seed generation
│   └── pcfg_profile.py               # PCFG corpus profiling
│
├── rule_ranker/                      # Rule scoring and CELF ranking package
│   ├── ranker.py                     # Ranking implementation
│   ├── ranker_handler.py             # Ranker orchestration and input handling
│   ├── ranker_postprocess.py         # Ranking post-processing/CELF selection
│   └── celf_recompute_gpu.py         # GPU marginal-coverage recomputation
│
├── scripts/                          # OS-specific launchers and diagnostics
│   ├── start_gui.sh
│   ├── start_gui.bat
│   ├── check_gpu.sh
│   └── check_gpu.bat
├── deployment/                       # Deployment templates (including systemd)
│   └── ruleops.service
├── web/                              # Control Center and browser-tool assets
│   ├── index.html                    # Main Control Center page
│   ├── app.js                        # Main frontend behavior
│   └── email-rule-extractor.*        # Browser-only Email Rule Extractor
├── docs/                             # Project documentation
│   ├── guides/                       # User and tool guides
│   ├── engineering/                  # Algorithms, performance and validation
│   ├── operations/                   # Security, deployment and maintenance
│   └── assets/                       # Documentation images and benchmark data
├── reports/                          # Example PCFG profile reports
├── tests/                            # Unit, integration and regression tests
│   └── ranker_suite/                 # Focused Rule Ranker test suite
│
├── README.md                         # Project overview and quick start
├── VERSION                           # Project version
├── requirements.txt                  # Runtime dependencies
├── requirements-dev.txt              # Development/test dependencies
├── pytest.ini                        # Pytest configuration
├── LICENSE
└── .gitignore

Documentation

The documentation has a dedicated index, organized into user guides, engineering references, and operations. The English user guide for all tools (CLI + UI) covers practical workflows, and the CHANGELOG is the chronological record of project changes. The published ruleset quality benchmark compares RULEOPS-attributed outputs (including Concentrator-derived Sapphire rules) with the remaining benchmark entries.

Testing

pytest

The test suite (tests/) covers the core engines, GPU-path parity checks (where an OpenCL device is available), the ranking/CELF pipeline, and the Control Center's web and authentication layers.

License

See LICENSE for full terms.

Support

For help, bug reports and feedback:

  • Email: nullpointer@i2pmail.org
  • Discord: a_1_1_3_1

If RULEOPS is useful to you, voluntary cryptocurrency donations help support maintenance and future development. Donations are entirely optional.

About

Local-first tools for building, selecting and refining Hashcat rules - full lifecycle.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages