You are currently viewing Recover Your Own WinRAR Password: Hash Extraction and Cracking with Hashcat

Recover Your Own WinRAR Password: Hash Extraction and Cracking with Hashcat

Forgot the password to your own WinRAR archive? If you own the file and have every legal right to access it, you can recover the password using offline hash-based techniques. WinRAR uses AES-256 (RAR5) or AES-128 (RAR3) encryption, both storing a salted hash of the password in the archive header. That hash is your key to recovery. Here's how to extract it and run targeted attacks with hashcat—no network scanning, no third-party data, no unauthorized access.

Understanding WinRAR Encryption

WinRAR uses two distinct encryption schemes depending on the archive version:

  • RAR3 (older .rar files): AES-128 with a proprietary key derivation function. The hash format is known as RAR3-hp or RAR3-p.
  • RAR5 (modern .rar files): AES-256 with PBKDF2-HMAC-SHA256. This is significantly slower to crack because of the iteration count.

Both store a salted hash of the password inside the archive header. That hash is what you extract and feed into a password recovery tool. You never need to guess blindly—you work with the mathematical fingerprint.

Terminal window showing rar2john command output for a test archive

Legal Boundaries: Only Your Own Archives

Before touching any tool, confirm that you own the archive or have explicit written permission from the owner to attempt recovery. Using these techniques on someone else’s files without consent is illegal in most jurisdictions and violates the ethical guidelines of this blog. The methods described here are intended for developers who locked themselves out of their own backups, test data, or lab environments.

Step-by-Step Recovery Process

1. Install Required Tools

You need two main pieces of software:

  • John the Ripper (specifically the rar2john utility) – to extract the hash from the .rar file.
  • hashcat – to perform the actual password cracking on the extracted hash.

Both run on Linux, macOS, and Windows (via WSL or native binaries). Install them from your package manager or download from the official project websites. For this article, we assume a Linux environment.

2. Extract the Hash

Run the following command, replacing protected.rar with your file’s name:

rar2john protected.rar > hash.txt

This outputs a line like:

protected.rar:$rar5$16$... (long hex string)

That string contains the salt, iteration count, and encrypted checksum. It is safe to share? No—never post your hash publicly; it could allow others to recover the password if they know your weak passphrase.

3. Identify the Hash Mode

hashcat uses numeric mode identifiers. For WinRAR:

  • RAR5: mode 13000
  • RAR3 (hp): mode 125
  • RAR3 (p): mode 6270

Check the first characters of your hash line: if it starts with $rar5$, use mode 13000. If $RAR3$, use mode 125 or 6270 depending on whether it’s header-protected or payload-protected.

4. Choose an Attack Method

hashcat offers several attack strategies. The most common for password recovery are:

Dictionary Attack

Use a wordlist like rockyou.txt (available from common security training repositories). Run:

hashcat -m 13000 -a 0 hash.txt /path/to/rockyou.txt

This tries every word in the list against the hash. RAR5 is slow—expect a few hundred to a few thousand hashes per second on a modern CPU. A GPU can push that to tens of thousands.

Mask Attack

If you remember the password pattern (e.g., 8 characters, starts with a capital letter, ends with a digit), use a mask:

hashcat -m 13000 -a 3 hash.txt ?u?l?l?l?l?l?l?d

The mask ?u?l?l?l?l?l?l?d means: uppercase, six lowercase, one digit. This drastically reduces the keyspace compared to brute-force.

Rule-Based Attack

Use rules to mutate dictionary words (e.g., append numbers, substitute letters). hashcat ships with the best64.rule file:

hashcat -m 13000 -a 0 hash.txt rockyou.txt -r /usr/share/hashcat/rules/best64.rule

hashcat terminal output with progress, speed, and recovered hash

Performance Considerations

RAR5’s PBKDF2 iteration count (typically 32768) makes each password attempt computationally expensive. On a single high-end GPU (e.g., RTX 4090), you might achieve ~50,000 hashes per second for RAR5. For a random 8-character alphanumeric password (62^8 ≈ 218 trillion combinations), that would take over 138 years. Realistic recovery is only feasible for weak, dictionary-based, or partially known passwords.

RAR3 is faster—up to several million hashes per second on a GPU—so shorter passwords (up to 7-8 characters) can often be recovered within hours or days.

When You Cannot Recover the Password

If the password is long and random, recovery is computationally infeasible. In that case, your only option is to restore from a backup that does not use encryption, or to accept the data loss. This is a strong argument for keeping a password manager: store your archive passwords in a vault so you never need to crack them.

For developers building lab environments, consider using a simple, documented password (e.g., test123) for archives that you create for practice, and never reuse that password for real data.

Conclusion

If you're setting up a lab environment, use a simple documented password like 'test123' for practice archives—and never reuse it for real data. For production backups, store archive passwords in a password manager; a GPU cluster is expensive, but a password vault is cheap. And if recovery fails, accept the loss and restore from an unencrypted backup—that's the real lesson in backup strategy.