Get a Pentest and security assessment of your IT network.

Cyber Security

Identify Hash Prefix & Type

TL;DR

You have a hash that starts with ‘$y$’. This almost certainly indicates a SHA-512 password hash generated by OpenBSD or FreeBSD. We’ll show you how to confirm this and potentially crack it if needed.

Identifying the Hash Type

  1. Understand the Format: Hashes starting with ‘$y$’ typically follow this structure:
    • $y$round$salt$hash
    • Round: The number of hashing rounds (e.g., 10, 12). Higher numbers are more secure but take longer to crack.
    • Salt: A random string used to make each password hash unique even if the passwords are the same.
    • Hash: The actual SHA-512 hash value.
  2. Confirm with identify (hashcat): Use the hashcat utility to identify the hash type.
    hashcat --help | grep '$y$'

    This command will show you that ‘$y$’ is recognised as OpenBSD/FreeBSD SHA-512.

  3. Example: Let’s say your hash is $y$10$abcdefghijklmnop$somehashvalue.
    • Round = 10
    • Salt = abcdefghijklmnop
    • Hash = somehashvalue

Cracking the Hash (if needed)

If you have permission to attempt cracking, here’s how using hashcat:

ol>

  • Wordlist Attack: The most common approach is a wordlist attack.
    hashcat -m 3200 --wordlist /path/to/your/wordlist.txt '$y$10$abcdefghijklmnop$somehashvalue'

    Replace /path/to/your/wordlist.txt with the actual path to your wordlist file.

  • Rule-Based Attack: Use rules to modify words in the wordlist (e.g., adding numbers, symbols).
    hashcat -m 3200 --wordlist /path/to/your/wordlist.txt --rules /path/to/your/ruleset.rule '$y$10$abcdefghijklmnop$somehashvalue'

    Replace /path/to/your/ruleset.rule with the path to your rules file.

  • Brute-Force Attack (Caution!): Brute-force attacks try all possible combinations of characters and are very slow unless you know part of the password.
    hashcat -m 3200 --attack-mode 0 -a 0 /path/to/your/mask '$y$10$abcdefghijklmnop$somehashvalue'

    Replace /path/to/your/mask with a mask file defining the character set and length.

  • Hybrid Attack: Combine wordlists, rules, and brute-force techniques for better results.
  • Important Considerations

    • Legal Implications: Only attempt to crack hashes you have explicit permission to test. Unauthorized access is illegal.
    • Computational Resources: Cracking passwords requires significant computing power (GPU recommended).
    • Password Strength: The strength of the password and the number of hashing rounds significantly impact cracking time.
    Related posts
    Cyber Security

    Zip Codes & PII: Are They Personal Data?

    Cyber Security

    Zero-Day Vulnerabilities: User Defence Guide

    Cyber Security

    Zero Knowledge Voting with Trusted Server

    Cyber Security

    ZeroNet: 51% Attack Risks & Mitigation