hacking
-
[LOB] skeletonhacking 2021. 9. 4. 18:32
/* The Lord of the BOF : The Fellowship of the BOF - golem - stack destroyer*/#include #include extern char **environ;main(int argc, char *argv[]){ char buffer[40]; int i; if(argc buffer와 ret를 제외한 buffuer이후 memory들을 초기화 한다고로 buffer 이전 메모리 공간 밖에 활용을 하지 못한다 전혀 감을 못잡다가 LD_PRELOAD라는 키워드를 듣고 시작할 수 있었다 LD_PRELOAD is an optional environmental variable containing one or more paths t..
-
[LOB] vampirehacking 2021. 9. 3. 21:00
/* The Lord of the BOF : The Fellowship of the BOF - skeleton - argv hunter*/#include #include extern char **environ;main(int argc, char *argv[]){ char buffer[40]; int i, saved_argc; if(argc 48){ printf("argument is too long!\n"); exit(0); } // argc saver saved_argc = argc; strcpy(buffer, argv[1]); printf("%s\n", buffer); // buffer hunter memset(buffer, 0, ..
-
[FTZ] level 2hacking 2021. 9. 1. 22:40
[level2@ftz level2]$ cat hint 텍스트 파일 편집 중 쉘의 명령을 실행시킬 수 있다는데... 이전 문제와 같이level 3의 권한을 가진 프로그램을 찾아본다 find / -perm -4000 -name level 3 그럼 /usr/bin/editor 가 나온다이를 실행시키면 vim 에디터가 나온다 vim 에디터는 여러 가지 모드가 있다그 중 명령 모드를 이용하여 shell을 띄워보자 :!/bin/sh /usr/bin/editor 가 가진 권한으로 쉘을 실행시켰다고로 level 3의 권한을 가진 쉘을 실행시키게 된 것이다 Level3 Password is "can you fly?".[level3@ftz level2]$ iduid=3003(level3) gid=3002(level2) g..
-
[LOB] trollhacking 2021. 8. 31. 17:49
/* The Lord of the BOF : The Fellowship of the BOF - vampire - check 0xbfff*/#include #include main(int argc, char *argv[]){ char buffer[40]; if(argc argv 길이 check와 환경변수 초기화 등이 사라지고main ret의 주소 제약 조건이 생겼다 stack은 높은주소 -> 낮은주소로 자라난다이를 활용해보자 fun(1, 2, 3) 이 있다면요런식으로 스택이 쌓인다 함수의 인자의 길이, 개수를 늘릴 수록점점 낮은 주소로 이동시킬 수 있는 것이다 shellcode는 argv[2]에 넣으면 되고 주소값을 알아내는 방법은 이전 문제와 같다 [t..
-
[LOB] orgehacking 2021. 8. 30. 20:08
/* The Lord of the BOF : The Fellowship of the BOF - troll - check argc + argv hunter*/#include #include extern char **environ;main(int argc, char *argv[]){ char buffer[40]; int i; // here is changed if(argc != 2){ printf("argc must be two!\n"); exit(0); } // egghunter for(i=0; environ[i]; i++) memset(environ[i], 0, strlen(environ[i])); if(argv[1][47] != '\xbf') { print..
-
[LOB] darkelfhacking 2021. 8. 29. 18:58
/* The Lord of the BOF : The Fellowship of the BOF - orge - check argv[0]*/#include #include extern char **environ;main(int argc, char *argv[]){ char buffer[40]; int i; if(argc 48){ printf("argument is too long!\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); // buffer hunter memset(buffer, 0, 40);} 환경변수 xret stack segmentargv[1]길이 48이하buff..
-
[LOB] wolfmanhacking 2021. 8. 29. 18:20
/* The Lord of the BOF : The Fellowship of the BOF - darkelf - egghunter + buffer hunter + check length of argv[1]*/#include #include extern char **environ;main(int argc, char *argv[]){ char buffer[40]; int i; if(argc 48){ printf("argument is too long!\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); // buffer hunter memset(buffer, 0, 40);}..