#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;


Hint 

0x1234 16진수 ==>> 4660 10진수

이고,buf가 LETMEWIN 와같을때,

'IT > Pwnable.kr' 카테고리의 다른 글

pwnable.kr / bof  (0) 2016.07.17
pwnable.kr / col  (0) 2016.04.09

+ Recent posts