M4cCrypt0
cat ~/snippets/*.md

command snippets

// reusable, tested command templates — recon, web exploitation, privesc, pivoting, forensics. Copy, swap the <placeholders>, go.

Threaded Dictionary Hash-Cracker (hashlib)

Minimal threaded dictionary hash-cracker in pure Python — when you want to script it or match an unusual algorithm instead of reaching for hashcat.

python
#!/usr/bin/env python3
import hashlib
from concurrent.futures import ThreadPoolExecutor, as_completed

def matches(word, target, algo):
    h = hashlib.new(algo); h.update(word.encode())
    return h.hexdigest() == target.lower()

def crack(target, wordlist, algo="sha256", workers=8):
    with open(wordlist, encoding="utf-8", errors="ignore") as f:
        words = [w.strip() for w in f if w.strip()]
    with ThreadPoolExecutor(max_workers=workers) as ex:
        futs = {ex.submit(matches, w, target, algo): w for w in words}
        for fut in as_completed(futs):
            if fut.result():
                return futs[fut]
    return None

if __name__ == "__main__":
    print(crack("<target-hash>", "/usr/share/wordlists/rockyou.txt", "md5"))

Hashcat — Wordlist & Mask Attacks

Hashcat essentials: pick the hash mode with -m, run a dictionary attack, or fall back to a mask brute-force.

bash
# -m = hash mode: 0=MD5, 100=SHA1, 1000=NTLM, 1800=sha512crypt (see -h for the list)
# straight dictionary attack (-a 0)
hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/rockyou.txt

# mask / brute-force (-a 3): 8 chars, lowercase letters + 2 digits
hashcat -m 0 -a 3 hash.txt ?l?l?l?l?l?l?d?d

used in: Cheatsheet: tool overview