본문 바로가기

wargame/pwnable.kr11

[포너블] pwnable.kr 7 - input pwnable.kr 7 - input 플래그를 얻기위해 5개의 stage를 통과해야한다 input2@pwnable:~$ ls flag input input.c input2@pwnable:~$ cat input.c #include #include #include #include #include int main(int argc, char* argv[], char* envp[]){ printf("Welcome to pwnable.kr\n"); printf("Let's see if you know how to give input to program\n"); printf("Just give me correct inputs then you will get the flag :)\n"); // argv if(argc .. 2022. 2. 8.
[포너블] pwnable.kr 6 - random pwnable.kr 6 - random random 함수를 사용하는 문제로 예상된다. 한번 코드를 살펴보자 random@pwnable:~$ cat random.c #include int main(){ unsigned int random; random = rand(); // random value! unsigned int key=0; scanf("%d", &key); if( (key ^ random) == 0xdeadbeef ){ printf("Good!\n"); system("/bin/cat flag"); return 0; } printf("Wrong, maybe you should try 2^32 cases.\n"); return 0; } key 값을 받아서 random 값과 xor 연산을 한다. 그 .. 2022. 2. 7.
[포너블] pwnable.kr 5 - passcode pwnable.kr 5 - passcode passcode write up 입니다. passcode@pwnable:~$ cat passcode.c #include #include void login(){ int passcode1; int passcode2; printf("enter passcode1 : "); scanf("%d", passcode1); fflush(stdin); // ha! mommy told me that 32bit is vulnerable to bruteforcing :) printf("enter passcode2 : "); scanf("%d", passcode2); printf("checking...\n"); if(passcode1==338150 && passcode2==133713.. 2022. 2. 7.
[포너블] pwnable.kr 4 - flag pwnable.kr 4 - flag 플래그를 확인하는 건 단순한데 바이너리가 패킹되어있어서 언패킹하는 작업이 필요했다. 바이너리를 언패킹하는건 처음해봐서 검색해서 알아냈음. yeob@ubuntu:~/Desktop/pwnble/pwnable.kr$ ./flag2 I will malloc() and strcpy the flag there. take it. 실행하면 이런 문구가 출력된다. 메인을 디버깅해보면 무슨뜻인지 바로 알아차릴 수 있다. malloc을 호출한 뒤에 flag를 복사할것이니 flag를 알아내라는 것이다. pwndbg> disass main Dump of assembler code for function main: 0x0000000000401164 : push rbp 0x000000000040.. 2022. 2. 7.