标签:file apple :hover http 构造 set foo let htm
1 fd@ubuntu:~$ cat fd.c 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 char buf[32]; 6 int main(int argc, char* argv[], char* envp[]){ 7 if(argc<2){ 8 printf("pass argv[1] a number\n"); 9 return 0; 10 } 11 int fd = atoi( argv[1] ) - 0x1234; 12 int len = 0; 13 len = read(fd, buf, 32); 14 if(!strcmp("LETMEWIN\n", buf)){ 15 printf("good job :)\n"); 16 system("/bin/cat flag"); 17 exit(0); 18 } 19 printf("learn about Linux file IO\n"); 20 return 0; 21 22 } 23 24 fd@ubuntu:~$
echo "LETMEWIN" | ./fd 4660
如下,flag为:mommy! I think I know what a file descriptor is!!
2017-2-4 22:24;39
标签:file apple :hover http 构造 set foo let htm
原文地址:http://www.cnblogs.com/WangAoBo/p/6366517.html