전체 글 (186) 썸네일형 리스트형 (kernel of linux) process management 0 보호되어 있는 글입니다. (kernel of linux) system call 보호되어 있는 글입니다. (glibc 2.23)check_malloced_chunk 해당 함수를 malloc함수에서 재할당할 청크의 주소를 반환하기 전에 호출된다 do_check_remalloced_chunk를 호출하고 청크에 PREV_INUSE비트가 설정되어 있는지 확인한다 /* Properties of nonrecycled chunks at the point they are malloced */ static void do_check_malloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s) { /* same as recycled case ... */ do_check_remalloced_chunk (av, p, s); /* ... plus, must obey implementation invariant that prev_inuse is a.. House of force 보호되어 있는 글입니다. (kernel of linux) introduction 보호되어 있는 글입니다. jon9hyun's secret 카나리랑 PIE가 안 걸려있다 바이너리는 static compiled이고 stripped 되어있다... 이거본 순간 그대로 IDA 끄고 자러 갈 뻔했다 최대한 알아먹을 수 있게 함수명을 적어놓았다 main함수에서 힙 영역에 데이터를 입력받고 top_secret파일의 데이터를 출력한다 운이 좋았는지 처음에 심볼이 다 죽어있어서 strace로 실행시켜보는 과정에서 main함수 이전에 flag을 open하는걸 확인했다 from pwn import * context.log_level = "debug" p = remote("ctf.j0n9hyun.xyz", 3031) #p = process("./j0n9hyun_secret") #gdb.attach(p) payload = b"A" * 0x138 payload +=.. zer0pts 2022 / Modern Rome 삽질하다 못 풀고 대회가 끝나버렸다... 좀 전에 vs에 코드가 남아있길래 다시 차근차근 분석해보니까 코드 분석을 제대로 안 해서 못 풀었다.. 고대 숫자 체계가 여전히 현대에서도 사용된다고 한다 해당 문제는 바이너리와 C++로 작성된 원본 코드가 주어졌다 #include #include #include short buf[10]; short readroman() { short res = 0; std::string s; std::cin >> s; auto it = s.crbegin(); int b = 1; for (auto c : "IXCM") { int cnt = 0; while (cnt < 9 && it != s.crend() && *it == c) { it++; cnt++; } } return res.. UAF 바이너리를 열어보면 노트를 추가, 삭제, 출력 기능이 있다 add_note함수에서는 먼저 8만큼의 힙을 할당받은 뒤 노트에 문자열이 될 힙을 원하는 크기만큼 할당받는다 print_note_content함수 주소와 문자열이 있는 청크의 주소는 처음 할당된 청크에 저장되고 이 청크 주소를 notelist에 저장한다 notelist에서 원하는 인덱스의 노트를 삭제시킬 수있다 (add_note에서 할당된 청크를 free시킨다) 문자열 데이터가 저장된 청크를 먼저 free시키고 add_note에서 처음 할당받은 청크를 free시킨다 notlist에 저장된 청크에 있는 함수를(print_note_content) 호출한다 del_note함수에서 할당된 청크를 free할때 notelist의 주소를 비워주지 않기 때문에.. 이전 1 ··· 13 14 15 16 17 18 19 ··· 24 다음