문제 Hey! check out this C implementation of blackjack game! I found it online http://cboard.cprogramming.com/c-programming/114023-simple-blackjack-program.html I like to give my flags to millionares. how much money you got? Running at : nc pwnable.kr 9009 풀이 문제에 제시된 링크에서 사용된 C 소스코드를 볼 수 있습니다. 너무 길어서 전체 소스코드는 첨부하지 않았습니다. 우리가 주목해야 할 코드는 다음과 같습니다. int betting() //Asks user amount to bet { printf("\n..
문제 Mommy, I wanna play a game! (if your network response time is too slow, try nc 0 9007 inside pwnable.kr server) Running at : 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 e..
문제 Mommy, there was a shocking news about bash. I bet you already know, but lets just make it sure:) ssh shellshock@pwnable.kr -p2222 (pw:guest) 풀이 #include int main(){ setresuid(getegid(), getegid(), getegid()); setresgid(getegid(), getegid(), getegid()); system("/home/shellshock/bash -c 'echo shock_me'"); return 0; } shellshock 취약점은 bash가 subshell을 실행시키면서 발생합니다. bash의 환경변수에 함수 정의를 이용해서 원격 코드를 ..
문제 We all make mistakes, let's move on. (don't take this too seriously, no fancy hacking skill is required at all) This task is based on real event Thanks to dhmonkey hint : operator priority ssh mistake@pwnable.kr -p2222 (pw:guest) 풀이 먼저 mistake.c를 살펴봅시다. #include #include #define PW_LEN 10 #define XORKEY 1 void xor(char* s, int len){ int i; for(i=0; i 0)){ printf("read error\n"); close(fd); re..
문제 Daddy told me I should study arm. But I prefer to study my leg! Download : http://pwnable.kr/bin/leg.c Download : http://pwnable.kr/bin/leg.asm ssh leg@pwnable.kr -p2222 (pw:guest) 풀이 위의 문제를 해결하기 위해 파이프라인과 ARM Architecture 에 대한 이해가 필요합니다. ARM Architecture는 별도로 따로 정리하도록 하고, 해당 문서에서는 파이프라인만 간단하게 설명합니다. [파이프라인] CPU는 CLOCK 신호에 따라 명령을 처리하도록 설계되어 있습니다. 하지만 파이프라인 매커니즘을 적용하면 주어진 CLOCK 속도보다 더욱 빠르게 처리할..
문제 Mom? how can I pass my input to a computer program? ssh input2@pwnable.kr -p2222 (pw:guest) 풀이 서버에 접속하여 ls 명령을 입력해보면 input, input.c, flag 3개의 파일이 존재하는 것을 알 수 있습니다. 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("..
문제 Daddy, teach me how to use random value in programming! ssh random@pwnable.kr -p2222 (pw:guest) 풀이 서버에 접속하여 ls 명령을 입력해보면 random, random.c, flag 3개의 파일이 존재하는 것을 알 수 있습니다. 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..
문제 Mommy told me to make a passcode based login system. My initial C code was compiled without any error! Well, there was some compiler warning, but who cares about that? ssh passcode@pwnable.kr -p2222 (pw:guest) 풀이 서버에 접속하여 ls 명령을 입력해보면 passcode, passcode.c, flag 3개의 파일이 존재하는 것을 알 수 있습니다. cat 명령어를 통해 passcode.c 파일을 확인합니다. #include #include void login(){ int passcode1; int passcode2; printf("ent..
문제 Papa brought me a packed present! let's open it. Download : http://pwnable.kr/bin/flag This is reversing task. all you need is binary 풀이 해당 파일을 Hex Editor를 사용하여 확인하면 UPX로 패킹 되어 있다는 것을 알 수 있습니다. UPX 언패킹 툴을 사용하여 언패킹 후 IDA로 열어보면 플래그가 보입니다.
문제 Nana told me that buffer overflow is one of the most common software vulnerability. Is that true? Download : http://pwnable.kr/bin/bof Download : http://pwnable.kr/bin/bof.c Running at : nc pwnable.kr 9000 풀이 nc(netcat)은 TCP나 UDP 프로토콜을 사용하는 네트워크 연결에서 데이터를 읽고 쓰는 간단한 유틸리티 프로그램입니다. 문제 해결을 위해 두 개의 링크를 제시하고 있습니다. 하나는 bof 바이너리이고, 다른 하나는 바이너리의 소스코드를 보여주고 있습니다. 문제 해결을 위해 먼저 소스코드부터 분석해야 합니다. #include ..