Skip to content

Instantly share code, notes, and snippets.

@saru2017
Created June 16, 2019 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saru2017/6688fcc43ed80c95a88797579d8a08b5 to your computer and use it in GitHub Desktop.
Save saru2017/6688fcc43ed80c95a88797579d8a08b5 to your computer and use it in GitHub Desktop.
CTF: pwn03
#include <stdio.h>
#include <stdlib.h>
int main()
{
char pass[32];
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stdin, NULL, _IONBF, 0);
puts("Welcome to Pwn03!!!");
puts("We removed /bin/sh");
puts("for security reason.");
puts("password? ");
gets(pass);
if(strcmp(pass, "watalab") == 0){
puts("login success!!!");
system("/usr/bin/uptime");
}else{
puts("login failed\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment