GRUB 2 Hash

Technical details, regex signatures, and cracking commands for the GRUB 2 algorithm.

Regex Identification Signature:
^grub\.pbkdf2\.sha512\.[0-9]+\.([a-f0-9]{128,2048}\.|[0-9]+\.)?[a-f0-9]{128}$
Hashcat Command (Mode: 7200):
Not supported natively by John the Ripper
← Back to Hash Identifier

What is GRUB 2?

GRUB 2 (Global Randomized Universal Bootloader Hash) is not a standalone cryptographic hash algorithm but rather a legacy password hashing mechanism embedded within the GRUB bootloader (version 2.x) for securing the boot process. Introduced as a lightweight alternative to more robust schemes like bcrypt or PBKDF2, GRUB 2’s hash format stores user passwords in a proprietary binary structure consisting of a 16-byte salt (stored as a raw hexadecimal string in configuration files) followed by a 32-byte hashed output derived from a custom iterative hashing routine. The primary use-case was to authenticate users during the bootloader stage, where performance and minimal memory overhead were prioritized over cryptographic longevity. The format lacks standardized documentation, relying on reverse-engineered implementations, and was designed for embedded systems with constrained resources, making it susceptible to obsolescence and security flaws.

The GRUB 2 hash format is vulnerable to cracking primarily due to its weak iterative design and lack of modern cryptographic safeguards. The hashing process relies on a fixed number of iterations (typically 100–200 rounds of a custom mixing function) without adaptive slowdown mechanisms like bcrypt’s cost factor, enabling modern hardware (CPUs/GPUs) to brute-force passwords at high speeds using optimized tools like Hashcat. Additionally, the absence of a cryptographic salt in the original specification (though later implementations added a trivial salt) means early versions were prone to rainbow table attacks, while the 32-byte output space is too small to resist collision resistance under modern computational power. Furthermore, the proprietary nature of the algorithm discourages formal security analysis, leaving potential side-channel vulnerabilities and implementation flaws unaddressed.

Identifying GRUB 2 Hashes

Identifying a hash blindly is often difficult because multiple algorithms can output strings of the exact same length. For example, a standard 32-character hexadecimal string could be MD5, NTLM, MD4, or LM. To definitively identify GRUB 2, security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack GRUB 2

If you need to recover the plaintext password for a GRUB 2 hash during a penetration test or forensics investigation, you must supply the correct module ID to your cracking software. Use the exact commands provided at the top of this page to target the hash successfully.