전체 글(119)
-
[HackCTF / pwnable] Unexploitable_3
HackCTF - Unexploitable_3Summary64bitrtcAnalysisint __cdecl main(int argc, const char **argv, const char **envp) { char s; // [rsp+0h] [rbp-10h] setvbuf(stdout, 0LL, 2, 0LL); setvbuf(stdin, 0LL, 2, 0LL); fwrite("Impossible RTL ha? Nothing for you!\n", 1uLL, 0x24uLL, stdout); fgets(&s, 256, stdin); return 0; }fgets로 s에 입력을받아서 오버플로우가 생긴다. fwrite로 setvbuf의 주소를 출력하고 oneshot가젯을 쓰면 된다.return to csu로..
2019.12.09 -
[선린 고등해커 2회 본선] simple
선린 고등해커 2회 본선 simpleSummary64bitsyscall1 byte overwriteAnalysisint __cdecl main(int argc, const char **argv, const char **envp) { char buf; // [rsp+0h] [rbp-30h] alarm(0x3Cu); read(0, &buf, 0x400uLL); return 0; }이 문제만 풀었다면 상받는거라서 너무 아쉬웠다 ㅜㅜㅜㅜㅜㅜㅜㅜㅜㅜ alarm에 syscall이 들어가는것을 몰라서 못풀었다...read로 buf에 입력을 받아서 오버플로우가 생긴다.진짜 쓸만한 함수가 하나도 없다. alarm, read, __libc_csu_init정도? return to csu로 rdi, rsi, rdx에 값을..
2019.12.01 -
[Hackingcamp CTF 2019] bofforeverfluw
Hackingcamp CTF 2019 - bofforeverfluwSummary32bitAnalysisint __cdecl main() { char buf; // [esp+0h] [ebp-204h] int (**retaddr)(const char *); // [esp+208h] [ebp+4h] system("echo hi"); read(0, &buf, 0x800u); if ( retaddr == &system ) { perror("no hack~"); exit(-1); } return 0; }retaddr이 system인지 검사한다. ret으로 우회하면 된다. data영역(0x0804a024)에 /bin/sh라는 문자열이 있다. 이거를 이용하면 된다.Exploitfrom pwn import * e..
2019.11.27 -
[HackCTF / pwnable] Beginner_Heap
HackCTF - Beginner_HeapSummary64bitheap overflowAnalysismainvoid __fastcall __noreturn main(__int64 a1, char **a2, char **a3) { void *v3; // ST10_8 void *v4; // ST18_8 char s; // [rsp+20h] [rbp-1010h] unsigned __int64 v6; // [rsp+1028h] [rbp-8h] v6 = __readfsqword(0x28u); v3 = malloc(0x10uLL); *v3 = 1; *(v3 + 1) = malloc(8uLL); v4 = malloc(0x10uLL); *v4 = 2; *(v4 + 1) = malloc(8uLL); fgets(&s,..
2019.11.26 -
[pwnable.kr] passcode
pwnable.kr passcodeSummary32bitgot overwriteAnalysismainint __cdecl main(int argc, const char **argv, const char **envp) { puts("Toddler's Secure Login System 1.0 beta."); welcome(); login(); puts("Now I can safely trust you that you have credential :)"); return 0; }welcomeunsigned int welcome() { char v1; // [esp+18h] [ebp-70h] unsigned int v2; // [esp+7Ch] [ebp-Ch] v2 = __readgsdword(0x14u);..
2019.11.19 -
[선린 고등해커 2회 예선] PPP
선린 고등해커 2회 예선 PPPSummaryc++ropAnalysismainint __cdecl main(int argc, const char **argv, const char **envp) { __int64 v3; // rax char v5; // [rsp+20h] [rbp-30h] int v6; // [rsp+4Ch] [rbp-4h] v6 = 0; setvbuf(stdout, 0LL, 2, 0LL); setvbuf(stdin, 0LL, 2, 0LL); v3 = std::operator
2019.11.19