アップデート一覧に戻る
New releaseJul 31, 2026

hate_crack v2.19.0

TrustedSecチームによる、Hashcatを通じてクラッキング手法を自動化するツール。

共有
  ___ ___         __             _________                       __
 /   |   \_____ _/  |_  ____     \_   ___ \____________    ____ |  | __
/    ~    \__  \\   __\/ __ \    /    \  \/\_  __ \__  \ _/ ___\|  |/ /
\    Y    // __ \|  | \  ___/    \     \____|  | \// __ \\  \___|    <
 \___|_  /(____  /__|  \___  >____\______  /|__|  (____  /\___  >__|_ \
       \/      \/          \/_____/      \/            \/     \/     \/

インストール

ソースからのインストールが唯一のサポート対象パスです。hate_crack は PyPI では配布されていません: pip install hate-crack は意図的に失敗する 0.0.0 プレースホルダーに解決され、ここに戻ってくるようになっています。この名前は、他の誰かがその名前で類似品を公開できないようにするためだけに保持されています — 詳細は packaging/pypi-placeholder/ を参照してください。

1. hashcat をインストールする

Hashcat がインストールされ、PATH で利用可能である必要があります:

Ubuntu/Kali:```bash sudo apt-get install -y hashcat

macOS(Homebrew):```bash
brew install hashcat

Or download a pre-built binary from https://hashcat.net/hashcat/ をダウンロードし、config.jsonhcatPath にその場所を設定します。

2. hate_crack をダウンロード

サブモジュール付きでクローンします(hashcat-utils、princeprocessor、pcfg_cracker、Corporate_Masks、およびオプションで omen に必要です)。```bash git clone --recurse-submodules https://github.com/trustedsec/hate_crack.git cd hate_crack

サブモジュールなしでクローンした場合は、次のコマンドで初期化してください:```bash
git submodule update --init --recursive

必要に応じて設定をカスタマイズします。hate_crackは2つの設定ファイルを使用し、それぞれが異なる設定群を管理します:

  • config.json — ワードリストのパス、マスク、ルール、チューニング、potfile、hashcatのパス、候補数の上限、通知のトグル、CLIのデフォルト設定(35項目)。
  • .env — サードパーティ統合設定のみ: HashviewとHashmobの認証情報、Pushoverの認証情報、Ollama、pipal(14項目)。gitで追跡されず、モード0600で作成されます。

この行がそこにある理由は1つ: .envはシークレットを保持できるファイルだからです。サードパーティサービスの認証情報と設定は、追跡されない0600ファイルに入ります。hate_crackがローカルで行うすべての処理はconfig.jsonに残り、共有、差分比較、自分のメモへのチェックインが安全です。また、Pushoverの認証情報.envにあり、Pushoverのオン/オフトグルconfig.jsonにあるのもそのためです — トグルはローカルの設定であり、シークレットではありません。

各キーには正確に1つの置き場所があります。別のファイルに置かれたキーは無視され、hate_crackはそのキーが属するファイル名を示す警告を出力します。どのキーも、環境変数をエクスポートすることで単一の実行に対して上書きできます。ほとんどのユーザーは、デフォルトのパスがそのまま動作するため、この手順をスキップできます。

config.jsonは恒久的で第一級のファイルです — 非推奨ではなく、削除の予定もありません。移動されたのは統合設定のみです。

単一のconfig.jsonからアップグレードしますか? hate_crackは初回実行時に自動的に移行します: 統合設定が新しい0600.envにコピーされ、その後config.jsonから削除されるため、両方のファイルが同じ設定を主張することはありません。どのキーが移動されたかを出力します(値は決して出力しません)。また、元のファイルを触る前にconfig.json.pre-split.bakとして保存します。config.jsonの他のすべては、キーの順序を含め、そのまま残されます。

初回実行: hate_crackが両方のファイルを作成するため、何もする必要はありません。代わりに.envを手動で設定するには、追跡されているテンプレートをコピーします:```bash cp .env.example .env chmod 600 .env

`.env.example` はコミットされ、すべての認証情報キーが空の状態で同梱されます。`.env` 自体は**決して**コミットしてはなりません — これは通常のバックアップ用の綴りとともに gitignore されており、hate_crack は常にモード `0600`(所有者のみ読み書き可能)で作成します。`.env.example` はスキーマから生成されます。`hate_crack/config_schema.py` を変更した後は、`uv run python -m hate_crack.config_writer` で再生成してください。

### 3. 依存関係と hate_crack のインストール

最も簡単な方法は `make`(または `make install`)を実行することです。これにより OS が自動検出され、以下がインストールされます:
- 外部依存関係(p7zip、transmission-daemon / transmission-remote)
- サブモジュールのビルド(hashcat-utils、princeprocessor、pcfg_cracker、および任意で omen)と、データのみの Corporate_Masks マスクセットのチェックアウト
- uv による Python 依存関係と、`~/.local/bin/hate_crack` への CLI シム```bash
make

これは冪等(idempotent)です。既にインストールされているツールはスキップされます。クリーンな再インストールを強制するには:```bash make reinstall

**または依存関係を手動でインストール:**

### 外部依存関係
これらは特定のダウンロード/抽出フローに必要です:

- `7z`/`7za` (p7zip) — `.7z` アーカイブの抽出に使用。
- `transmission-daemon` / `transmission-remote` — Weakpass トレントのダウンロードに使用。

手動インストールコマンド:

Ubuntu/Kali:```bash
sudo apt-get update
sudo apt-get install -y p7zip-full transmission-daemon

macOS(Homebrew):```bash brew install p7zip transmission-cli # provides transmission-daemon and transmission-remote

次に、Pythonの依存関係とCLIシムをインストールします。```bash
uv sync
mkdir -p ~/.local/bin
printf '#!/usr/bin/env bash\nset -euo pipefail\nexec uv run --directory %s python -m hate_crack "$@"\n' "$(pwd)" > ~/.local/bin/hate_crack
chmod +x ~/.local/bin/hate_crack

プロジェクト構造

コアロジックは現在、hate_crack/ 配下のモジュールに分割されています:

  • hate_crack/cli.py: argparse ヘルパーと設定の上書き。
  • hate_crack/api.py: Hashview、Weakpass、Hashmob の統合(ダウンロード/メニュー/ヘルパー)。
  • hate_crack/attacks.py: メニューの攻撃ハンドラー。
  • hate_crack/corpus_stats.py: コーパス全体のパスワード統計。LLM にコーパスを説明するために使用。
  • hate_crack/plaintext.py: コーパス行からパスワードを復元(ハッシュプレフィックスの除去、$HEX[...] のデコード)。LLM モード、corpus_stats、rulegen で共有。
  • hate_crack/llm.py: Atomic Agents による構造化(JSON)LLM 候補生成。
  • hate_crack/menu.py: 共有メニューレンダラー。オプションの矢印キーナビゲーションを含む。
  • hate_crack/noninteractive.py: スクリプト化された攻撃サブコマンドのディスパッチャー。
  • hate_crack/notify/: 通知パッケージ(Pushover バックエンド、クラックごとのテイラー)。
  • hate_crack/username_detect.py: username:hash 入力ファイルを検出し、hashcat の --username を決定。
  • hate_crack/formatting.pyhate_crack/progress.py: 出力フォーマットと進捗表示のヘルパー。
  • hate_crack/main.py: メイン CLI 実装。

トップレベルの hate_crack.py は引き続きメインのエントリポイントであり、これらのモジュールを統括します。


参照と謝辞

このプロジェクトは、多数の外部プロジェクトおよびサービスに依存し、それらから着想を得ています。謝辞:


使用方法

make でインストールした後、任意の場所から hate_crack を実行します:```bash hate_crack

or with arguments:

hate_crack <hash_file> <hash_type> [options]

または、`uv` 経由で実行します:```bash
uv run hate_crack.py <hash_file> <hash_type>

ツールとして実行(推奨)

リポジトリのルートから make を使用してインストールします。これによりサブモジュールがビルドされ、アセットがバンドルされます:```bash cd /path/to/hate_crack make hate_crack

`make install` コマンドは、リポジトリディレクトリから実行される bash シムを `~/.local/bin/hate_crack` に作成します。これにより、現在の作業ディレクトリに関係なく、設定ファイルとアセットが常に見つかります。

設定ファイルは以下の場所でも検索されます:
- リポジトリのルートとパッケージディレクトリ
- `~/.hate_crack`

**注:** `config.json` の `hcatPath` は hashcat バイナリの場所のみを指定します(hashcat が PATH にある場合は省略可能)。Hate_crack のアセット(hashcat-utils、princeprocessor、pcfg_cracker、Corporate_Masks、omen)はリポジトリディレクトリから読み込まれ、`make install` によって自動的にバンドルされます。

### スクリプトとして実行
このスクリプトは `uv` シェバングを使用しています。実行可能にしてから実行してください:```bash
chmod +x hate_crack.py
./hate_crack.py

Pythonを直接使用することもできます:```bash python hate_crack.py

### 非対話型 / スクリプトでの使用

自動化のために、メニューを介さずに単一の攻撃を直接起動できます。攻撃名が最初の引数で、その後にハッシュファイルとhashcatのハッシュタイプが続きます。前処理のプロンプト(コンピュータアカウントのフィルタリング、LM優先のブルートフォース、重複アカウントの重複排除)は、このモードではデフォルト値を自動的に受け入れます。プロセスは成功時に`0`で終了し、エラー時(ハッシュファイルの欠落、非数値のハッシュタイプ、ワードリストの欠落、または不明なルールファイル名)には非ゼロで終了します。```bash
# Quick crack: one wordlist + optional rule(s) from the rules directory
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule

# Chain two rules in a single run
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule+d3ad0ne.rule

# Run two rules as two separate passes
hate_crack quick hashes.txt 1000 --wordlist rockyou.txt --rules best64.rule d3ad0ne.rule

# Canned dictionary methodology (uses your configured wordlists)
hate_crack dict hashes.txt 1000

# Brute force lengths 1-8
hate_crack brute hashes.txt 1000 --min 1 --max 8

# Top-mask attack targeting ~4 hours
hate_crack topmask hashes.txt 1000 --target-time 4

トラブルシューティング

更新時に「would clobber existing tag」というエラーが発生する

古いクローンは更新を拒否し、次のような行の長いリストを出力することがあります:``` ! [rejected] v2.5.0 -> v2.5.0 (would clobber existing tag)

これは2026年7月より前に作成されたクローンに影響します。公開履歴はその後書き換えられ、コミットされるべきではなかった一部のファイルが削除されたため、すべてのコミットに新しいIDが付けられました。そのため、古いクローンのタグは、このリポジトリがもう含まないオブジェクトを指しており、gitは既に持っているタグを移動することを拒否します。チェックアウトに問題はなく、クラッキングデータが危険にさらされることもありません。

一度だけのリセットで回復できます。これにより、チェックアウト内のローカルコミットと編集が破棄されるため、gitで追跡されているもの(追跡されていない`config.json`とは異なります)をカスタマイズしている場合は、まずブランチにコミットしてください。```bash
cd /path/to/hate_crack
git fetch --tags --force origin
git checkout -B main origin/main
make install

--force はここではタグの更新のみを行い、コミットには一切触れません。その後、組み込みのアップデータは正常に動作します。2.18 より前のバージョンでは、このリカバリを自分で実行できなかったため、一度だけ手動で行う必要があります。

エラー: ビルドディレクトリが存在しません

次のようなエラーが表示される場合:``` Error: Build directory /opt/hashcat/hashcat-utils does not exist. Expected to find expander at /opt/hashcat/hashcat-utils/bin/expander.

これは、hate_crackのアセットがインストールされたパッケージにバンドルされていないことを意味します。

**パスの理解:**
- config.json内の`hcatPath` → **hashcatバイナリの場所**を指します(任意、PATH内でも可)
- `hashcat-utils/`と`princeprocessor/` → `make install`によってパッケージにバンドルされます

**解決策:**
サブモジュールをビルドしてツールをインストールするMakefileを使用して、再インストールしてください。```bash
cd /path/to/hate_crack  # the repository checkout
make install

デフォルト設定(config.json.example):

ほとんどのユーザーはカスタマイズなしでデフォルトを使用できます:

  • hcatWordlists./wordlists(リポジトリルートまたはHOME/.hate_crackからの相対パス)
  • hcatOptimizedWordlists./optimized_wordlists(Quick Crackで使用されるディレクトリ。見つからない場合はhcatWordlistsにフォールバック)
  • rules_directory./hashcat/rules(サブモジュールのルールを含む)
  • hcatTuning:``(空文字列 - デフォルトのチューニングフラグなし)

config.jsonのカスタマイズ例:```json { "hcatPath": "/usr/local/bin", # Location of hashcat binary (optional, auto-detected from PATH) "hcatBin": "hashcat", # Hashcat binary name "hcatWordlists": "./wordlists", # Dictionary wordlist directory (relative or absolute) "rules_directory": "./hashcat/rules", # Rules directory (relative or absolute) "hcatTuning": "", # Additional hashcat flags (empty by default) ... }

**設定の読み込み:**
- 各キーの優先順位: `os.environ` > そのキー専用のホームファイル (`.env` または `config.json`) > 組み込みのデフォルト値
- 欠落したキーは組み込みのデフォルト値にフォールバックします。`config.json.example` はすべての `config.json` キーを文書化しています
- 両方のファイルは、互いに独立して、この順序で検索されます: **リポジトリルート**、次に**インストール済みパッケージディレクトリ**、次に**`~/.hate_crack`**。最初に一致したものが優先されます。2つのファイルが異なるディレクトリから取得されるのは正常です。
- 初回実行時には、両方が作成されます — `config.json` は `config.json.example` から、`.env` は組み込みのデフォルト値から作成されます。古い `config.json` に統合キーがまだ含まれている場合、それらは新しい `.env` にコピーされ、hate_crack は `config.json` から削除すべきキーを通知します。このファイル自体を編集することはありません。
- 実行のたびに、hate_crack は実際に読み込んだ2つのファイルを出力します:  ```
  [*] config.json: /home/you/.hate_crack/config.json
  [*] .env:        /home/you/.hate_crack/.env

以下の2行を読んでから、「効かない」設定をデバッグしてください。これらは検索順序にまつわる2つの落とし穴があるためです。

  • チェックアウトはホームディレクトリより優先される。 リポジトリのルートが最初に検索されるため、ツールを実行する任意のチェックアウト内にある.envconfig.jsonは、~/.hate_crack内のものより優先されます。そして、ツールをチェックアウトから実行することこそが、そもそもそこにそれらのファイルを作成する原因です。これが実際の~/.hate_crack設定を覆い隠す場合、hate_crackは両方のパスを指定する3つ目の[!]行でそれを通知するようになりました。その行は「以下のファイルは無視されています」という意味であり、同等に有効な2つ目の設定ではないと解釈してください。
  • 現在の作業ディレクトリは検索されない。 現在いるディレクトリ内の.envは意図的に無視されます。エンゲージメントディレクトリには、設定として意図されていないファイルが多数あるためです。リポジトリのルートか~/.hate_crackに置いてください。

エラー: ref 'refs/heads/master' とのマージで、そのようなrefはフェッチされていません

次のような表示が出た場合:``` Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched.

デフォルトブランチは `master` から `main` に変更されました。修正方法:```bash
git remote set-head origin -a
git branch -m master main
git branch --set-upstream-to=origin/main main
git pull

Makefile ターゲット

デフォルト(フルインストール) - サブモジュールをビルドし、依存関係をインストールして、ツールをインストールします:```bash make

or explicitly:

make install

これは冪等です。既にインストールされているツールはスキップされます。

**強制クリーン再インストール:**```bash
make reinstall

クイックアップデート - サブモジュールを再ビルドし、ツールを再インストールします(変更をプルした後):```bash make update

**アンインストール** - OS依存関係とツールを削除します:```bash
make uninstall

hashcat-utilsのみをビルドする:```bash make hashcat-utils

**テストを実行** - 必要に応じてHATE_CRACK_SKIP_INITを自動的に処理します:```bash
make test

カバレッジレポート:```bash make coverage

**クリーンビルド/テスト成果物:**```bash
make clean

開発

開発環境のセットアップ

任意の開発用依存関係(リンターやテストツールを含む)を指定してプロジェクトをインストールします:```bash make dev-install

### リンターと型チェックの実行

変更をプッシュする前に、これらのチェックをローカルで実行してください。すべてをまとめて実行するには `make lint` を使用し、個別のチェックを実行する場合は以下のコマンドを使用します:

**Ruff(リンターとフォーマット):**```bash
make ruff
# or manually:
uv run ruff check hate_crack tests tools packaging hate_crack.py

自動修正の問題:```bash uv run ruff format hate_crack tests tools packaging hate_crack.py uv run ruff check --fix hate_crack tests tools packaging hate_crack.py

**ty(型チェック):**```bash
make ty
# or manually:
uv run ty check hate_crack

すべてのチェックをまとめて実行:```bash make lint

### テストの実行

テストは、サブモジュールがビルドされていない場合に自動的に検出し、`HATE_CRACK_SKIP_INIT=1` を自動的に設定します。```bash
make test

またはpytestを直接実行します:```bash uv run pytest -v

カバレッジ付き:```bash
make coverage

Or with pytest:```bash uv run pytest --cov=hate_crack

### Git Hooks (prek)

Gitフックは [prek](https://github.com/j178/prek) (v0.3.3+) によって管理されています。フックをインストールするには:```bash
prek install --hook-type pre-push --hook-type pre-commit

このインストールは、prek.toml で定義されたフックを、pre-commit の local-repo TOML スキーマを使用してインストールします:

  • pre-push (ローカルフック): ruff、ruff-format、ty、pytest、pytest-lima、bandit
  • pre-commit (pre-commit/pre-commit-hooks から): trailing-whitespace、 end-of-file-fixer、check-yaml、check-merge-conflict、check-added-large-files、 detect-private-key

pre-commit の自動修正ツールはファイルをその場で書き換えるため、実行後に再度ステージングしてコミットし直してください。

注: prek 0.3.3 はトップレベルで repos = [...] を想定しています。古い [hooks.<stage>] commands = [...] 形式はサポートされていません。

矢印キーによるメニュー操作

メニューはデフォルトで従来の番号付き print() + input() による選択を使用しており、複数桁のキーを完全に入力できます。

simple-term-menu を介した矢印キー操作を有効にするには、HATE_CRACK_ARROW_MENU=1 を設定します。このモードでは1桁のショートカットキーのみが機能します。10以上のオプションは矢印キーで到達する必要があります。矢印キーモードはTTYも必要とするため、出力がパイプ処理される場合はオフのままになります。

開発用依存関係

オプションの [dev] グループには以下が含まれます:

  • ty - 静的型チェッカー
  • ruff - 高速なPythonリンターおよびフォーマッター
  • pytest - テストフレームワーク
  • pytest-cov - カバレッジレポート

共通オプション:

  • --download-hashview: クラッキング前にHashviewからハッシュをダウンロードします。
  • --hashview: ハッシュ、ワードリスト、ジョブを管理するための対話型Hashviewメニュー。
  • --hashview --help: Hashviewのコマンドラインオプションを表示します。
  • --weakpass: Weakpassからワードリストをダウンロードします。
  • --hashmob: Hashmob.netからワードリストをダウンロードします。
  • --hashmob-masks: Hashmob.netからマスクをダウンロードします。
  • --download-torrent <FILENAME>: 特定のWeakpassトレントファイルをダウンロードします。
  • --download-all-torrents: キャッシュから利用可能なすべてのWeakpassトレントをダウンロードします。
  • --wordlists-dir <PATH> / --optimized-wordlists-dir <PATH>: ワードリストディレクトリを上書きします。
  • --pipal-path <PATH>: pipalのパスを上書きします。
  • --restore-potfile: 起動時にhashcatのPOTファイルから <hashfile>.out を再構築し、既存の内容を置き換えてから通常のメニューに進みます。このフラグがない場合、POTルックアップは .out がまだ存在しない場合にのみ実行されます。メニューオプション93は確認プロンプト付きで同じことをオンデマンドで実行します。
  • --maxruntime <SECONDS>: 最大実行時間を上書きします。
  • --bandrel-basewords <PATH>: bandrelのベースワードファイルを上書きします。
  • --update: 最新リリースに更新して再インストールします。リリースタグがそこにあるため、チェックアウトが別のブランチにある場合は main に切り替えます。
  • --nightly: 代わりに nightly-dev ブランチから最新のナイトリービルドに更新します。ナイトリーはCIを通過していますが、カットリリースの一部ではありません。--update --nightly と書くこともできます。
  • --no-optimized-kernel (または --no-optimize): 実行全体でhashcatに -O を渡しません。config.jsonoptimizedKernelAttacks を上書きし、hcatTuning に指定した -O も削除します。設定には何も書き戻されないため、この実行のみに適用されます。サブコマンドを使用する場合は、サブコマンドの前に置きます: ./hate_crack.py --no-optimize quick hashes.txt 1000 --wordlist words.txt
  • --debug: デバッグログを有効にします (stderrに書き込みます)。

Hashview統合

hate_crackは、集中管理されたハッシュ管理と分散クラッキングのためにHashviewと統合します。

対話型メニュー

対話型Hashviewメニューにアクセスします:```bash hate_crack.py --hashview

メニューオプション:
- **(1) クラック済みハッシュのアップロード** - 現在のセッションのクラック結果をHashviewにアップロード
- **(2) ワードリストのアップロード** - ワードリストファイルをHashviewにアップロード
- **(3) ワードリストのダウンロード** - Hashviewからワードリストをダウンロード
- **ルールのダウンロード** - Hashviewからルールファイルをダウンロード(平文に展開され、`hashcat -r`で使用可能な状態)
- **全ルールのダウンロード** - Hashviewにリストされているすべてのルールファイルを一度にダウンロード。ルールごとの失敗は残りの処理を中断せずに報告される
- **(4) 未クラックハッシュのダウンロード** - 残りの未クラックハッシュをダウンロード(クラック用に切り替えるかプロンプト表示)
- **(5) クラック済みハッシュのダウンロード** - 平文パスワード付きのクラック済みハッシュをダウンロード(参照・分析用)
- **(6) ハッシュファイルのアップロードとジョブ作成** - 新しいハッシュファイルをアップロードしてクラックジョブを作成
- **(99) メインメニューに戻る** - メインメニューに戻る

**重要: クラック済みのダウンロードと未クラックのダウンロードの違い**
- **未クラックハッシュのダウンロード (4)**: クラックが必要な未クラックハッシュをダウンロード。利用可能な場合はクラック済みハッシュと自動的にマージされ、このハッシュファイルに切り替えてクラックするかプロンプトが表示される。
- **クラック済みハッシュのダウンロード (5)**: `ハッシュ:平文`形式のクラック済みハッシュをダウンロード。これらは参照用であり、これ以上クラックすることはできない。切り替えプロンプトは表示されない。

#### コマンドラインインターフェース

Hashview操作はコマンドラインでも実行できます:

クラック済みハッシュのアップロード:```bash
hate_crack.py --hashview upload-cracked --file <output_file>.out --hash-type 1000

アップロードするワードリスト:```bash hate_crack.py --hashview upload-wordlist --file .txt --name "My Wordlist"

ダウンロードルールファイル(解凍済みで保存され、`hashcat -r` で使用可能な状態):```bash
hate_crack.py --hashview download-rules --rules-id 4 --output best64.rule

ダウンロード左側のハッシュ(クラックされていないハッシュ、クラック用):```bash hate_crack.py --hashview download-left --customer-id 1 --hashfile-id 123

ダウンロードされたハッシュ(すでに解読済みのハッシュと平文):```bash
hate_crack.py --hashview download-found --customer-id 1 --hashfile-id 123

ハッシュファイルをアップロードしてジョブを作成:```bash hate_crack.py --hashview upload-hashfile-job --file hashes.txt --customer-id 1
--hash-type 1000 --job-name "NTLM Crack Job" --hashfile-name "Domain Hashes"

#### 設定

`.env` に Hashview の認証情報を設定します(これらは統合設定のため、`config.json` には含まれません):```
HASHVIEW_URL=https://hashview.example.com
HASHVIEW_API_KEY=your-api-key-here

LLM 設定

LLM 攻撃(オプション 12)と Rosetta Mask 攻撃(オプション 23)は、ローカルモデルを使用して候補を生成します。モデル、コンテキストウィンドウ、リクエストタイムアウトは .env で設定します:``` LLM_BACKEND=ollama OLLAMA_MODEL=qwen3:4b-instruct OLLAMA_NUM_CTX=8192 OLLAMA_TIMEOUT=300

**`OLLAMA_*` キーは、Ollama だけでなくすべてのバックエンドに適用されます。`OLLAMA_HOST` は Ollama 自身の CLI が読み取る変数と同じであるため、このプレフィックスが維持されています。名前を変更すると、機能上の利点がなく既存のすべての `.env` が壊れてしまうからです。vLLM や OpenAI 互換サーバーも、同じホスト、モデル、タイムアウト、コンテキスト、サンプリング設定を同じ名前で必要とします。`LLM_BACKEND` は、リクエストの整形方法のみを選択します。

- **`OLLAMA_MODEL`** — 候補生成に使用する Ollama モデル(デフォルト: `qwen3:4b-instruct`)。LLM 攻撃は構造化(JSON)出力を使用するため、ツール/JSON サポートが優れたモデルを選択してください。
- **`OLLAMA_NUM_CTX`** — モデルのコンテキストウィンドウサイズ(デフォルト: `8192`)。コーパス統計が導入される前は `2048` でしたが、これは与えられるプロンプトを保持するには小さすぎました。サンプリングされた 500 件の平文は、システムプロンプトと応答の前に約 2,000〜3,500 トークンに達するため、Ollama はサンプラーがファイル全体に慎重に分散させたサンプルの一部を黙って切り捨てていました。
- **`OLLAMA_TIMEOUT`** — 生成応答を待ってから諦めるまでの秒数(デフォルト: `300`)。最初のリクエストで大きなモデルがまだ VRAM に読み込まれている場合、タイムアウトを超える可能性があるため、この値を上げてください。hate_crack は、タイムアウトが発生したときに経過したタイムアウト時間とこの設定名を出力します。
- **`OLLAMA_MAX_SAMPLE_LINES`** — LLM モードがリテラルな平文もプロンプトに貼り付けるしきい値(デフォルト: `500`)。`0` 以下の値は `500` として扱われます。

  コーパス由来のモード(**Wordlist**、**Cracked passwords**、**Pattern rules**)は、その一部を貼り付けるのではなく、コーパス全体を統計的に記述します(基本語の割合、マスク、大文字小文字、長さ、末尾の数字と記号、年)。集約は制限されているため、120,000 パスワードのダンプでも、500 行のものとほぼ同じプロンプト領域しか消費しません。コーパス全体がこのしきい値に収まる場合、小さなコーパスをモデルから隠しても何も得られないため、生の平文も含まれます。

  これは、最大 `ollamaMaxSampleLines` 個のパスワードを均等に間隔を空けてサンプリングして貼り付ける以前の動作を置き換えます。大きなダンプのサンプルは頻度情報をまったく伝えませんでした。モデルは、組織の 8% が使用する基本語と、1 人だけが使用する基本語を区別できませんでした。これはまさに、推測を実行する価値があるものにするシグナルです。
- **`OLLAMA_NO_CLOUD`** — `true` の場合、3 つの LLM バックエンド(Ollama、vLLM、または汎用の OpenAI 互換サーバー)のいずれについても、このホストから何も送信しません。この 1 つの設定で 2 つのチェックが制御されます。Ollama は `-cloud` タグ付きモデル(`gpt-oss:120b-cloud`、`deepseek-v3.1:671b-cloud`)を、ローカルモデルが使用するのと同じローカルエンドポイント経由で ollama.com にプロキシするため、リクエストの外観は何も変わりません。これはモデル名によって拒否されます。設定されたバックエンド URL もチェックされます。ループバック、プライベート、またはリンクローカルではない宛先(および `localhost` や `.local`/`.internal`/`.lan`/`.localdomain` 名ではない宛先)は、宛先によって拒否されます。また、このチェックで解決できないホスト名も、検証できない宛先を通すのではなく、フェイルクローズで拒否されます。hate_crack のプロンプトには、回復された平文、コーパス統計、クライアントの名前、業界、所在地が含まれるため、どちらかのチェックが発動すると、リクエストは構築される前に拒否されます。デフォルトは `false` で、意図的に設定されたクラウドモデルやリモートサーバーは引き続き動作します。クライアントデータをホスト外に出してはならないエンゲージメントでは、これをオンにしてください。
- **`OLLAMA_AUTO_RESEARCH`** — `true`(デフォルト)の場合、**Target info** モードは、会社名を入力するとすぐにローカルモデルに業界、所在地、親会社/買収履歴を提案させ、編集可能なプロンプトのデフォルトとして提供します。`false` に設定すると、常に空白のプロンプトが表示されます(調査には攻撃開始前に追加のラウンドトリップが 1 回必要になるため、遅いモデルで役立ちます)。
- **`OLLAMA_HOST`** — 設定されたバックエンドが待ち受けている場所。ベアの `host:port`(`theplague.lan:11434`)またはスキーム付きの完全な URL(`https://ollama.example.com`)を受け入れます。どちらの場合も、ベース URL は使用前に正規化されます。デフォルトは `localhost:11434` で、これは Ollama のポートです。vLLM または OpenAI 互換サーバーは、これを自身のポートに設定する必要があります(vLLM は通常 `:8000` で待ち受けます)。`.env` に設定するか、実際の環境変数としてエクスポートして、単一の実行でそれを上書きします。これは Ollama 自身の CLI が読み取る変数名と同じです。
- **`LLM_BACKEND`** — 通信する OpenAI 互換サーバー: `ollama`(デフォルト)、`vllm`、または汎用の `openai`。すべてのバックエンドが同じ `/v1` チャット完了 API を話すため、これは両者が異なる 2 つのリクエスト整形の詳細のみを選択します。`ollama` は `options.num_ctx` を取得し、`vllm` は `chat_template_kwargs={"thinking": false}` を取得します。これがないと、推論パーサーを実行している vLLM サーバーは構造化応答全体を `message.reasoning` にルーティングし、`message.content` を空のままにして、JSON 解析を壊します。`openai` はどちらも送信しません。`num_ctx` にはそこに相当するものがないためです。これは、ホスト、モデル、タイムアウト、コンテキスト、またはサンプリング設定の取得元を変更するものではありません。これらは、3 つすべてについて上記の `OLLAMA_*` キーです。
- **`LLM_API_KEY`** — 設定されたバックエンドに送信される資格情報。デフォルトはリテラルな `ollama` で、これは Ollama 自身のサーバーが無視するプレースホルダーであるため、既存のインストールのリクエストは変更されません。空の値は、OpenAI SDK が `api_key=""` を拒否するため、同じプレースホルダーにフォールバックします。サーバーがキーを強制する場合は、実際の値に設定してください。`--api-key` で起動された vLLM サーバーは、そうしないと 401 を返します。
- LLM 攻撃を使用する前に、Ollama が実行され、モデルがプルされていることを確認してください(`ollama pull qwen3:4b-instruct`)。hate_crack は、欠落しているモデルを自動プルしなくなりました。

攻撃には 3 つの生成モードがあります:

1. **Target info** — 会社/業界/所在地/親会社。モデルはこれらの詳細から候補を導き出します。

   会社名を入力すると、hate_crack は同じローカルモデルにその組織について既に知っていることを尋ね、**Industry**、**Location**、**Parent Company** のプロンプトに回答を事前入力し、括弧内に表示します:   ```
   Company name: Acme Rail Services

   [!] The values in parentheses below are the local model's GUESSES, not verified OSINT.
       Press Enter to accept, or type your own value to override.
   Industry (freight rail maintenance):
   Location (Omaha, Nebraska):
   Parent company / acquired by:

Enter キーを押して候補を受け入れるか、その上に入力します。これらの値はモデルの記憶によるものであり、OSINTではありません — クライアントに関するインテリジェンスではなく、出発点として扱ってください。ルックアップはローカルのOllamaサーバーのみを使用するため、クライアント名がホストの外に出ることはありません。WebやサードパーティのAPI呼び出しはありません。モデルが組織を認識しない場合(小規模なクライアントでは一般的なケース)、何も返さず、空白のプロンプトが表示されます。 ``` Company name: Acme Rail Services Industry: Location: Parent company / acquired by:

リサーチの失敗(タイムアウト、Ollamaが起動していない、空の回答)は攻撃を決してブロックせず、単に空のプロンプトにフォールバックするだけです。`ollamaAutoResearch` を `false` に設定すると、リサーチを完全にスキップします。
2. **ワードリスト** — サンプルのワードリストからベースワードを導出します。
3. **クラック済みパスワード** — このセッションで既に復元された平文(`<hashfile>.out`)をモデルにフィードバックし、対象組織独自のパスワード規則(ベースワード、季節、年、接尾辞、リークスピーク)を推測させ、同じスタイルで*新しい*候補を生成させます。このオプションは、少なくとも1つのハッシュがクラックされた後にのみリスト表示されます。ファイル全体は、ワードリストモードとまったく同じように統計的に分析されます(上記の `ollamaMaxSampleLines` を参照)。

#### PCFG設定

PCFG攻撃(オプション20)とPRINCE-LING攻撃(オプション21)は、`pcfg_cracker` サブモジュールを使用します。これらは `config.json` で設定します:```json
{
"pcfgRuleset": "DEFAULT",
"pcfgMaxCandidates": 50000000,
"pcfgPrinceLingMaxCandidates": 10000000
}
  • pcfgRuleset — 使用する学習済み文法の名前(デフォルト: DEFAULT)。pcfg_cracker/Rules/<name>/ に解決されます。pcfg_cracker の trainer.py で独自のルールセットを学習し、この値をそのルールセット名に設定してください。
  • pcfgMaxCandidates — PCFG 攻撃で pcfg_guesser.py が生成する最大候補数(デフォルト: 50000000)。
  • pcfgPrinceLingMaxCandidatesprince_ling.py がキャッシュされた PRINCE ベースワードリストに書き込む最大ベースワード数(デフォルト: 10000000)。

最適化カーネル(optimizedKernelAttacks

hashcat の -O フラグは最適化カーネルを選択します。これは大幅に高速ですが、候補の長さに上限があり(おおよそ31文字、一部のモードではそれ以下)、それを超えるものは静かにスキップされます。config.jsonoptimizedKernelAttacks-O で実行される攻撃をリストします。リストから攻撃を除外すると、フルレングスカーネルで実行されます。config.json.example のリストは、config.json が存在しない場合に適用される組み込みデフォルトと一致します。

4つの攻撃はこの設定を尊重しますが、デフォルトでは最適化されません。これは、-O の上限を超える可能性のある候補を供給するためです。オプトインするには、これらをリストに追加してください:

  • hcatNgramXhcatOllamahcatOmenhcatLMtoNT

設定を編集せずに単一の実行で -O をすべてオフにするには、--no-optimized-kernel(短縮形 --no-optimize)を渡します。これはすべての攻撃のリストを上書きし、hcatTuning に書き込まれた -O も削除します。そうしないと、リストに関係なく hashcat に到達してしまいます。

名前は完全一致で照合され、認識されないエントリは無視されるのではなく、起動時に報告されます。別の攻撃に委任する攻撃は、自身の名前ではなく委任先の攻撃によって制御されることに注意してください: PRINCE-LING は hcatPrince に従い、Spoonman、Rosetta、および LLM パターンルールモードは hcatQuickDictionary に従います。

攻撃カバレッジ追跡(coverage_enabled

長期にわたるエンゲージメントでは、同じハッシュファイルが、回転するワードリスト、ルールファイル、マスクリストのセットで多くのセッションにわたって攻撃されます。すでにカバーした領域を再実行して何時間も費やすのは簡単です。特に、同じルール行が複数のルールファイルに存在するためです。hate_crack は各ハッシュファイルに対してすでに実行した内容を記録し、重複をスキップすることを提案します。

カバレッジはファイル単位ではなくエントリ単位で記録されます: 個々のルール行と個々の .hcmask 行が、それぞれ実行されたワードリストとペアになります。これにより、今日実行するカスタムルールファイルが、先週 best64.rule がすでにカバーした40のルールを繰り返していることを認識できます。また、ルールが試行された特定のワードリストに対してのみ「カバー済み」となる理由でもあります。同じルールでも異なるコーパスに対しては、まったく異なる候補を試すことになります。

ハッシュファイルは内容の sha256 で識別されるため、カバレッジはセッション間での名前変更や移動後も維持されます。ワードリストも同じ方法で識別され、ダイジェストはサイズと mtime に対してメモ化されるため、数ギガバイトのコーパスは毎回の攻撃ではなく一度だけハッシュ化されます。

スキップすべきものが実際にある場合にのみプロンプトが表示されます:``` [*] Coverage: 40 of 45 rules in this Dictionary have already been run against this hash file. [?] Skip them and run only the 5 new rules? [Y/n]:

`Y` と答えると hate_crack は未試行のエントリだけを保持する一時ルールファイルを作成し、`n` と答えると全体をそのまま実行します。*すべて*のエントリが重複している場合は、攻撃を完全にスキップするかどうかを尋ねられるため、既にカバー済みの範囲を意図的に再実行する場合でもツールを再起動する必要はありません。

フィルタリングされなかった攻撃も実行済みとして記録されるため、「このターゲットに対して PRINCE を既に実行したか?」という質問に答えられます。

複数のルールファイルを一度に選択する攻撃 (Quick Crack、Loopback) では、hashcat の呼び出し前に、バッチ全体に対してスキップの質問が**一度だけ**行われます。この質問は意図的に軽量です — 選択されたルールファイルの読み取りやハッシュ化は行いません。YOLO バッチは数百万行に及ぶ可能性があり、その処理を待ってから yes/no に答えるべきではないからです。ストアに対しては、この攻撃がこのハッシュファイルに対して**これらのワードリストのいずれかで**既に実行されたかどうかのみを尋ねます。エントリごとの差分は依然として遅延的に、一度に 1 つのルールファイルずつ実行され、実際に何がスキップされるかを決定します。したがって、新しいコーパスは、そのルールが別のコーパスに対してすべて実行済みであっても、フラグが立てられることはありません。

意図的な制限が 3 つあります:

- **カバレッジは hashcat がキースペースを使い果たした場合のみ記録されます** (終了コード 1)。ctrl-C やエラーでは何も記録されず、終了コード 0 でも記録されません — これはすべてのハッシュがクラックされたことを意味し、hashcat はキースペースを完了*せずに*報告し、また「すべてのハッシュが potfile エントリとして見つかった」という縮退ケースでは単一の候補も試さずに報告します。記録不足は後で冗長な実行が発生するだけです。
- **動的候補生成器は決してフィルタリングされません。** PRINCE、PCFG、OMEN、Markov ブルートフォース、LLM モードには差分を取る固定セットがないため、実行済みとして記録されるだけで、それ以外はそのままにされます。連結されたルールファイル (`-r a -r b`) はエントリごとではなく単一のユニットとして追跡されます。これは、hashcat が 2 つのファイルの*デカルト積*を適用するため、個々の行を削除すると、その行が関与するすべての組み合わせが黙って削除されるからです。
- **`--loopback` 実行は記録されますが、決してフィルタリングされません。** hashcat は新しくクラックされた平文を*追加の*候補としてフィードバックするため、そのような実行は完全なワードリストとルールセットに加えて、リサイクルされた平文が到達するものすべてを試します。これにより、2 つの方向は非対称になります: 記録は妥当であり、同じワードリストとルールの後の通常の実行は正しく繰り返しとして認識されますが、2 回目のループバック実行ではリサイクルするクラックが増えるため、スキップされることはありません。

これを無効にするには `config.json` で `coverage_enabled` を `false` に設定するか、単一の実行に対して `--no-coverage` を渡します — どちらもストアを参照も更新もせず、実行されます。

#### カバレッジの確認とリセット

メインメニューのオプション **85 — Attack Coverage** は、読み込まれたハッシュファイルに対して実行された内容、その実行履歴を表示し、クリアできます。同じ 3 つの操作はスクリプト化も可能です:```bash
# What has already been run against this hash file?
hate_crack coverage status --hashfile hashes.txt

# Every attack that has run against it, oldest first
hate_crack coverage history --hashfile hashes.txt

# Start over for this hash file only (prompts unless --yes)
hate_crack coverage forget --hashfile hashes.txt --yes

ハッシュファイルは内容によって識別されるため、移動された場所に関係なく機能します。forget はその1つのターゲットのみに影響します。ストアは ~/.hate_crack/coverage/attack_coverage.sqlite3 にあり、ファイルを削除するとすべてのターゲットのカバレッジがリセットされます。

スクリプト実行

カバレッジによって完全にスキップされたスクリプト化された攻撃でも、デフォルトでは終了コード 0 が返されるため、カバレッジを有効にしても既存のハーネスが失敗し始めることはありません。何も起動されなかった場合に終了コード 3 を取得するには、--exit-code-on-skip を渡します。```bash hate_crack --exit-code-on-skip hashes.txt dict

0 = ran, 1 = bad input, 2 = unknown command, 3 = everything was already covered

終了コード3は*何も*実行されなかったことを意味します。部分的にフィルタリングされたパス(一部のエントリがスキップされ、一部が試行された)でも、攻撃が実際に作業を行ったため、終了コード`0`のままです。

### 通知(メニューオプション82)

hate_crackは、攻撃完了時および(オプションで)個々のハッシュがクラックされたときにPushoverプッシュ通知を送信できます。すべての制御はメインメニューのオプション`82 — 通知`にあります:

1. **Pushover通知の切り替え [ON/OFF]** — マスタースイッチ。`config.json`に`notify_enabled`として保存されます。
2. **クラックごとの通知の切り替え [ON/OFF]** — ONの場合、バックグラウンドのテイラーが`.out`ファイルを監視し、クラックごとに通知をプッシュします(ティックごとのバースト集約付き)。`config.json`に`notify_per_crack_enabled`として保存されます。マスタースイッチがOFFの間は有効にできません。最初にオプション1を有効にしてください。
3. **テストPushover通知の送信** — 事前定義されたプッシュを送信して、Pushoverトークン/ユーザーペアが機能することを確認できます。マスタースイッチがOFFの場合でも機能します。

認証情報は`.env`にあり、残りの調整ノブは`config.json`の設定ファイルのみです:

- `NOTIFY_PUSHOVER_TOKEN`、`NOTIFY_PUSHOVER_USER`(`.env`内) — プッシュが発火するために必須です。メニューでこれらを書き込むものはありません。`.env`を自分で編集してください。
- `notify_attack_allowlist` — `[y/N/always]`プロンプトなしで自動同意する攻撃名。`always`と回答すると自動的に入力されます。
- `notify_suppress_in_orchestrators`(デフォルト`true`) — Extensive Crackによって連鎖される個々の攻撃を沈黙させ、代わりに単一のサマリーを発火します。連鎖された攻撃ごとに通知を受け取るには`false`に設定します。複数のパスを実行する他のメニューエントリ(たとえば、複数のルールチェーンを使用するQuick Crack)はオーケストレーターではなく、常にパスごとに通知します。
- `notify_max_cracks_per_burst`(デフォルト`5`)、`notify_poll_interval_seconds`(デフォルト`5.0`) — クラックごとのテイラーチューニング。バースト集約ロジックについては`hate_crack/notify/tailer.py`を参照してください。

### ワードリストツール(メニューオプション80)

ワードリストツールサブメニューは、hashcat-utilsバイナリを利用したワードリスト前処理ユーティリティと、Hashmob.netおよびWeakpassからのワードリストダウンロードを提供します。メインメニューのオプション**80**からアクセスします。

| オプション | バイナリ | 機能 |
|--------|--------|--------------|
| 1 | `len.bin` | 長さでフィルタリング — 最小長と最大長の間の単語のみを保持 |
| 2 | `req-include.bin` | 文字クラスを必須にする — 必要なすべての文字タイプを含む単語のみを保持 |
| 3 | `req-exclude.bin` | 文字クラスを除外 — 除外された文字タイプのいずれかを含む単語を削除 |
| 4 | `cutb.bin` | 部分文字列を抽出 — 各単語からバイト範囲を切り出す |
| 5 | `splitlen.bin` | 長さで分割 — 単語の長さごとに別々のファイルを作成(出力ディレクトリ内に`01`〜`64`という名前のファイル) |
| 6 | `rli.bin` / `rli2.bin` | 単語を減算 — 1つ以上の他のファイルに現れるエントリを削除 |
| 7 | `gate.bin` | シャーディング — 複数マシンでの分散クラッキング用にN番目ごとの単語を抽出 |
| 8 | - | ワードリストを最適化 — 最適化ワードリストディレクトリの下で重複排除し、長さごとのファイルに分割 |
| 9 | - | Hashmob.netからワードリストをダウンロード |
| 10 | - | Weakpassからワードリストをダウンロード(BitTorrent経由) |

**文字クラスマスクビット**(オプション2および3で使用):`1`=小文字、`2`=大文字、`4`=数字、`8`=記号、`16`=その他。値を加算します:`7` = 小文字+大文字+数字。

**シャーディングの使用方法**:シャーディングは1つのワードリストをN個の等しい重複しない部分に分割し、作業を複数のマシンまたはGPUに分散できるようにします。各部分は*インターリーブ*され(N行ごと)、すべてのシャードがリスト全体の代表的なサンプルとなり、連続した先頭/末尾チャンクではありません — 単一ノードが低確率の末尾のみをクラッキングする状況にはなりません。

オプション7を1回実行し、入力ワードリスト、出力ベースパス、シャード数(N)を指定します。すべてのN部分を1回のパスで書き出し、ゼロ埋めされたパート番号(`base.001`、`base.002`、… `base.00N`まで)で名前が付けられます。各部分を各ノードにコピーし、そのノードのhashcat実行をその部分に向けます。シングルGPUシステムではシャーディングによる高速化はありませんが、単一の部分は、完全なリストに取り組む前の迅速なトリアージパス用の高速で代表的なサンプルとして依然として有効です。

#### 自動更新チェック

hate_crackは起動時にGitHubで新しいリリースを自動的にチェックできます。この機能は`check_for_updates`設定オプションによって制御されます:```json
{
  "check_for_updates": true
}
  • check_for_updates — 起動時に自動バージョンチェックを有効にします(デフォルト: true)。
  • 有効にすると、hate_crack は GitHub から最新リリース情報を取得し、アップデートが利用可能な場合に通知を表示します。
  • このチェックは非同期で実行され、起動をブロックしません。ネットワークエラーは静かに無視されます。
アップデートチャンネル
チャンネルフラグソース取得内容
リリース--updatemain最新の正式リリース。これがデフォルトであり、起動時チェックが提供するものです。
ナイトリービルド--nightlynightly-devCI を通過したがまだリリースされていない作業。

バージョンは通常のセマンティックバージョニングに従い、バンプはバッチ内の実際の内容から決定されます。2番目のコンポーネントは機能のみで変更されます: 任意の feat コミットを含むサイクルは X.(Y+1).0 を目指し、修正、ドキュメント、雑務のみのサイクルは X.Y.(Z+1) を目指します。

nightly-dev は、バッチが目指すバージョンに向けたリリース候補をタグ付けします — v2.20.1rc1v2.20.1rc2、… — そして main へのマージダウンにより、同じターゲットが最終リリースに昇格します。候補は本物の PEP 440 プレリリースであるため、両端で正しく順序付けられます:

2.20.0  <  2.20.1rc1  <  2.20.1rc2  <  2.20.1  <  2.21.0rc1  <  2.21.0

ターゲットはサイクル途中で変更される可能性があります: 最初に取り込まれる feat により、X.Y.(Z+1) から X.(Y+1).0 に移動し、候補番号は新しいターゲットに対して再開されます。番号は常に、バッチが今日出荷するであろうものを示します。

メジャーコンポーネントは自動的にバンプされることはありません — ! の件名または BREAKING CHANGE: フッターは機能としてカウントされます。自動メジャーは、誤って入力された件名1つで、取り消し不可能な公開リリースにつながるためです。メジャーは明示的な人間の行為です: 手動でタグを付けてプッシュしてください。

このポリシーは tools/next_version.py にあり、両方のタグ付けワークフローで共有され、tests/test_next_version.py でユニットテストされています。

起動時チェックは常にリリースのみを提供します。ナイトリービルドは GitHub リリースを一切公開せず、チェックは GitHub の「最新リリース」エンドポイントを読み取るためです — したがって、check_for_updates を有効にしてもナイトリービルドに引き込まれることはありません。現在、チャンネルを分離しているのは2つの点です: それと、候補が本物の PEP 440 プレリリースであるため、生のバージョン番号をランク付けするツールも、それが最終的にリリースされるものより古いものとして扱うことです。

どちらのフラグも、まずチェックアウトを対応するブランチに切り替えます(未コミットの変更がある場合は拒否します)。ナイトリービルドを実行していてリリース済みコードに戻りたい場合は、--updatemain に戻ります。

自動検出ハッシュマージ(左側ダウンロードのみ)

左側ハッシュ(未クラックハッシュ)をダウンロードするとき、hate_crack は自動的に:

  1. 補助操作として、Hashview から検出済み(クラック済み)ハッシュのダウンロードを試みます
  2. 検出済みハッシュをローカルの .out ファイル(例: left_1_123.txt.out または pwdump 形式の場合は left_1_123.nt.txt.out)とマージします
  3. 重複エントリを削除します
  4. マージ後に一時的な分割ファイルをクリーンアップします

これにより、未クラックハッシュを扱う際に、ローカルのクラック結果が Hashview の集中データベースと同期された状態を維持できます。

注: ダウンロード検出オプションは、参照目的で既にクラック済みのハッシュを別途ダウンロードするものであり、マージやクラックのプロンプトは実行しません。

<hash_type>hashcat --help を実行して取得されます。

ハッシュの例: http://hashcat.net/wiki/doku.php?id=example_hashes``` $ hashcat --help |grep -i ntlm 5500 | NetNTLMv1 | Network protocols 5500 | NetNTLMv1 + ESS | Network protocols 5600 | NetNTLMv2 | Network protocols 1000 | NTLM | Operating-Systems

The `-p` flag is used to specify the port number, and the `-t` flag is used to specify the target IP address. The `-m` flag is used to specify the mode of operation, which can be either `scan` or `exploit`. In `scan` mode, the tool will scan the target for open ports and services. In `exploit` mode, the tool will attempt to exploit the target using the specified port and service.```
$ ./hate_crack.py <hash file> 1000

  ___ ___         __             _________                       __
 /   |   \_____ _/  |_  ____     \_   ___ \____________    ____ |  | __
/    ~    \__  \\   __\/ __ \    /    \  \/\_  __ \__  \ _/ ___\|  |/ /
\    Y    // __ \|  | \  ___/    \     \____|  | \// __ \\  \___|    <
 \___|_  /(____  /__|  \___  >____\______  /|__|  (____  /\___  >__|_ \
       \/      \/          \/_____/      \/            \/     \/     \/
                          Version 2.0

テスト

テストスイートは主にオフラインで動作し、モック/フィクスチャを使用します。ライブネットワークチェックとシステム依存関係チェックは、環境変数を介してオプトイン方式となっています。

ローカルでのテスト実行```bash

Run all tests

uv run pytest -v

Run specific test

uv run pytest tests/test_hashview.py -v

`make test` で完全なスイートを実行することもできます。

### ライブテスト(オプトイン)

ライブチェックを有効にするには、次のいずれかを設定します:

- `HASHMOB_TEST_REAL=1` — ライブの Hashmob 接続性/CLI メニューチェック
- `HASHVIEW_TEST_REAL=1` — ライブの Hashview CLI メニューチェック
- `WEAKPASS_TEST_REAL=1` — ライブの Weakpass CLI メニューチェック
- `HATE_CRACK_REQUIRE_DEPS=1` — `7z`、`transmission-daemon`、または `transmission-remote` が欠落している場合に失敗します

### ライブ Hashview アップロードテスト

ライブの Hashview アップロードテストはデフォルトではスキップされます。実行するには、環境変数を設定し、`.env` に有効な認証情報を提供してください:```bash
HATE_CRACK_RUN_LIVE_TESTS=1 uv run pytest tests/test_upload_cracked_hashes.py -v

ローカルDockerスタックに対するライブHashviewテスト

ライブテストをリモートのHashviewサーバーに向ける代わりに、スイートにローカルのHashview Dockerスタックを起動させ、シードデータを投入し、それに対してライブテストを実行し、最後に停止させることができます。 HASHVIEW_TEST_LOCAL=1を設定し、HASHVIEW_REPOをHashviewのチェックアウト先に指定します:```bash HASHVIEW_TEST_LOCAL=1 HASHVIEW_REPO=~/projects/hashview
HATE_CRACK_SKIP_INIT=1 uv run pytest tests/test_hashview_cli_subcommands_subprocess.py -v

これはHashviewリポジトリ内で`docker compose`を起動し、管理者APIキー、顧客、ハッシュファイル、クラック済みの「有効なタスク」データをシードしてから、テストが読み取る`HASHVIEW_*`環境変数をエクスポートします。便利な環境変数:

- `HASHVIEW_TEST_LOCAL=1` — ローカルスタックを有効化(それ以外は何もしない)
- `HASHVIEW_REPO=<path>` — Hashviewのチェックアウト先(デフォルトは`~/projects/hashview`)
- `HASHVIEW_KEEP=1` — セッション終了後もコンテナを起動したままにする(再実行が高速化)
- `HASHVIEW_LOCAL_PORT=5000` — アプリが公開されるホストポート

hate_crack CLIは`HASHVIEW_URL` / `HASHVIEW_API_KEY`環境変数を優先します(これら2つのキーが入っている`.env`を上書きします)。これにより、スイートは永続化された設定を編集せずにCLIをローカルスタックに向けることができます。

### エンドツーエンドのインストールテスト(ローカル + Docker)

ローカルのuvツールインストールとスクリプト実行(一時的なHOMEを使用):```bash
HATE_CRACK_RUN_E2E=1 uv run pytest tests/test_e2e_local_install.py -v

Dockerベースのエンドツーエンドのインストール/実行(Dockerfile.testを介してキャッシュ):```bash HATE_CRACK_RUN_DOCKER_TESTS=1 uv run pytest tests/test_docker_script_install.py -v

Docker E2Eテストは、rockyouの小さなサブセットもダウンロードし、外部ツールの統合を検証するために基本的なhashcatクラックを実行します。

Lima VMエンドツーエンドテスト(macOSのみ):

前提条件:[Lima](https://lima-vm.io/)と`rsync`がインストールされている必要があります。```bash
brew install lima

テストVMは、すべてのLinux依存関係(hashcat、build-essential、curl、git、gzip、p7zip-full、transmission-daemon、ocl-icd-libopencl1、pocl-opencl-icd、uv)とともに自動的にプロビジョニングされます。```bash HATE_CRACK_RUN_LIMA_TESTS=1 uv run pytest tests/test_lima_vm_install.py -v

このテストは、macOS上の軽量Linux VM内でのインストールと実行を検証します。

### テスト構成

- **tests/test_hashview.py**: モック化されたAPIレスポンスを使用したHashviewAPIクラスの包括的なテストスイート。以下を含みます:
  - 顧客一覧とデータ検証
  - 認証および認可テスト
  - ハッシュファイルのアップロード機能
  - 完全なジョブ作成ワークフロー

すべてのテストはモック化されたAPI呼び出しを使用するため、Hashviewサーバーへの接続なしで実行できます。

-------------------------------------------------------------------

  (1) クイッククラック
  (2) 拡張Pure_Hateメソッドクラック
  (3) ブルートフォース攻撃
  (4) トップマスク攻撃
  (5) フィンガープリント攻撃
  (6) コンビネータ攻撃
  (7) ハイブリッド攻撃
  (8) Pathwellトップ100マスクブルートフォースクラック
  (9) PRINCE攻撃
  (10) Bandrelメソッド
  (11) ループバック攻撃
  (12) LLM攻撃
  (13) OMEN攻撃
  (14) アドホックマスク攻撃
  (15) マルコフブルートフォース攻撃
  (16) N-gram攻撃
  (17) 順列攻撃
  (18) ランダムルール攻撃
  (19) Combipowパスフレーズ攻撃
  (20) PCFG攻撃
  (21) PRINCE-LING攻撃
  (22) Spoonman攻撃
  (23) Rosetta攻撃
  (24) コーポレートマスクブルートフォース
  (25) スマートマスク攻撃

  (80) ワードリストツール
  (81) ルールファイルツール
  (82) 通知
  (83) マスクツール

  (93) POTファイルから.outを再生成
  (94) Hashview API
  (95) Pipalでハッシュを分析
  (96) 出力をExcel形式にエクスポート
  (97) クラック済みハッシュを表示
  (98) READMEを表示
  (99) 終了

タスクを選択してください:```

Option `94 — Hashview API` is only listed when `HASHVIEW_API_KEY` is set in `.env`.

The YOLO, Middle, and Thorough Combinator attacks were previously at keys 10-12. They now live in the Combinator Attacks submenu (option 6) along with Combinator3 and CombinatorX.
-------------------------------------------------------------------
#### Quick Crack
Runs a dictionary attack against wordlists in your `hcatOptimizedWordlists` directory (falls back to `hcatWordlists` if not configured) and optionally applies rules. Multiple rules can be selected by comma-separated list, and chains can be created with the '+' symbol. Pressing Enter at the wordlist prompt uses the configured optimized wordlists directory as the default.

Selecting a directory — including that default — expands to the wordlists
directly inside it before hashcat runs. Subdirectories are not searched,
matching hashcat's own behaviour for a directory in the dictionary position, and
dot-files and `.7z`/`.torrent`/`.out` files are skipped, which hashcat would
otherwise try to read. The candidates are the same either way; the expansion is
what lets attack coverage track each wordlist separately, since a directory has
no content fingerprint to key on. If the expansion finds nothing — an empty
directory, or one holding only subdirectories or archives — the attack aborts
rather than launching hashcat with no wordlist, which would put it in stdin
mode and leave it reading the terminal.

どのルールを実行しますか? (1) best64.rule (2) d3ad0ne.rule (3) T0XlC.rule (4) dive.rule (99) YOLO...すべてのルールを実行 実行するルールをカンマ区切りで入力してください。ルールをチェーンして実行するには+記号を使用します。 例えば、1+1はbest64.ruleを2回チェーンして実行し、1,2はbest64.ruleを実行してからd3ad0ne.ruleを順番に実行します。 賢く選択してください:```

Extensive Pure_Hate Methodology Crack

Runs several attack methods provided by Martin Bos (formerly known as pure_hate):

  • Brute Force Attack (7 characters)
  • Dictionary Attack
    • All wordlists in hcatWordlists with best64.rule
    • rockyou.txt with d3ad0ne.rule
    • rockyou.txt with T0XlC.rule
  • Top Mask Attack (Target Time = 4 Hours)
  • Fingerprint Attack
  • Smart Mask Attack
  • Combinator Attack
  • Hybrid Attack
  • Extra - Just For Good Measure
    • Runs a dictionary attack using rockyou.txt with chained combinator.rule and InsidePro-PasswordsPro.rule rules

Brute Force Attack

Brute forces all characters with the choice of a minimum and maximum password length.

Top Mask Attack

Uses StatsGen and MaskGen from PACK (https://thesprawl.org/projects/pack/) to perform a top mask attack using passwords already cracked for the current session. Presents the user a choice of target cracking time to spend (default 4 hours).

Fingerprint Attack

https://hashcat.net/wiki/doku.php?id=fingerprint_attack

Runs a fingerprint attack using passwords already cracked for the current session. Expander substring length escalates automatically (7, 14, 21, ... up to the chosen ceiling), and an optional wordlist can be combined against the expanded fragments in addition to self-combination. Set hcatFingerprintWordlist in config.json to a default wordlist path so the prompt offers it instead of asking for a path every time; leave it as "" to always ask (or skip).

Smart Mask Attack

Looks for literal "skeleton" patterns shared by 3+ already-cracked passwords for the current session -- e.g. a fixed stem like CrawlingHorse followed by a run of digits, or ChangeMe2day followed by digits and symbols drawn from a consistent charset. Every qualifying pattern runs against the full remaining hash list, so other accounts sharing a stem get swept up even though brute-forcing the stem itself was never tried.

Patterns with a fixed run at either end -- nearly all of them -- are grouped by mask and run as hybrid attacks (-a 6 when the mask trails the stem, -a 7 when it leads), with every pattern's literal stem a line in that group's wordlist. Dozens of patterns that vary the same way therefore become one hashcat pass over one wordlist rather than one mask line each. Whatever cannot be grouped that way -- variation at both ends, which leaves no fixed run to seed a wordlist with -- falls back to a single -a 3 mask file, and has its charsets widened (up to ?a) to compensate, as far as the guardrail below allows.

Prompts once, before the attack starts, for an optional per-pattern candidate-count guardrail (default 50,000,000,000; 0 disables it) that excludes any individual pattern whose keyspace is too large without blocking the rest.

Combinator Attack

https://hashcat.net/wiki/doku.php?id=combinator_attack

Runs a combinator attack using the "rockyou.txt" wordlist.

Hybrid Attack

https://hashcat.net/wiki/doku.php?id=hybrid_attack

  • Runs sixteen hybrid passes per wordlist, cheapest first. Each mask length from 1 to 4 is tried appended and then prepended, first over ?s?d and then over ?a, and a single ctrl-C abandons the whole attack rather than only the current pass.

    • Hybrid Wordlist + Mask - ?s?d wordlists/rockyou.txt ?1
    • Hybrid Mask + Wordlist - ?s?d ?1 wordlists/rockyou.txt
    • ... the same for ?1?1, ?1?1?1 and ?1?1?1?1
    • Hybrid Wordlist + Mask - wordlists/rockyou.txt ?a
    • Hybrid Mask + Wordlist - ?a wordlists/rockyou.txt
    • ... the same for ?a?a, ?a?a?a and ?a?a?a?a

    ?a is every printable character, so the second group is a superset of the first plus letters and roughly 24x the work at the longest mask — over rockyou.txt those passes alone are ~1.2e15 candidates, about ten hours for NTLM on hardware doing 32 GH/s. That is why the cheap ?s?d group runs first and why the attack as a whole is time-bounded:

    • hcatHybridMaxRuntime in config.json, in seconds, default 3600, is the time the whole attack may spend — not the time one pass may spend. All sixteen passes share one deadline, and each is handed whatever is left of it as hashcat's --runtime. Any pass the budget does not reach is reported rather than skipped quietly. Set it to 0 for no limit, which runs every pass to exhaustion.

    Within each group the order is by mask length across every wordlist rather than all lengths of one wordlist and then the next, so a budget that runs out has still given every wordlist its cheap passes.

    Each pass declares what it covers to the attack-coverage store, so a repeat hybrid against the same hash file offers to skip the passes already run. A pass that runs out of budget is not recorded, so it will be retried. Wordlist entries may be glob patterns or directories; both are expanded before hashcat runs, a directory into the wordlists directly inside it. Subdirectories are not searched, matching hashcat's own behaviour, and dot-files and .7z/.torrent/.out files are skipped — a Weakpass download leaves archives in the wordlists directory and hashcat would otherwise try to read them.

Pathwell Top 100 Mask Brute Force Crack

Runs a brute force attack using the top 100 masks from KoreLogic: https://blog.korelogic.com/blog/2014/04/04/pathwell_topologies

PRINCE Attack

https://hashcat.net/events/p14-trondheim/prince-attack.pdf

Runs a PRINCE attack using wordlists/rockyou.txt

YOLO Combinator Attack

Runs a continuous combinator attack using random wordlists from the configured wordlists directory for the left and right sides.

Middle Combinator Attack

https://jeffh.net/2018/04/26/combinator_methods/

Runs a modified combinator attack adding a middle character mask: wordlists/rockyou.txt + masks + worklists/rockyou.txt

Where the masks are some of the most commonly used separator characters: 2 4 - _ , + . &

Thorough Combinator Attack

https://jeffh.net/2018/04/26/combinator_methods/

  • Runs many rounds of different combinator attacks with the rockyou list.
    • Standard Combinator attack: rockyou.txt + rockyou.txt
    • Middle Combinator attack: rockyou.txt + ?n + rockyou.txt
    • Middle Combinator attack: rockyou.txt + ?s + rockyou.txt
    • End Combinator attack: rockyou.txt + rockyou.txt + ?n
    • End Combinator attack: rockyou.txt + rockyou.txt + ?s
    • Hybrid middle/end attack: rockyou.txt + ?n + rockyou.txt + ?n
    • Hybrid middle/end attack: rockyou.txt + ?s + rockyou.txt + ?s

Bandrel Methodology

Prompts for comma-separated names and creates a pseudo hybrid attack by capitalizing the first letter and adding up to six additional characters at the end. Each word is limited to a total of five minutes.

  • Built-in common words (seasons, months) included as a customizable config.json entry (bandrel_common_basedwords)
  • The default five-minute time limit is customizable via bandrelmaxruntime in config.json

Loopback Attack

https://hashcat.net/wiki/doku.php?id=loopback_attack

Uses hashcat's loopback mode to feed cracked passwords from the current session back into the attack pipeline with rules applied. This generates new password candidates based on variations of already-cracked passwords, which is particularly effective for finding related passwords that follow similar patterns.

  • Prompts for rule selection to apply to the loopback candidates
  • Uses an empty wordlist with the --loopback flag to process previously cracked passwords
  • Automatically downloads Hashmob rules if no rules are available locally

LLM Attack

Uses a local LLM — Ollama by default, or a vLLM / OpenAI-compatible server via LLM_BACKEND — to generate password candidates for a capture-the-flag scenario. Prompts for the fake company name, industry, location, and parent company / acquisition history, then sends these details to the configured LLM model to produce likely password candidates using industry terms and company name permutations. The generated candidates are fed into a hashcat wordlist+rules attack.

  • Requires a running server at OLLAMA_HOST (default: http://localhost:11434, Ollama's port; override in .env or the environment) already serving the model — hate_crack does not auto-pull
  • Candidate generation uses structured (JSON) output via Atomic Agents, so pick a model with good schema adherence (default: qwen3:4b-instruct)
  • Configurable backend, model, context window, request timeout, and sample size via .env (see LLM Configuration)
  • Prompts for target company name, industry, location, and parent company / acquisition history. The industry, location, and parent company prompts are pre-filled with the local model's guesses about the named organization (editable, and clearly labelled as guesses rather than verified OSINT); disable with ollamaAutoResearch: false
  • Alternatively derives basewords from a sample wordlist, or from the cracked passwords of the current session (<hashfile>.out) so the model mirrors the target organization's own password conventions and produces new candidates in that style (only offered once something has been cracked)
  • A live spinner with an elapsed-seconds counter runs during generation, and requests are bounded by ollamaTimeout so a model stuck loading into VRAM reports a timeout instead of hanging

Pattern rules mode (option 4 in the LLM submenu) takes the same shape as the Spoonman Attack — a baseword list run through a rule file, both derived from one corpus — but infers each side with the model instead of extracting it. Spoonman is exact and therefore bounded: its basewords all appear in the corpus and its rules only reproduce transformations the corpus already shows. This asks the model to generalize on both axes, so it can name the word families behind a sample (the company and its products, site names, local sports teams, seasons, mascots) and write decorations the corpus does not contain.

  • Pattern source is either the current session's cracked passwords (offered first, and only once something has been cracked, since those reveal the target's real conventions) or a sample wordlist
  • You are not asked to pick a rule file. The model writes one, from the same corpus statistics — a stock rule file encodes the internet's habits, and the point of spending a model round trip is to encode this organization's
  • Basewords are normalized to lowercase letters only, discarding anything under 3 characters, so the generated rules supply case, digits, and punctuation exactly once
  • Generated rules are validated before hashcat sees them, and anything using an op hashcat does not have, a position argument outside 0-9A-Z, more than 31 functions, or a stray comment or non-ASCII character is discarded. hashcat drops an invalid rule silently when valid rules share the file, so an unscreened line would become missing coverage rather than an error. The op table was established by testing hashcat itself, not from its rule documentation, which lists ops hashcat will not actually run
  • Local-model yield varies a lot run to run, so a thin answer is asked again once and the two rounds are merged — a handful of rules would waste the pass they are spent on
  • If no rule survives validation the basewords still run, unmutated, rather than throwing away the expensive half of the run
  • Output lands in <hashfile>.llm_patterns/ as basewords.txt and rules.rule — per-run scratch, laid out like .spoonman/ and removed on exit

OMEN Attack

Uses the Ordered Markov ENumerator (OMEN) to train a statistical password model from a wordlist and generate password candidates. This attack learns patterns from known passwords and generates new candidates based on those patterns.

  • Requires OMEN binaries (createNG and enumNG) to be built from the omen submodule
  • Interactive menu: use existing model, train new model, or cancel
  • Training wordlist picker shows available wordlists from configured directory or accepts a custom path
  • Validates all 5 required model files (createConfig, CP/IP/EP/LN.level) before running
  • Captures and reports enumNG errors instead of failing silently
  • Generates up to a specified number of password candidates (configurable via omenMaxCandidates)
  • Pipes generated candidates directly into hashcat for cracking
  • Model files and metadata are stored in ~/.hate_crack/omen/ for persistence across sessions

Combinator Attacks Submenu

Opens an interactive submenu with six combinator attack variants (formerly at menu keys 10-12). Consolidates related attacks for cleaner menu organization:

  • Combinator Attack - combines two wordlists
  • YOLO Combinator Attack - combines all permutations of multiple wordlists
  • Middle Combinator Attack - combines wordlists with an extra word in the middle
  • Thorough Combinator Attack - comprehensive combination of wordlists with rules
  • Combinator3 Attack - combines exactly 3 wordlists using combinator3.bin, generating all word1+word2+word3 combinations piped to hashcat
  • CombinatorX Attack - combines 2-8 wordlists using combinatorX.bin with optional --sepFill separator character between word segments

Ad-hoc Mask Attack

Runs hashcat mask attack (mode 3) with a user-specified custom mask string. Allows fine-grained control over character-set brute forcing.

  • Opens with a choice between typing a mask and selecting a mask file
  • Prompts for a hashcat mask (e.g., ?u?l?l?l?d?d for uppercase + lowercase + lowercase + lowercase + digit + digit)
  • Supports custom character sets for specialized character combinations: -1 through -4 on any hashcat, plus -5 through -8 on hashcat 7 and newer. A mask using ?5?8 against an older hashcat is flagged before the run rather than failing inside it; if the version cannot be read, the mask is passed through and hashcat decides
  • Only prompts for the custom slots the mask actually references — ?1?3?d asks about -1 and -3 and nothing else, and a mask with no custom tokens is never asked at all. Detection is token-aware, so the escaped ??1 is a literal ?1 and prompts for nothing. A slot left blank is still skipped, with a warning that hashcat will reject a mask whose charset is undefined
  • Mask files (.hcmask) can be selected with tab completion, defaulting to the bundled masks/ directory; hashcat runs every mask in the file in order. Because a mask file defines its own charsets inline, the -1 through -4 prompts are skipped when one is chosen
  • Optionally runs the mask incrementally (--increment), trying shorter lengths before the full mask. Answering yes prompts for an increment minimum and maximum; either can be left blank, and leaving both blank increments over the mask's full keyspace with hashcat choosing the bounds. Offered for typed masks and mask files alike
  • Useful for targeted brute forcing when you know password structure patterns

Markov Brute Force Attack

Generates password candidates using Markov chain statistical models. Similar to OMEN but simpler and faster.

  • Checks for existing .hcstat2 Markov table from previous sessions (with option to reuse, regenerate, or cancel)
  • Generates table from training source if needed:
    • Can use cracked passwords from current session (.out file) as training data
    • Or select any wordlist from configured directory or custom path
  • Interactive menu: choose minimum and maximum password length
  • Uses --increment flag to test lengths in sequence
  • Markov table persists with hash file (filename.out.hcstat2) for fast subsequent runs
  • Faster than OMEN for general-purpose brute forcing

N-gram Attack

Generates n-gram candidates from a corpus file using ngramX.bin from hashcat-utils and pipes them into hashcat.

  • Prompts for a corpus file with tab completion, defaulting to the configured wordlist directory
  • Prompts for an n-gram group size (default 3)
  • Gzip-compressed corpus files are auto-detected and decompressed on the fly
  • Useful when you have target-relevant prose (scraped site copy, leaked documents, internal wiki exports) rather than a password list

Permutation Attack

Generates all character permutations of each word in a targeted wordlist and pipes them to hashcat via permute.bin from hashcat-utils.

  • Prompts for a single wordlist file (not a directory)
  • Effective against short targeted wordlists where the character set is known but the order is not (company abbreviations, name fragments, known tokens)
  • WARNING: Scales as N! per word - an 8-character word produces 40,320 permutations. Only practical for words up to ~8 characters.
  • Uses permute.bin < wordlist | hashcat pipeline pattern

Random Rules Attack

Generates a set of random hashcat mutation rules using generate-rules.bin, writes them to a temporary file, then runs hashcat against a chosen wordlist with those rules.

  • Prompts for rule count (default 65536)
  • Prompts for wordlist path with tab-completion and numbered selection
  • Temporary rules file is cleaned up after the run regardless of outcome
  • Useful when known rule sets are exhausted - explores random rule-space for additional cracks

Combipow Passphrase Attack

Generates all unique non-empty subset combinations from a short wordlist using combipow.bin and pipes them into hashcat. Designed for passphrase cracking when you know the pool of words a password was built from.

  • Prompts for a wordlist file (max 63 lines - combipow generates up to 2^n-1 combinations)
  • Optional space separator (-s flag) to insert spaces between words in each combination
  • Warns if the wordlist exceeds 20 lines (output volume may be large)
  • Aborts with a clear message if the wordlist exceeds 63 lines (hard limit)
  • Candidates are piped directly to hashcat stdin

PCFG Attack

Uses pcfg_cracker to generate candidates from a Probabilistic Context-Free Grammar, piping pcfg_guesser.py output directly into hashcat's stdin mode. A PCFG models password structure (baseword + digits + symbol, capitalization habits, keyboard walks) with learned probabilities, so candidates come out roughly in descending likelihood order.

  • Requires the pcfg_cracker submodule. Presence is checked at startup and reported non-fatally: if it is missing, the PCFG attacks are simply unavailable. Run make to fetch it.
  • Uses the trained grammar named by pcfgRuleset in config.json (default DEFAULT), read from pcfg_cracker/Rules/<name>/
  • Candidate count is capped by pcfgMaxCandidates (default 50,000,000)
  • hate_crack does not wrap grammar training. To build a grammar from a target-specific password set, run pcfg_cracker's own trainer.py and point pcfgRuleset at the resulting ruleset name

PRINCE-LING Attack

Uses pcfg_cracker's prince_ling.py to derive an optimized PRINCE base wordlist from a trained grammar, then hands it to the existing PRINCE attack. PRINCE-LING picks base words the grammar says are actually productive, so the PRINCE combination space is far less wasteful than pointing PRINCE at a generic wordlist.

  • Requires the pcfg_cracker submodule and a trained ruleset directory, same as the PCFG attack
  • The generated wordlist is cached at <hcatOptimizedWordlists>/pcfg_prince_ling_<ruleset>.txt and reused across sessions
  • Regenerates only when the ruleset directory is newer than the cached wordlist, so retraining a grammar invalidates the cache automatically
  • Generation is written to a temporary file and atomically moved into place; a failed or interrupted run cleans up its partial file and leaves any existing cache intact
  • Base wordlist size is capped by pcfgPrinceLingMaxCandidates (default 10,000,000)

Spoonman Attack

Derives a baseword list and a hashcat rule file from a corpus of known plaintext passwords — a previous engagement's cracked output, a leak dump, or any password list — such that the baseword x rule cross product reconstructs the corpus exactly (see the memory bound below for the one case where it does not). Contributed as issue #169 by @Spoonman1091.

Each password is split into its letters-only lowercased core (the baseword) plus a rule that rebuilds the original from it, using l/u/c for casing, T{p} toggles, ${x}/^{x} for trailing and leading characters, and i{p}{x} for interior ones.

  • When the current session already has cracked plaintexts (<hash file>.out exists and is non-empty), a picker offers those as the corpus ahead of a free-form path — the target's own recovered passwords derive rules describing that target's actual conventions, which is exactly what you want to fire back at the remaining uncracked hashes. Deriving from .out and then cracking the same hash file appends new plaintexts to that same file, growing the corpus for the next run; that is the intended feedback loop, not corruption. Sessions with no cracked output yet see no picker at all — just today's path prompt
  • Prompts for the corpus, then for how much of the rule file to run: top 50% coverage (listed first and recommended), top 75%, top 95%, top 99%, or the full set
  • Rules are sorted by how many passwords each one rebuilds, so a truncated file keeps the most productive rules. Coverage is extremely long-tailed: on a 98.2M-password sample, 50% coverage needed 4,120 rules while 95% needed 16,119,661 and 100% needed 21,029,696 — the last few percent typically costs orders of magnitude more rules than the first half, which is why the smallest tier is listed first and is usually the right choice
  • Output is written beside the hash file in <hash file>.spoonman/, alongside the other ephemeral wordlists: basewords.txt, rules.full.rule, the capped rule files, and coverage.txt with per-milestone rule counts. Derivation is skipped on later runs of the same hash file unless the corpus has been modified since, and the directory is removed on exit by the temp-file cleanup
  • Derivation is bounded in memory. Both counters would otherwise grow for the whole read with nothing written until the end, so a corpus large enough to exhaust RAM lost the entire pass to an OOM kill and produced no output; a measured run against a 31 GB corpus reached 14.1 GB resident at 11% of the file and was still accelerating. Each counter is now capped at 20 million distinct keys (about 1.6 GB apiece), and the lowest-frequency keys are discarded once it is exceeded. If that happens, the run says so on the console and in coverage.txt, the output reconstructs the retained keys rather than 100% of the corpus, and the coverage percentages are relative to those. Corpora below the cap are unaffected
  • Passwords that cannot be expressed as a rule are written verbatim as their own baseword with a : no-op, so coverage stays complete. This covers two hashcat limits: rule positions cannot address past index 35, and hashcat rejects any rule with more than 31 functions — silently, when valid rules share the file
  • A password carrying a literal CR or LF (which arrives hex-wrapped, as $HEX[...0a]) cannot go in a baseword at all, because a wordlist line has no escape syntax for one. The break is lifted out into an insert op instead, spelled \x0a/\x0d in the rule, which hashcat decodes to the byte. When the break sits past addressable index 35 the rule reverses the word first, inserts from the other end, and reverses back. One frame has to hold every break in the password, so what is still skipped is a password with one break outside the first 36 characters and another outside the last 36, or one needing more inserts than the 31-function cap leaves room for. Those are counted as unwritable basewords in coverage.txt and reported, never dropped silently
  • The derivation self-checks every password by reconstructing it in-process, and reports any failures rather than reporting success
  • Corpus lines may carry a hash in front of the password, as cracked output does. A leading field is dropped only when it has the shape of a hash (a hex digest at a known length, or a crypt-style $id$ string), so hash:salt:plain is handled while a plaintext or wordlist entry containing a colon survives intact. $HEX[...] plaintexts are decoded. If most lines look like an uncracked dump rather than cracked output, coverage.txt records the count and the attack warns — the derived basewords and rules would otherwise be meaningless without any error being raised

Rosetta Attack

Mines hashcat --debug-mode 5 logs for the basewords and rules that already cracked something, then runs their full cross product. Powered by HashcatRosetta, the same library behind Analyze Hashcat Rules.

No setup is needed to feed it: _add_debug_mode_for_rules appends --debug-mode 5 --debug-file to every rule-based hashcat invocation hate_crack makes, so the logs accumulate in hcatDebugLogPath (~/.hate_crack/hashcat_debug by default, one file per session) as a side effect of normal use. A mode 5 log records only candidates that cracked a hash, in the form baseword:rule:candidate:wordlist, which is what makes both halves known-productive against this target population; the trailing wordlist field also shows which list is earning its keep on a multi-wordlist run. HashcatRosetta parses mode 4 and mode 5 alike, so logs written before the switch are still read.

The value is in the cross product rather than the recorded pairs. A pair present in a log has already cracked its hash and will not crack another, but a rule that worked on one baseword has usually never been tried against the others — so N basewords and M rules yield close to N x M untried candidates.

The menu first asks how to rank rules — choices 1-3 below, plus a fourth, unrelated mode:

  • Rules can be ranked by application frequency, by how many distinct basewords each one worked on, or by how many unique candidates each one generated. Frequency is the default; baseword spread is the better choice when the goal is a rule set that generalizes past the specific words it was learned from
  • Only after one of those three is picked does hate_crack list the logs found in hcatDebugLogPath newest-first with their sizes; pick one, pick all of them (up to 20), or type a path to a log from elsewhere
  • Prompts for how many top rules to keep and how many top basewords. Both default to all — a blank answer keeps every winning rule the logs contain, and zero means the same thing. Enter a number to cap either. The keyspace is the product of the two and is printed before hashcat starts
  • Output is written beside the hash file in <hash file>.rosetta/ as basewords.txt and rules.rule, alongside the other ephemeral wordlists, and the directory is removed on exit by the temp-file cleanup
  • Reading stops at 1,000,000 debug lines, since the analyzer needs the whole batch in memory at once. Truncation is reported on the console rather than assumed harmless — logs from a long run routinely exceed this, in which case the newest log is the one worth selecting
  • LLM Mask Attack (4) - a different mode entirely, and the only one that needs no debug logs. Prompts for a natural-language description of the passwords you expect (length, character patterns, symbols, etc.), sends it to the locally configured Ollama model, writes the returned masks to <hash file>.hcmask, and runs a -a 3 hashcat mask attack against them

Corporate Masks Brute Force

Statistical masks (8-14 characters) derived from analysis of 3.2M NTLM hashes cracked on real engagements. Powered by Corporate_Masks, these masks encode realistic password patterns from successful penetration tests.

  • Prompts for minimum and maximum mask length (default 8-10)
  • Longer lengths cost exponentially more keyspace—start with 8-10 for speed, or 8-12 for thoroughness
  • Each mask file is run as a separate hashcat invocation in ascending length order
  • Gracefully handles missing mask files (skips them) and absent submodule (prints warning and returns)
  • Supports optimized kernels (-O flag) for faster cracking
  • Ctrl-C during one length aborts remaining lengths

Wordlist Tools (option 80)

A submenu of wordlist preprocessing utilities using hashcat-utils binaries. All tools read from and write to files on disk. All file and directory path prompts support tab completion.

KeyToolDescription
1Filter by LengthKeep only words between a min and max length (len.bin)
2Require Char ClassesKeep words that include all char classes in mask (req-include.bin). Mask: 1=lower, 2=upper, 4=digit, 8=symbol (additive)
3Exclude Char ClassesRemove words containing any char class in mask (req-exclude.bin). Same mask encoding
4Extract SubstringCut bytes from each word at a given offset and optional length (cutb.bin)
5Split by LengthCreate per-length files in an output directory (splitlen.bin)
6Subtract WordlistRemove lines from a wordlist that appear in one or more remove files. Mode 1 uses rli2.bin (single file); mode 2 uses rli.bin (multiple files)
7Shard WordlistSplit a wordlist into N equal, interleaved parts in one run, written as base.001base.00N for distributed cracking (gate.bin)
8Optimize WordlistsDedupe and split the selected wordlists into per-length files under an output directory
9Download from Hashmob.netBrowse and download wordlists from Hashmob.net into the configured wordlist directory
10Download from WeakpassBrowse and download Weakpass wordlist torrents, with automatic extraction
11Hashmob DownloadsAccess a submenu for downloading Hashmob archives (yearly full-found corpora) and combined-left lists (per-mode uncracked hashes)

All binaries are in hate_crack/hashcat-utils/bin/.

Rule File Tools (option 81)

Preprocesses hashcat rule files using cleanup-rules.bin and rules_optimize.bin from hashcat-utils, and downloads rule files from Hashmob.net.

  • Clean (1) - removes invalid syntax and duplicate rules using cleanup-rules.bin. Useful after combining rule files or downloading rules from external sources.
  • Optimize (2) - consolidates redundant operations using rules_optimize.bin. Reduces rule file size and improves cracking speed.
  • Clean and optimize (3) - runs both operations in sequence via a temporary file, then writes the final result.
  • Download rules from Hashmob.net (4) - fetches rule files into the configured rulesDirectory.
  • Analyze Hashcat rules (5) - opcode frequency analysis of a rule file, powered by HashcatRosetta.

The three preprocessing operations read from an input file and write to a separate output file (original is never modified).

Download Rules from Hashmob.net (Rule File Tools option 4)

Downloads the latest rule files from Hashmob.net's rule repository. These rules are curated and optimized for password cracking and can be used with the Quick Crack and Loopback Attack modes.

  • Downloads rule sets in parallel using a thread pool (up to 4 concurrent downloads)
  • Skips rules already downloaded locally
  • Reports download summary with success/failure counts
  • Stores rules in the configured rules directory

Analyze Hashcat Rules (Rule File Tools option 5)

Powered by HashcatRosetta (https://github.com/bandrel/HashcatRosetta), this feature analyzes hashcat rule files to provide detailed insights into rule composition and complexity.

  • Prompts for a rule file path
  • Displays frequency analysis of rule opcodes (operations)
  • Helps understand what transformations a rule set performs
  • Useful for rule debugging and optimization

Mask Tools (option 83)

Downloads mask files from Hashmob.net. This is a minimal submenu today — masks have no local file-tooling counterpart to the rule/wordlist cleanup and optimization utilities, only a download capability.

  • Download masks from Hashmob.net (1) - fetches mask files into the hate_crack masks directory.

Download Masks from Hashmob.net (Mask Tools option 1)

Downloads mask files from Hashmob.net's mask repository into the hate_crack masks directory for use with mask-based attacks.

  • Downloads mask sets in parallel using a thread pool (up to 4 concurrent downloads)
  • Skips masks already downloaded locally
  • Reports download summary with success/failure counts
  • Stores masks in the configured masks directory used by the Ad-hoc Mask Attack
  • Supports interactive listing, range selection, and browsing of available mask files

Download Wordlists from Hashmob.net (Wordlist Tools option 9)

Downloads wordlists from Hashmob.net's collection of cracked passwords and commonly used wordlists.

  • Interactive menu for browsing available wordlists
  • Progress tracking for large downloads
  • Stores wordlists in configured wordlist directory

Weakpass Wordlist Menu (Wordlist Tools option 10)

Interactive menu for downloading and managing wordlists from Weakpass.com via BitTorrent.

  • Browse available Weakpass wordlist torrents
  • Download specific wordlists or entire collections
  • Automatic extraction of compressed archives
  • Progress tracking for torrent downloads

Hashmob Downloads (Wordlist Tools option 11)

Access a submenu for downloading large-scale password corpora and specialized wordlists from Hashmob.net.

Archives - Downloads yearly full-found password corpora (multi-GB archives containing all cracked passwords from a given year)

  • Requires confirmation before downloading -- these archives are large (the listing may show "(unknown size)" since Hashmob's API doesn't currently report a file size per archive)
  • Lists all available archives across every year as one globally-numbered list to browse and pick from by index, rather than a per-year picker
  • Accepts a (or all) at the selection prompt to download every listed archive, one at a time. A single confirmation naming the archive count and the summed size covers the whole batch; an archive already on disk at its listed size is skipped, one whose size does not match is re-downloaded, and a failure is counted rather than aborting the rest
  • Stores archives in the configured wordlist directory for extraction and use

Combined Left Lists - Downloads per-hashcat-mode combined lists of uncracked ("left") hashes from Hashmob.net

  • Each list is a set of hashes, not plaintexts, still awaiting a crack for that hashcat mode
  • Useful for spotting overlap between your own hash list and hashes the community hasn't cracked yet
  • Supports mode selection from the listed hash counts per algorithm

Version History

The full, per-release changelog now lives in CHANGELOG.md.

カテゴリ