CTF

    vsCTF 2023

    vsCTF 2023

    이번에도 리버싱 하나 풀었습니다. REV x0rr3al?!! 더보기 IDA로 디컴파일합니다. __int64 __fastcall main(__int64 a1, char **a2, char **a3) { char v4; // [rsp+Fh] [rbp-51h] int i; // [rsp+10h] [rbp-50h] int v6; // [rsp+14h] [rbp-4Ch] char s[56]; // [rsp+20h] [rbp-40h] BYREF unsigned __int64 v8; // [rsp+58h] [rbp-8h] v8 = __readfsqword(0x28u); if ( (unsigned int)sub_17A4(a1, a2, a3) ) { sub_16AD(); exit(1); } if ( ptrace(PTRA..

    CSAW CTF Qualification Round 2023

    CSAW CTF Qualification Round 2023

    시간이 모자라서 쉬운 것들만 풀어봤습니다. Intro my_first_pwnie 더보기 소스 코드는 다음과 같습니다. #!/usr/bin/env python3 # Pwn mostly builds on top of rev. # While rev is more about understanding how a program works, pwn is more about figuring out how to exploit a program to reach the holy grail: Arbitrary Code Execution # # If you can execute arbitrary code on a system, that system might as well be yours...because you can do ..

    SECCON CTF 2023 Quals

    SECCON CTF 2023 Quals

    1개 겨우 풀었습니다 ㅎㅎ.. REV jumpout IDA로 디컴파일이 잘 안되어서 어셈블리와 gdb로 분석한 결과 입력한 값의 길이가 29(0x1d)인지 검증한 뒤 다음과 같은 3번의 xor 연산을 거친 뒤 값을 비교하여 동일하면 정답으로 처리해주는 로직이었습니다. # r8d에 입력한 값이 들어감 r8d ^ esi # esi는 0 ~ 0x1c r8d ^ 0x55 # r9d는 [0x555555558010 + rdi] (0~0x1c) r8d ^ r9d pwndbg> x/4gx 0x555555558010 0x555555558010:0x68141581c831f5f60xf1ca09823ee535f6 0x555555558020:0x816d2a33dfdfa98a0x00000017df85a6f5 # 아래 배열과 비교..

    BDSec CTF 2023

    BDSec CTF 2023

    다양한 분야의 문제가 나와서 재밌었습니다. 포너블, 리버싱 문제가 쉽게 출제된 부분은 아쉬웠습니다. 웹에서 백도어를 활용한 문제는 처음 경험해서 신기했습니다. PWN Ghost, anyaForger, callme 보호기법이 걸려있지 않고, BOF 취약점을 이용하는 간단한 문제 REV Lucky Number, Not That Easy GDB를 활용한 동적 디버깅을 통해 해결 가능 WEB Can you see me? (Junan 선생님의 힌트: "PHP 백도어 문제입니다") 삽질을 하던 중 다음과 같은 영상을 찾았습니다. https://www.youtube.com/watch?v=j-wmhJ8u5Ws PHP 버전에 따라 활용되는 백도어가 있고 해당 익스코드를 활용해 웹 쉘을 열 수 있는 듯 합니다. (공부가 ..

    AmateursCTF 2023

    AmateursCTF 2023

    문제가 다양해서 재밌었고 내년에도 하면 좋을 것 같습니다. PWN permissions 더보기 #include #include #include #include #include #include #include #include void setup_seccomp () { scmp_filter_ctx ctx; ctx = seccomp_init(SCMP_ACT_KILL); int ret = 0; ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0); ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP..