Skip to content

Instantly share code, notes, and snippets.

@saru2017
Created June 16, 2019 14:00
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/73eb2afd740b0282ff76938068939aa8 to your computer and use it in GitHub Desktop.
Save saru2017/73eb2afd740b0282ff76938068939aa8 to your computer and use it in GitHub Desktop.
CTF: pwn01
#include <stdio.h>
#include <stdlib.h>
int main()
{
char pass[32];
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stdin, NULL, _IONBF, 0);
puts("Welcome to Pwn01!!!");
puts("password? ");
gets(pass);
if(strcmp(pass, "watalab") == 0){
puts("login success!!!");
system("/bin/sh");
}else{
puts("login failed\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment