From main function we know that there are some function called, lets take a look on login_user (because other function are originated from library).
int login_user()
{
char v1[48]; // [rsp+0h] [rbp-40h] BYREF
int v2; // [rsp+30h] [rbp-10h]
puts("== Welcome to the TurboLike v1.0 login portal ==");
puts("Tell me your name and I will tell you your uid!");
puts("Just don't tell me your name is admin, that would be too easy ;)");
printf("Name: ");
v2 = rand();
gets(v1);
printf("Hello, %s your uid is %d!\n", v1, v2);
if ( v2 != 1337 )
return puts("You are not admin!");
puts("Welcome back admin! Tell me your secret and I will store it for you!");
return store_secret();
}
In login_user function we can see that there is vulnerable function which is gets. In this case we can overflow the v1 variable and control the execution flow. Because the objective is gaining remote code execution, so the flow is leak the libc address then popping shell using system function. Below is the script to solve the challenge