This repository contains the vulnerable binary used in the Simplyfing Format String Exploits with libformatstr tutorial found at http://blog.techorganic.com/simplifying-format-string-exploitation-with-libformatstr/
-
-
Save superkojiman/6c113a9ff991d9f3b7da to your computer and use it in GitHub Desktop.
Vulnerable binary and source code for Simplifying Format String Exploits with libformatstr tutorial.
This file contains 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
/* compile: gcc -Wno-format-security ex1.c -o ex1 */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
void win() { | |
system("/bin/sh"); | |
} | |
void main(int argc, char *argv[]) { | |
char buf[103]; | |
fgets(buf, 103, stdin); | |
buf[strlen(buf)-1] = 0x0; | |
printf(buf); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment