Skip to content

Nazi404/Hashcaust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” HashCaust

Rust Lua License

⚑ A fast, modular hash cracking tool written in Rust πŸ¦€ with a Lua πŸŒ™ rule engine


πŸš€ Features

  • πŸ”“ Supports multiple hash algorithms
  • ⚑ Wordlist-based attack mode
  • πŸ’₯ Mask-based brute-force attack
  • 🧠 Lua-powered rule engine (built-in + custom)
  • 🎨 Colored CLI output
  • πŸ–₯️ Clean CLI (Clap powered)
  • πŸ”§ Modular and extensible architecture

βš™οΈ Installation

1️⃣ Install Rust

If Rust is not installed:

curl https://sh.rustup.rs -sSf | sh

Reload shell:

source $HOME/.cargo/env

Verify installation:

rustc --version
cargo --version

2️⃣ Clone Repository

git clone https://github.com/Nazi404/Hashcaust.git
cd Hashcaust

3️⃣ Build Project

cargo build --release

πŸ‘‰ Binary location:

target/release/hashcaust

▢️ Usage


πŸ”Ή Run with Cargo (Development)

cargo run -- <hash> -t <type> -m <mode> [options]

πŸ”Ή Run with Binary

./target/release/hashcaust <hash> -t <type> -m <mode> [options]

🌍 Global Installation (Run from Anywhere)

βœ… Option 1: Install to system PATH (recommended)

cp target/release/hashcaust /usr/local/bin/hashcaust

Now you can run:

hashcaust <hash> -t <type> -m <mode>

βœ… Option 2: Install in user directory (no root)

mkdir -p ~/.local/bin
cp target/release/hashcaust ~/.local/bin/

Add to PATH:

echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Now run globally:

hashcaust <hash> -t <type> -m <mode>

🧠 Attack Modes

πŸ“‚ Wordlist Mode

hashcaust <hash> -t <type> -m wordlist -w <wordlist>

Example:

hashcaust 5e884898da28047151d0e56f8dc6292773603d0d \
-t sha1 \
-m wordlist \
-w rockyou.txt

πŸ’₯ Brute-force Mode (Mask Attack)

hashcaust <hash> -t <type> -m brute -i <mask>

Example:

hashcaust <hash> -t md5 -m brute -i ?l?l?d?d

🎯 Mask Syntax

Pattern Description Characters
?l Lowercase letters a-z
?u Uppercase letters A-Z
?d Digits 0-9
?s Symbols !@#$%^&*...
?a All printable ASCII Full range

πŸ’‘ Any character that is not a ? token is treated as a literal β€” only that exact character is placed at that position.

πŸ”’ Mask Examples

Mask What it generates
?l?l?l?l All 4-letter lowercase combos
?d?d?d?d All 4-digit PINs (0000–9999)
Pass?d?d Pass00 β†’ Pass99
?u?l?l?l?d Capital + 3 lowercase + digit
?a?a?a All 3-char printable ASCII

πŸ“¦ Supported Hash Types

πŸ”“ Fast Hashes (Direct Compare)

  • MD Family

    • md4
    • md5
    • ntlm (MD4 over UTF-16LE)
  • SHA Family

    • sha1
    • sha224
    • sha256
    • sha384
    • sha512
  • SHA-3 Family

    • sha3_224
    • sha3_256
    • sha3_384
    • sha3_512
  • BLAKE Family

    • blake2b
    • blake2s
    • blake3

🐒 Slow Hashes (Salted / Verify Required)

  • argon2 β€” PHC string format ($argon2id$v=19$...)
  • bcrypt β€” standard bcrypt format ($2b$12$...)

πŸŒ™ Rule Engine

HashCaust includes a Lua-powered rule engine that transforms each candidate before hashing it. This lets you crack more hashes from a single wordlist without duplicating files.

Rules are defined in src/rules/rules.lua and loaded at runtime.

▢️ Using a Rule

Add -r <rule_name> to any command:

hashcaust <hash> -t <type> -m <mode> [attack options] -r <rule>

Examples:

# Apply leet substitution to every word in rockyou
hashcaust <hash> -t sha256 -m wordlist -w rockyou.txt -r leet

# Capitalize every brute-force candidate before hashing
hashcaust <hash> -t md5 -m brute -i ?l?l?l?l?l -r capitalize

# Reverse every wordlist entry
hashcaust <hash> -t ntlm -m wordlist -w wordlist.txt -r reverse

πŸ› οΈ Built-in Rules

