MySQL Challenge-Response Authentication (SHA1) Hash

Technical details, regex signatures, and cracking commands for the MySQL Challenge-Response Authentication (SHA1) algorithm.

Regex Identification Signature:
^\$mysqlna\$[a-f0-9]{40}[:*][a-f0-9]{40}$
Hashcat Command (Mode: 11200):
Not supported natively by John the Ripper
← Back to Hash Identifier

What is MySQL Challenge-Response Authentication (SHA1)?

The MySQL Challenge-Response Authentication (SHA1) mechanism, introduced in early MySQL versions as a security enhancement over plaintext passwords, was designed to mitigate eavesdropping by preventing transmission of raw credentials over unencrypted channels. Structurally, it operates as a hybrid of a cryptographic hash function and a challenge-response protocol, where the server generates a random "challenge" (a 16-byte value) sent to the client. The client concatenates this challenge with the user’s hashed password (stored as a 20-byte SHA1 hash in the `mysql.user` table) and computes a 20-byte SHA1 hash of the result. This response is then returned to the server for verification. The primary use-case was to enable secure authentication over insecure networks by ensuring only the server and client with the correct password could produce the expected response, though it remained vulnerable to offline attacks due to its reliance on precomputed password hashes.

The vulnerability of MySQL’s SHA1 challenge-response stems from fundamental cryptographic flaws exacerbated by implementation choices. The absence of a cryptographic salt in the password storage renders it susceptible to rainbow table attacks, as identical passwords yield identical hashes. Additionally, SHA1’s collision resistance is now considered inadequate for security purposes, with practical attacks demonstrating preimage and second-preimage vulnerabilities. Modern hardware optimizations—such as GPU-accelerated brute-force tools (e.g., Hashcat) and parallelized rainbow table generation—enable attackers to crack SHA1 hashes at rates exceeding 100,000 hashes per second. The protocol’s reliance on a fixed-length challenge also allows for offline dictionary attacks, where attackers can iteratively test hashed password candidates against stored hashes without server interaction, further compromising its resilience.

Identifying MySQL Challenge-Response Authentication (SHA1) 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 MySQL Challenge-Response Authentication (SHA1), security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack MySQL Challenge-Response Authentication (SHA1)

If you need to recover the plaintext password for a MySQL Challenge-Response Authentication (SHA1) 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.