SHARE
TWEET

Untitled

a guest Feb 16th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void login(){
  5.     int passcode1;
  6.     int passcode2;
  7.  
  8.     printf("enter passcode1 : ");
  9.     scanf("%d", passcode1);
  10.     fflush(stdin);
  11.  
  12.     // ha! mommy told me that 32bit is vulnerable to bruteforcing :)
  13.     printf("enter passcode2 : ");
  14.     scanf("%d", passcode2);
  15.  
  16.     printf("checking...\n");
  17.     if (passcode1 == 338150 && passcode2 == 13371337) {
  18.         printf("Login OK!\n");
  19.         system("/bin/cat flag");
  20.     } else {
  21.         printf("Login Failed!\n");
  22.         exit(0);
  23.     }
  24. }
  25.  
  26. void welcome(){
  27.     char name[100]; printf("enter you name : ");
  28.     scanf("%100s", name);
  29.     printf("Welcome %s!\n", name);
  30. }
  31.  
  32. int main(){
  33.     printf("Toddler's Secure Login System 1.0 beta.\n");
  34.  
  35.     welcome();
  36.     login();
  37.  
  38.     // something after login...
  39.     printf("Now I can safely trust you that you have credential :)\n");
  40.     return 0;  
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top