Rule Description Example Input Example Output
capitalize First letter upper, rest lower hELLO Hello
uppercase All letters uppercase hello HELLO
lowercase All letters lowercase HELLO hello
reverse Reverse the string hello olleh
togglecase Swap case of every character Hello hELLO
leet Convert letters to leet substitutes password p455w0rd

Leet Table Reference:

Letter Leet Letter Leet
a / A 4 s / S 5
e / E 3 t / T 7
i / I 1 g / G 6
o / O 0 b / B 8
z / Z 2

✍️ Custom Rules

You can write your own rules in Lua and add them to src/rules/rules.lua.

Syntax:

function your_rule_name(str)
    -- transform str
    return result
end

⚠️ The function name is case-sensitive and must exactly match what you pass to -r.


πŸ“ Custom Rule Examples

Append 123 to every candidate:

function append123(str)
    return str .. "123"
end

Double the string:

function double(str)
    return str .. str
end

Replace spaces with underscores:

function nospace(str)
    return str:gsub(" ", "_")
end

Add ! at the end (common password pattern):

function exclaim(str)
    return str .. "!"
end

Strip leading/trailing whitespace:

function trim(str)
    return str:match("^%s*(.-)%s*$")
end

▢️ Using Your Custom Rule

After adding the function to src/rules/rules.lua:

hashcaust <hash> -t md5 -m wordlist -w wordlist.txt -r append123
hashcaust <hash> -t sha1 -m brute -i ?l?l?l?l -r double
hashcaust <hash> -t sha256 -m wordlist -w rockyou.txt -r exclaim

πŸ§ͺ Full Examples

# MD5 β€” wordlist
hashcaust 5f4dcc3b5aa765d61d8327deb882cf99 -t md5 -m wordlist -w rockyou.txt

# SHA-1 β€” wordlist with leet rule
hashcaust 5e884898da28047151d0e56f8dc6292773603d0d -t sha1 -m wordlist -w rockyou.txt -r leet

# SHA-256 β€” brute force, 4 lowercase chars
hashcaust <hash> -t sha256 -m brute -i "?l?l?l?l"

# NTLM β€” wordlist with capitalize rule
hashcaust <hash> -t ntlm -m wordlist -w wordlist.txt -r capitalize

# bcrypt β€” wordlist
hashcaust '$2b$12$...' -t bcrypt -m wordlist -w passwords.txt

# Argon2 β€” wordlist (PHC format hash)
hashcaust '$argon2id$v=19$m=65536...' -t argon2 -m wordlist -w wordlist.txt

# Brute with literal prefix
hashcaust <hash> -t sha512 -m brute -i "admin?d?d?d"

πŸ“ Project Structure

Hashcaust/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs              # CLI parsing and dispatch
β”‚   β”œβ”€β”€ attack/
β”‚   β”‚   β”œβ”€β”€ mod.rs           # Module exports
β”‚   β”‚   β”œβ”€β”€ wordlist.rs      # Wordlist attack engine
β”‚   β”‚   └── brute.rs         # Brute-force + mask parser
β”‚   β”œβ”€β”€ hash/
β”‚   β”‚   β”œβ”€β”€ mod.rs           # Module exports
β”‚   β”‚   β”œβ”€β”€ md5.rs
β”‚   β”‚   β”œβ”€β”€ sha256.rs
β”‚   β”‚   └── ...              # One file per algorithm
β”‚   └── rules/
β”‚       β”œβ”€β”€ rules.lua        # ← All rules live here (built-in + custom)
β”‚       β”œβ”€β”€ capitalize.lua
β”‚       β”œβ”€β”€ leet.lua
β”‚       β”œβ”€β”€ lowercase.lua
β”‚       β”œβ”€β”€ reverse.lua
β”‚       β”œβ”€β”€ togglecase.lua
β”‚       └── uppercase.lua
β”œβ”€β”€ Cargo.toml
└── README.md

⚠️ Important Notes

  • ⚑ Fast hashes β†’ direct byte comparison
  • 🐒 Slow hashes (argon2, bcrypt) β†’ use built-in verification β€” significantly slower
  • πŸ’€ Brute-force search space grows exponentially with mask length
  • πŸŒ™ Rules are applied before hashing β€” one rule per run

⚠️ Disclaimer

For educational & security research purposes only. Do NOT use for illegal activities ❌ The author is not responsible for any misuse of this tool.


πŸ‘¨β€πŸ’» Author

William Steven β€” GitHub @Nazi404

"Built for those who understand what's under the hood."


πŸ“œ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) β€” see the LICENSE file for details.


⭐ Support

If you like this project, give it a ⭐ on GitHub!

About

⚑ A fast, modular hash cracking tool written in Rust πŸ¦€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors