[pwnable.kr] fd(1 pt) :: Write-Up 포스팅 썸네일 이미지

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..

2019.11.08 게시됨

[해커스쿨 LOB] Level 5: Orc >> Wolfman 포스팅 썸네일 이미지

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..

2019.11.06 게시됨

[pwnable.xyz] Add(50 pts) :: Write-Up 포스팅 썸네일 이미지

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에 접근..

2019.11.06 게시됨

[root-me.org] ELF x64 - Stack buffer overflow - basic Write-Up 포스팅 썸네일 이미지

War Games/root-me.org

[root-me.org] ELF x64 - Stack buffer overflow - basic Write-Up

::Login:: Host challenge03.root-me.org Protocol SSH Port 2223 SSH access ssh -p 2223 app-systeme-ch35@challenge03.root-me.org WebSSH Username app-systeme-ch35 Password app-systeme-ch35 ::Code:: #include #include #include #include #include /* gcc -o ch35 ch35.c -fno-stack-protector -no-pie -Wl,-z,relro,-z,now,-z,noexecstack */ void callMeMaybe(){ char *argv[] = { "/bin/bash", "-p", NULL }; execve..

2019.11.03 게시됨

[root-me.org] ELF x86 - Format string bug basic 1 Write-Up 포스팅 썸네일 이미지

War Games/root-me.org

[root-me.org] ELF x86 - Format string bug basic 1 Write-Up

::Login:: Host challenge02.root-me.org Protocol SSH Port 2222 SSH access ssh -p 2222 app-systeme-ch5@challenge02.root-me.org WebSSH Username app-systeme-ch5 Password app-systeme-ch5 ::Code:: #include #include int main(int argc, char *argv[]){ FILE *secret = fopen("/challenge/app-systeme/ch5/.passwd", "rt"); char buffer[32]; fgets(buffer, sizeof(buffer), secret); printf(argv[1]); fclose(secret); ..

2019.11.02 게시됨

[root-me.org] ELF x86 - Stack buffer overflow basic 2 Write-Up 포스팅 썸네일 이미지

War Games/root-me.org

[root-me.org] ELF x86 - Stack buffer overflow basic 2 Write-Up

::login:: Host challenge02.root-me.org Protocol SSH Port 2222 SSH access ssh -p 2222 app-systeme-ch15@challenge02.root-me.org WebSSH Username app-systeme-ch15 Password app-systeme-ch15 ::code:: #include #include #include #include void shell() { setreuid(geteuid(), geteuid()); system("/bin/bash"); } void sup() { printf("Hey dude ! Waaaaazzaaaaaaaa ?!\n"); } void main() { int var; void (*func)()=s..

2019.11.02 게시됨

[root-me.org] ELF x86 - Stack buffer overflow basic 1 write-up 포스팅 썸네일 이미지

War Games/root-me.org

[root-me.org] ELF x86 - Stack buffer overflow basic 1 write-up

::login:: Host challenge02.root-me.org Protocol SSH Port 2222 SSH access ssh -p 2222 app-systeme-ch13@challenge02.root-me.org Username app-systeme-ch13 Password app-systeme-ch13 ::code:: #include #include #include #include int main() { int var; int check = 0x04030201; char buf[40]; fgets(buf,45,stdin); printf("\n[buf]: %s\n", buf); printf("[check] %p\n", check); if ((check != 0x04030201) && (che..

2019.11.01 게시됨

[pwnable.xyz] Welcome(50 pts) :: Write-Up 포스팅 썸네일 이미지

War Games/pwnable.xyz

[pwnable.xyz] Welcome(50 pts) :: Write-Up

Are you worthy to continue? 처음에 출력해주는 주소는 v3을 malloc하여 얻은 주소로, 여기를 0으로 만드는게 목적이다. 다른 곳들에 올라와있는 write-up들을 보면 모두 size에 큰 값을 넣어주게 되면 malloc의 리턴 값이 0이 되기 때문에 내가 원하는 주소를 0으로 수정할 수 있다. 하고 끝나던데 이 한줄로 이해가 된다고????? 그래서 저는 삽질을 추가로 했습니다. 아이다로 분석을 해보면 내가 입력하는 데이터도 heap로 들어가고, stack canary도 활성화 되어있어서 '과연 welcome문제인데 canary leak까지 이용을 할까...?'라는 생각으로 stack을 보기보다는 실제 프로그램이 돌아가는 것을 보았다. 다음은 gdb로 까서 일단 실행시켜 본 후 ..

2019.11.01 게시됨

[해커스쿨 LOB] Level4: goblin >> orc 포스팅 썸네일 이미지

War Games/해커스쿨 LOB

[해커스쿨 LOB] Level4: goblin >> orc

Level 4. Goblin >> Orc Theme: EggHunter 레츠 로그인 id: goblin pw: hackers proof 디렉토리 확인! [goblin@localhost goblin]$ bash2 [goblin@localhost goblin]$ ls -l total 20 -rwsr-sr-x 1 orc orc 12567 Feb 26 2010 orc -rw-r--r-- 1 root root 505 Mar 29 2010 orc.c [goblin@localhost goblin]$ nl orc.c 1 /* 2 The Lord of the BOF : The Fellowship of the BOF 3 - orc 4 - egghunter 5 */ 6 #include 7 #include 8 extern c..

2019.09.25 게시됨