본문 바로가기

728x90

pwnable/pwnable.kr

[pwnable.kr Toddler's Bottle] horcruxes write up pwnable.kr에 있는 toddler's bottle의 마지막 문제 horcruxes입니다! ROP를 사용하라고 나와있습니다. ROP는 공부할때 봤던 사이트들을 링크 걸어두겠습니다. ...더보기 https://www.lazenca.net/pages/viewpage.action?pageId=16810141 https://shayete.tistory.com/entry/6-Return-Oriented-Programming 들어가보면 두개의 파일밖에 존재하지 않습니다. horcruxes@prowl:~$ ls -l total 20 -rwxr-xr-x 1 root root 12424 Aug 8 2018 horcruxes -rw-r--r-- 1 root root 131 Aug 8 2018 readme horcru.. 더보기
[pwnable.kr Toddler's Bottle] blukat write up 어렵다면 숙련자라니.. 숙련자가 아니지만 뭔가 어려울 것 같은 느낌이 드는 문구입니다.. 3개의 파일이 있었습니다. blukat@prowl:~$ ls -l total 20 -r-xr-sr-x 1 root blukat_pwn 9144 Aug 8 2018 blukat -rw-r--r-- 1 root root 645 Aug 8 2018 blukat.c -rw-r----- 1 root blukat_pwn 33 Jan 6 2017 password 코드는 다음과 같습니다. #include #include #include #include char flag[100]; char password[100]; char* key = "3\rG[S/%\x1c\x1d#0?\rIS\x0f\x1c\x1d\x18;,4\x1b\x00\x.. 더보기
[pwnable.kr Toddler's Bottle] unlink write up unlink corruption을 exploit 하라고 되어있습니다! unlink@prowl:~$ ls -l total 20 -r--r----- 1 root unlink_pwn 49 Nov 23 2016 flag -rw-r----- 1 root unlink_pwn 543 Nov 28 2016 intended_solution.txt -r-xr-sr-x 1 root unlink_pwn 7540 Nov 23 2016 unlink -rw-r--r-- 1 root root 749 Nov 23 2016 unlink.c 바로 소스코드부터 봐야 알 것 같습니다. #include #include #include typedef struct tagOBJ{ struct tagOBJ* fd; struct tagOBJ* bk; .. 더보기
[pwnable.kr Toddler's Bottle] asm write up asm을 풀어보겠습니다! shellcode를 작성하라고 되어있네요..! 일단 접속을 해봅니다! readme를 읽어보니 원격 접속으로 문제를 풀도록 되어있습니다. 플래그 파일은 되게 길어보이네요..! 소스코드는 다음과 같습니다. #include #include #include #include #include #include #include #include #define LENGTH 128 void sandbox(){ scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_KILL); if (ctx == NULL) { printf("seccomp error\n"); exit(0); } seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0).. 더보기
[pwnable.kr Toddler's Bottle] memcpy write up 해킹에 지친 우리를 위해 실험을 도와주면 flag를 준다고 했습니다... 믿지 않습니다.. 주어진 링크로 소스코드를 확인해보면 다음과 같은 소스코드가 준비되어있습니다. // compiled with : gcc -o memcpy memcpy.c -m32 -lm #include #include #include #include #include #include #include unsigned long long rdtsc(){ asm("rdtsc"); } char* slow_memcpy(char* dest, const char* src, size_t len){ int i; for (i=0; i= 64){ i = len / 64; len &= (64-1); while(i-- > 0){ __asm__ __volati.. 더보기
[pwnable.kr Toddler's Bottle] uaf write up Use After Free bug라서 uaf인가 보다. 들어가 보니 저한테는 끔찍한 일이 있었습니다. uaf@prowl:~$ ls -l total 24 -rw-r----- 1 root uaf_pwn 22 Sep 26 2015 flag -r-xr-sr-x 1 root uaf_pwn 15463 Sep 26 2015 uaf -rw-r--r-- 1 root root 1431 Sep 26 2015 uaf.cpp 저는 cpp을 잘 볼 줄 모릅니다.. hackctf도 g++로 풀어야 하는 거 건너뛰고 풀고 있었는데..! 그래도 일단 떨리는 손으로 침착하게 코드를 확인해봤습니다. #include #include #include #include #include using namespace std; class Human{.. 더보기
[pwnable.kr Toddler's Bottle] blackjack write up blackjack을 풀려고 보니 nc로 접속해서 해결하도록 되어있었습니다. 쓰여있는 주소로 일단 가서 소스코드부터 확인했습니다. 소스를 보고 취약점을 발견했습니다. 발견한 취약한 로직은 다음과 같습니다. int betting() //Asks user amount to bet { printf("\n\nEnter Bet: $"); scanf("%d", &bet); if (bet > cash) //If player tries to bet more money than player has { printf("\nYou cannot bet more money than you have."); printf("\nEnter Bet: "); scanf("%d", &bet); return bet; } else return b.. 더보기
[pwnable.kr Toddler's Bottle] coin1 write up 이번에는 nc로 접속해서 원격으로 풀어야 한다. 접속해보니 다음과 같은 내용들을 확인할 수 있다. root@root:~$ nc pwnable.kr 9007 --------------------------------------------------- - Shall we play a game? - --------------------------------------------------- You have given some gold coins in your hand however, there is one counterfeit coin among them counterfeit coin looks exactly same as real coin however, its weight is different from .. 더보기

728x90