-
-
Save glem0/82e6acd4f04749f4c92a5a03e2d162f1 to your computer and use it in GitHub Desktop.
Pwnable.kr - fd
This file contains hidden or 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
#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