Last active
October 24, 2019 08:51
-
-
Save 7marcus9/69ee56f94d825f223779587234719bba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void hello() | |
{ | |
char name[?]; | |
//__x86.get_pc_thunk.bx | |
puts("What's your name?"); | |
fgets(&name, 0x20, stdin); | |
if(strchr(name, '%') && strchr(name, 'n')) exit(1); | |
printf("Hello "); | |
printf(name); | |
} | |
void login() | |
{ | |
char password[?]; | |
char passRand[?]; | |
puts("Please enter the password"); | |
fgets(&password, 0x40, stdin); | |
int fp = open("/dev/urandom", O_RDONLY); | |
if(fp == -1) exit(1); | |
read(fp, passRand, 0x10); | |
close(fp); | |
if(memcmp(password, passRand, 0x10)) | |
{ | |
puts("Shell for you :)"); | |
system("false && /bin/sh"); | |
}else{ | |
puts("Sorry, wrong password"); | |
} | |
} | |
int main() | |
{ | |
setbuf(0, ?); | |
setbuf(0, ?); | |
hello(); | |
login(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment