CTF

    TAMUctf 2023 - Pwnme

    1. intro 2. code 및 분석 2.1. code 0000000000401195 : 401195: 55 push %rbp 401196: 48 89 e5 mov %rsp,%rbp 401199: 48 83 ec 18 sub $0x18,%rsp 40119d: b8 00 00 00 00 mov $0x0,%eax 4011a2: e8 89 fe ff ff call 401030 4011a7: 48 83 c4 18 add $0x18,%rsp 4011ab: b8 00 00 00 00 mov $0x0,%eax 4011b0: 5d pop %rbp 4011b1: c3 ret 4011b2: 48 29 f0 sub %rsi,%rax 4011b5: c3 ret 0000000000401030 : 401030: ff 25 e2..

    TAMUctf 2023 - Pointer

    1. intro 2. code 및 분석 2.1. code #include #include void upkeep() { // Not related to the challenge, just some stuff so the remote works correctly setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); } void win() { char* argv[] = {"/bin/cat", "flag.txt", NULL}; execve(argv[0], argv, NULL); } void lose() { char* argv[] = {"/bin/echo", "loser", NULL}; ..

    TAMUctf 2023 - Inspector Gadget

    1. intro 2. code 및 분석 2.1. code ssize_t pwnme() { char buf[16]; // [rsp+0h] [rbp-10h] BYREF puts("pwn me"); return read(0, buf, 0x60uLL); } 2.2. 분석 main 함수는 pwnme 함수를 불러오는 역할만 하기에 패스. 16바이트 버퍼에 0x60 바이트를 입력 받기 때문에 오버플로우가 발생한다. 3. 취약점 확인 및 공격 준비 3.1. 취약점 단순 오버플로우 3.2. 공격 준비 문제 파일과 함께 libc 파일도 주어지기 때문에 pwnme 함수 종료 시 onegadget으로 return 해주었다. 다만, 한번만 입력할 수 있으며, libc 영역 leak이 필요하기 때문에 페이로드 초기에는 leak ..

    TAMUctf 2023 - Sea Shells

    1. intro 2. code 및 분석 2.1. code #include #include int check(unsigned long n, unsigned long sold) { if ((n & 0xffff) == (sold & 0xffff)) { return 1; } return 0; } void vuln() { unsigned long num_sold; char resp; unsigned long a; unsigned long b; unsigned long c; unsigned long d; num_sold = rand(); printf("It's not that easy though, enter 4 numbers to use to guess!\n"); do { // ask user for input ..

    TAMUctf 2023 - Unlucky

    1. intro 2. code 및 분석 2.1. code #include #include int main() { setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0); static int seed = 69; srand(&seed); printf("Here's a lucky number: %p\n", &main); int lol = 1; int input = 0; for (int i = 1; i

    Dreamhack CTF Season 3 Round #2 (🌱Div2) - baby-linux

    보호되어 있는 글입니다.

    Dreamhack CTF Season 3 Round #2 (🌱Div2) - awesome-basics

    보호되어 있는 글입니다.

    Dreamhack CTF Season 3 Round #2 (🌱Div2) - ex-reg-ex

    보호되어 있는 글입니다.

    24@CTF '23 - loop

    1. intro 세컨드 블러드으으으으으!!! 2. code 및 분석 2.1. code 0000000000401000 : 401000: bf 01 00 00 00 mov $0x1,%edi 401005: 48 be 00 20 40 00 00 movabs $0x402000,%rsi 40100c: 00 00 00 40100f: ba 37 00 00 00 mov $0x37,%edx 401014: b8 01 00 00 00 mov $0x1,%eax 401019: 0f 05 syscall 40101b: 48 31 c0 xor %rax,%rax 40101e: 48 c7 c3 ff ff ff ff mov $0xffffffffffffffff,%rbx 401025: e8 21 00 00 00 call 40104b 40102..