ABaDy1996

[C:Source]: Buffer Overflow Challenge

Oct 9th, 2018
345
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <stdlib.h>
  4.  
  5. // BlackFox's-Team (c)
  6. // Twitter and Telegram: @BlackfoxsOrg
  7. // By ABaDy ( Twitter: @yxs )
  8.  
  9. char *userroot = "root";
  10. char *passroot = "no password in source ;)";
  11. void welcome()
  12. {
  13.     printf("\n\nWelcome engineer!\n");
  14.     printf("You have logged in successfully!\n");
  15.     printf("Take your flag : no falg in Source ;)\n");
  16. }
  17.  
  18. void start()
  19. {
  20.     char username[30];
  21.     char password[30];
  22.     printf("login As : ");
  23.     scanf("%s", username);
  24.     if(strcmp(userroot,username)==0)
  25.     {
  26.         printf("%s@labs.blackfoxs.org's password: ",username);
  27.         scanf("%s", password);
  28.         if(strcmp(password,passroot)==0){
  29.             welcome();
  30.         }else{
  31.             printf("access denied!, password not match\n");  
  32.         }
  33.     }else{
  34.         printf("access denied!, user not found\n");  
  35.     }
  36. }
  37. void blackfoxs(){
  38.     printf("\nWelcome to BlackFox's-Labs (c)\n");
  39.     printf("Twitter and Telegram: @BlackfoxsOrg\n\n");
  40. }
  41. int main()
  42. {
  43.     setvbuf(stdout, NULL, _IONBF, 0);
  44.     blackfoxs();
  45.     start();
  46.     return 0;
  47. }
RAW Paste Data