Advertisement
IsraelTorres

demo-vuln.c

Jun 15th, 2011
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. /*
  2.  demo-vuln.c
  3.  Israel Torres hakin9@israeltorres.org
  4.  Mon May 30 15:54:33 PDT 2011
  5.  "from-fuzz-to-sploit"
  6.  demo to:
  7.     1. create a BO vulnerable app (using scanf)
  8.  compile with:
  9.  gcc -m32 demo-vuln.c -o demo-vuln-32
  10.  gcc -m64 demo-vuln.c -o demo-vuln-64
  11.  */
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15.  
  16. void hidden_function(void) {
  17.     printf("This is the \"hidden\" function.\n");
  18. }
  19.  
  20. int main(int argc, char *argv[]){
  21.     char string[2];
  22.     puts("Password: ");
  23.     scanf("%s", string);
  24.     printf("You entered %s.\n", string);
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement