[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 게시됨