카테고리 없음
안암 11/16
보호되어 있는 글입니다.
카테고리 없음
안암 11/16
보호되어 있는 글입니다.
War Games/pwnable.kr
[pwnable.kr] flag (7 pts) :: Write-Up
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 리버싱 문제라고 하네요. 일단 파일을 받아서 까봅시다. malloc한후 그곳에 flag를 넣어놓는다고 하네요. gdb로는 얻어지는게 없으니 아이다로 봅시다. 근데 아이다로 열어보니까 수상합니다. 함수도 얻어지는게 없고, 어셈블리어 코드를 봐도 이상한게 너무 많네요. 이 문제를 풀면서 공부한 것이 꽤 있는데, 일단 reversing문제로 접근할 때는, 어떤 언어로 작성되어있는지, packing이 되어있는지 여부를 보는 것이 중요하다는 것을 알게되었습니다. 따라서 언어 확..
War Games/pwnable.kr
[pwnable.kr] bof(5 pts) :: Write-Up
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 우선 코드를 봅시다. #include #include #include void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme);// smash me! if(key == 0xcafebabe){ system("/bin/sh"); } else{ printf..
War Games/pwnable.kr
[pwnable.kr] collision(3 pts) :: Write-Up
Daddy told me about cool MD5 hash collision today. I wanna do something like that too! ssh col@pwnable.kr -p2222 (pw:guest) col@prowl:~$ ls col col.c flag col@prowl:~$ nl col.c 1#include 2#include 3unsigned long hashcode = 0x21DD09EC; 4unsigned long check_password(const char* p){ 5int* ip = (int*)p; 6int i; 7int res=0; 8for(i=0; i
War Games/pwnable.kr
[pwnable.kr] fd(1 pt) :: Write-Up
Mommy! what is a file descriptor in Linux? - try to play the wargame your self but if you are ABSOLUTE beginner, follow this tutorial link: https://youtu.be/971eZhMHQQw ssh fd@pwnable.kr -p2222 (pw:guest) fd@prowl:~$ ls fd fd.c flag fd@prowl:~$ cat flag cat: flag: Permission denied fd, fd.c, flag파일이 있네요. 보아하니 flag파일이 있는데 당연히도 권한이 없구요. 그래서 fd.c파일을 열어보았습니다. fd@prowl:~$ nl fd.c 1 #include 2 #includ..
War Games/해커스쿨 LOB
[해커스쿨 LOB] Level 5: Orc >> Wolfman
Level 5. Orc >> Wolfman Theme: Egghunter + Buffer Hunter 로그인합시다 id: orc pw: cantata 디렉토리 확인! (bash2도 까먹지 맙시다!) [orc@localhost orc]$ bash2 [orc@localhost orc]$ ls wolfman wolfman.c [orc@localhost orc]$ cat wolfman.c /* The Lord of the BOF : The Fellowship of the BOF - wolfman - egghunter + buffer hunter */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; in..
War Games/pwnable.xyz
[pwnable.xyz] Add(50 pts) :: Write-Up
We did some subtraction, now let's do some addition. 정직하게 더한다 솔직히 아무것도 상관은 없다. NX때문에 권한제한이 조금 있다. 대충 v4랑 v5를 잘 조작해주면 될듯 win함수 준걸로봐서 ret값을 이걸로 잘 덮으면 되겠쥬? 나는 v7을 이용할 것이다. 일단 result를 이용하고싶었지만 v7자체는 v6을 통해 11이상의 값을 입력하면 stack영역 그 밑까지 값을 입력할 수 있으므로 v7을 이용해 입력할 것이다.(전문용어로는 out of bound라고 하더라.) v7은 rbp-60h에 있기때문에 v7 + 104가 시작주소(96 + 8) 이때 v7이 배열이라는 점을 잘 생각해보자. v7은 8byte인 __int64를 변수로 두기때문에 v7 + 104에 접근..
War Games/pwnable.xyz
[pwnable.xyz] Sub(50 pts) :: Write-Up
Do you know basic math? 보고 놀랐다. 너무 쉬워서.....ㅎ v4 - v5 = 4919여야해서 v4에는 4918, v5에는 -1을 넣었습니다. ==FINAL PAYLOAD== 페이로드라고 하기도 부끄럽네유
War Games/root-me.org
[root-me.org] ELF x86 - Race condition Write-Up
::Login:: Host challenge02.root-me.org Protocol SSH Port 2222 SSH access ssh -p 2222 app-systeme-ch12@challenge02.root-me.org WebSSH Username app-systeme-ch12 Password app-systeme-ch12 ::Code:: #include #include #include #include #include #include #include #include #define PASSWORD "/challenge/app-systeme/ch12/.passwd" #define TMP_FILE "/tmp/tmp_file.txt" int main(void) { int fd_tmp, fd_rd; char..
War Games/root-me.org
[root-me.org] ELF x86 - Format string bug basic 2 Write-Up
::Login:: Host challenge02.root-me.org Protocol SSH Port 2222 SSH access ssh -p 2222 app-systeme-ch14@challenge02.root-me.org WebSSH Username app-systeme-ch14 Password app-systeme-ch14 ::Code:: #include #include #include #include int main( int argc, char ** argv ) { int var; int check = 0x04030201; char fmt[128]; if (argc
Coding_Algorithm/정올 문제풀이
[정올] 기초다지기_출력_자가진단4_code504 (C/C++/Python)
다음과 같이 출력되는 프로그램을 작성하라. (@) (@) (=^.^=) (-m-m-) 첫 번째 줄 중간에 공백 하나가 포함되어 있다. 1. C언어 #include int main() { printf("(@) (@)\n(=^.^=)\n(-m-m-)\n"); return 0; } 2. C++ #include using namespace std; int main() { cout
Coding_Algorithm/정올 문제풀이
[정올] 기초다지기_출력_자가진단_code503 (C/C++/Python)
503 : 출력 - 자가진단3 제한시간: 1000 ms 메모리제한: 0 MB 해결횟수: 16041 회 시도횟수: 29498 회 아래와 같이 출력되는 프로그램을 작성하라. My name is Hong Gil Dong. I am 13 years old. 1. C언어 #include int main() { printf("My name is Hong Gil Dong.\nI am 13 years old."); return 0; } 2. C++ #include using namespace std; int main() { cout