Created
July 14, 2015 04:22
-
-
Save Jack2/aed65441a3d9c4e94835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@ubuntuvm:~/Secu2015$ cat vuln.c | |
#include <stdio.h> | |
void func(char *str){ | |
char buffer[256]; | |
sprintf(buffer,"%s", str); | |
return; | |
} | |
int main(){ | |
char str[1024]; | |
printf("[INPUT]: "); | |
scanf("%s",str); | |
func(str); | |
} | |
user@ubuntuvm:~/Secu2015$ gcc -o vuln vuln.c | |
user@ubuntuvm:~/Secu2015$ ./vuln | |
[INPUT]: KT | |
user@ubuntuvm:~/Secu2015$ ./vuln | |
[INPUT]: ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD | |
*** stack smashing detected ***: ./vuln terminated | |
Aborted (core dumped) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment