Skip to content

Instantly share code, notes, and snippets.

@glem0
Last active May 2, 2017 04:33
Show Gist options
  • Save glem0/82e6acd4f04749f4c92a5a03e2d162f1 to your computer and use it in GitHub Desktop.
Save glem0/82e6acd4f04749f4c92a5a03e2d162f1 to your computer and use it in GitHub Desktop.
Pwnable.kr - fd
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char buf[32];
int main(int argc, char* argv[], char* envp[]){
if(argc<2){
printf("pass argv[1] a number\n");
return 0;
}
int fd = atoi( argv[1] ) - 0x1234;
int len = 0;
len = read(fd, buf, 32);
if(!strcmp("LETMEWIN\n", buf)){
printf("good job :)\n");
system("/bin/cat flag");
exit(0);
}
printf("learn about Linux file IO\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment