Advertisement
Krypton404

cok

Nov 18th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5. int main(){
  6. char password[16];
  7. int passcheck = 0;
  8.  
  9. printf("\nWhat's the password ?\n");
  10. gets(password);
  11.  
  12. if(strcmp(password, "password1"))
  13. {
  14. printf("\nAccess Denied\n");
  15. }else
  16. {
  17. printf("\nAccess Granted !\n");
  18. passcheck = 1; //change pass val
  19. }
  20.  
  21. if(passcheck)
  22. {
  23. //do priv stuff here, read a protected file
  24. system("cat /etc/shadow");
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement