전체 글 (186) 썸네일형 리스트형 FOOBAR 2022 후기 너무 늦게 참여한 것이 참 아쉬운 CTF였다 포너블 6문제 중 4문제 풀었다 SSID flag.txt에서 플래그를 s에 저장한 뒤 fgets로 32byte 입력받고 __printf_chk함수로 그대로 출력해주면서 fsb가 터진다 보호 기법은 모조리 걸려있고 __printf_chk 때문에 메모리 릭말곤 할 수 있는게 없다 (단순 flag leak) 단순히 flag 릭하면 된다 (문제와 관련된 링크: https://www.bleepingcomputer.com/news/security/iphone-bug-breaks-wifi-when-you-join-hotspot-with-unusual-name/) warmup printf에서 fsb가 터지고 gets함수에서 bof가 터진다 fsb로 canary랑 stdout.. ezshell shellcode 문제답게 nx bit가 걸려 있지 않고 코드내에서 syscall이나 0x3b 등의 바이트 필터링을 해서 바로 execve syscall을 수행할 수 없었다 또한 입력한 쉘코드가 실행되기 전에 rip를 제외한 모든 레지스터를 초기화시키기 때문에 rip를 제외하면 정보를 얻기가 매우 힘들다 from pwn import * p = process("./ezshell") #gdb.attach(p) shell = b"\x48\x8d\x35\xc9\xff\xff\xff\x48\x89\xf1\xfe\xc9\xfe\xc9\xb2\xff\xff\xe1" shell += b"A" * (30 - len(shell)) p.send(shell) sleep(1) ex_shell = b"\x48\x89\xf4\x4.. fastbin 보호되어 있는 글입니다. (glibc 2.23) do_check_chunk 전체 코드는 아래 더보기 더보기 /* Properties of all chunks */ static void do_check_chunk (mstate av, mchunkptr p) { unsigned long sz = chunksize (p); /* min and max possible addresses assuming contiguous allocation */ char *max_address = (char *) (av->top) + chunksize (av->top); char *min_address = max_address - av->system_mem; if (!chunk_is_mmapped (p)) { /* Has legal address ... */ if (p != av->top) { if (.. (glibc 2.23) do_check_inuse_chunk 전체 코드는 아래 더보기 더보기 /* Properties of inuse chunks */ static void do_check_inuse_chunk (mstate av, mchunkptr p) { mchunkptr next; do_check_chunk (av, p); if (chunk_is_mmapped (p)) return; /* mmapped chunks have no next/prev */ /* Check whether it claims to be in use ... */ assert (inuse (p)); next = next_chunk (p); /* ... and is surrounded by OK chunks. Since more things can be checked with free ch.. (glibc 2.23) check_remalloced_chunk 전체 코드는 아래 더보기 더보기 /* Properties of chunks recycled from fastbins */ static void do_check_remalloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s) { INTERNAL_SIZE_T sz = p->size & ~(PREV_INUSE | NON_MAIN_ARENA); if (!chunk_is_mmapped (p)) { assert (av == arena_for_chunk (p)); if (chunk_non_main_arena (p)) assert (av != &main_arena); else assert (av == &main_arena); } do_check_inuse_chunk (av,.. 유클리드 호제법 보호되어 있는 글입니다. CyptoHack introduction course 보호되어 있는 글입니다. 이전 1 ··· 16 17 18 19 20 21 22 ··· 24 다음