MySQL Hash Extraction and Cracking
MySQL stores password hashes in the mysql.user system table. With sufficient privileges to read that table, all account hashes are extractable for offline cracking. mysql_native_password hashes use double SHA1 which cracks quickly with modern hardware. caching_sha2_password hashes use SHA256 which is slower but still crackable. Cracked hashes may be reused across other services on the same host or network — database administrators frequently reuse passwords across MySQL, SSH, and application accounts.
Dump All Password Hashes
root localhost $A$005$Rk3K... app_user % *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 backup localhost *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19
Split Hashes by Type
Separate the hashes into files by format for the correct hashcat mode:
Native password hashes: 2 SHA2 hashes: 1
Crack mysql_native_password Hashes
Mode 300 handles the double SHA1 format used by mysql_native_password:
*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19:password Session..........: hashcat Status...........: Cracked
Crack caching_sha2_password Hashes
Mode 7401 handles the SHA256-based caching_sha2_password format:
Show Cracked Results
Test Cracked Passwords Against Other Services
Database administrator passwords frequently reuse across SSH, web panels, and other services. Test each cracked password against the same host:
References
-
Hashcat — documentationhashcat.net/wiki/doku.php?id=hashcat (opens in new tab)
Mode 300 mysql_native_password and mode 7401 caching_sha2_password reference
-
MySQL — Pluggable Authenticationdev.mysql.com/doc/refman/8.0/en/pluggable-authentication.html (opens in new tab)
Hash format reference for mysql_native_password and caching_sha2_password
Was this helpful?
Your feedback helps improve this page.