[Assignment-6] setup task 6 (basic buffer overflow attack)

This commit is contained in:
Sascha Tommasone 2024-06-14 15:46:39 +02:00
parent cb3a96510a
commit 44e88d1d2b
Signed by: saschato
GPG key ID: 751068A86FCAA217
4 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// vulnerable function
int overflow_me(char* input)
{
char buff[100];
printf("Buffer is at %p\n", &buff); // buff's address is leaked :O
strcpy(buff, input);
return 1;
}
int main(int argc, char *argv[])
{
if(argc < 2)
{
printf("Syntax: %s <input string>\n", argv[0]);
exit (0);
}
overflow_me(argv[1]);
return 0;
}

View file

@ -0,0 +1 @@
flag{THAT_WAS_EASY_HUH}