본문 바로가기

728x90

toddler's bottle

[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] 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] 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 .. 더보기
[pwnable.kr Toddler's Bottle] shellshock write up shellshock에는 다음과 같은 파일들이 존재한다. shellshock@prowl:~$ ls -l total 960 -r-xr-xr-x 1 root shellshock 959120 Oct 12 2014 bash -r--r----- 1 root shellshock_pwn 47 Oct 12 2014 flag -r-xr-sr-x 1 root shellshock_pwn 8547 Oct 12 2014 shellshock -r--r--r-- 1 root root 188 Oct 12 2014 shellshock.c bash라는 파일이 실제 쉘을 실행시키는지 확인하기 위해 실행시켜봤다. shellshock@prowl:~$ ./bash shellshock@prowl:~$ ps error: can not access .. 더보기
[pwnable.kr Toddler's Bottle] mistake write up 오늘은 mistake문제를 풀어보았다. mistake@prowl:~$ ls -l total 24 -r-------- 1 mistake_pwn root 51 Jul 29 2014 flag -r-sr-x--- 1 mistake_pwn mistake 8934 Aug 1 2014 mistake -rw-r--r-- 1 root root 792 Aug 1 2014 mistake.c -r-------- 1 mistake_pwn root 10 Jul 29 2014 password 소스코드, 취약 파일, flag 외에 password라는 하나의 파일이 더 존재한다. 일단 mistake.c 소스코드부터 보도록 하자. #include #include #define PW_LEN 10 #define XORKEY 1 void x.. 더보기

728x90