Advertisement
Guest User

Security programming challenge

a guest
Nov 10th, 2013
3,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. /* Adam Shore - 10/11/13
  2.  * Challenge: Create a wrapper for this program which exploits the poor coding to reveal hidden!
  3.  * (catching the library call is cheating!)
  4.  */
  5.  
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9.  
  10. int main(int argc, char *argv[]){
  11.  
  12.         char hidden[] = "Tell me and I forget, teach me and I may remember, involve me and I learn.";
  13.  
  14.         if (argc != 2) {
  15.                 printf("RTFC\n");
  16.                 return;
  17.         }
  18.  
  19.         if (!strncmp(hidden, argv[1], strlen(hidden))){
  20.                 printf("made it.\n"); // <3 Olivia wilde
  21.                 return 0;
  22.         }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement