How trustedsec/hate_crack works
Project type and purpose
• This is a command-line orchestration tool (“hate_crack”) built around the hashcat password-cracking engine.
• It provides multiple “attack modes” (Quick Crack, Pure_Hate methodology, Brute Force, Mask, Combinator, PRINCE, etc.), wraps calls to external binaries (hashcat, PACK utilities, hashcat-utils, princeprocessor), and manages wordlists, masks, and rules.
File structure
• Top-level scripts:
– hate_crack.py ← main CLI entry point
– wordlist_optimizer.py ← helper to preprocess wordlists
– maskgen.py, policygen.py, statsgen.py (in PACK/)
– Additional scripts: hate_crack.py spawns PACK tools, hashcat-utils bins, princeprocessor binaries, pipal analysis, etc.
• Data directories:
– masks/ ← .hcmask files for mask attacks
– rules/ ← .rule files for hashcat rule-based attacks
– hashcat-utils/ ← precompiled utilities invoked by certain modes
– princeprocessor/ ← PRINCE attack engine and rule sets
– config.json.example ← defines paths for hashcat, wordlists, optimized wordlists
• Third-party integrations:
– External executable: hashcat binary (built via git clone & make)
– pipal (optional hash analysis tool)
README for additional insights
• The README outlines each attack mode, the sequence of sub-attacks or rule applications, and data flows (which wordlists/masks/rules get applied).
• It references PACK (statsgen, maskgen) for Top Mask Attack.
• It references hashcat-utils for stats generation.
• It references princeprocessor for PRINCE Attack.
Main components and interactions
a. Core Components
1. CLI Controller (hate_crack.py)
2. Configuration Loader (reads config.json)
3. Attack Modules (one per mode):
• Quick Crack
• Pure_Hate methodology
• Brute Force
• Top Mask (invokes PACK: statsgen.py → maskgen.py)
• Fingerprint (invokes hashcat-utils hcstatgen)
• Combinator/Hybrid/PRINCE (invokes hashcat-utils/combinator, princeprocessor)
• pipal Analysis
4. Wordlist Optimizer (wordlist_optimizer.py)
5. Data Stores:
• Wordlists directory
• Optimized wordlists (output of wordlist_optimizer.py)
• masks/ directory
• rules/ directory
• princeprocessor/rules/
• hashcat binary
• PACK utilities (maskgen, statsgen)
• hashcat-utils binaries
• princeprocessor binaries
• pipal analysis script/tool
c. Data Flow
– User invokes hate_crack.py → loads config.json → presents menu → user selects mode.
– Controller calls Attack Module → Attack Module invokes external binary(ies) with parameters (wordlist file path, rule file path, mask file).
– External tool processes hashes → outputs cracked/password data → Attack Module collects & optionally pipelines through pipal or exports to Excel.
– Results are stored/logged and displayed.
Architectural patterns and design principles
• Modular design: each attack mode encapsulated as a distinct function/class.
• External process orchestration: the core Python code spawns subprocesses for hashcat, PACK, hashcat-utils, and princeprocessor.
• Configuration-driven: all paths and parameters are abstracted via config.json.
• Extensibility: new attack modes can be added by dropping in new scripts or binaries and wiring them into the menu.
• Data separation: static resources (masks, rules, wordlists) live in dedicated folders.
Essential details to capture
• Which directories/files back each module (e.g., “masks/*.hcmask”).