Guest User

Untitled

a guest
Jan 8th, 2017
629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1.  
  2. //gcc source.c -m32 -o binary -fno-stack-protector
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <unistd.h>
  7.  
  8. void print_flag(long a) {
  9.     if (a == 1701064803){
  10.         system("cat flag.txt");
  11.     }
  12.     else {
  13.         fprintf(stdout, "You can't!!\nTry somewhere else.");
  14.         fflush(stdout);
  15.     }
  16.     exit(0);
  17. }
  18.  
  19. int main() {
  20.     long a;
  21.     char buf[64];
  22.     fprintf(stdout, "Can you pwn us, n00b?\n");
  23.     sleep(1);
  24.     fprintf(stdout, "Enter your name : ");
  25.     fflush(stdout);
  26.     scanf("%s", buf);
  27.     sleep(1);
  28.     print_flag(a);
  29.     exit(0);
  30. }
Add Comment
Please, Sign In to add comment