Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(){
- char password[16];
- int passcheck = 0;
- printf("\nWhat's the password ?\n");
- gets(password);
- if(strcmp(password, "password1"))
- {
- printf("\nAccess Denied\n");
- }else
- {
- printf("\nAccess Granted !\n");
- passcheck = 1; //change pass val
- }
- if(passcheck)
- {
- //do priv stuff here, read a protected file
- system("cat /etc/shadow");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement