본문 바로가기

분류 전체보기

2019 csaw final arevenge 2019 csaw final arevengec++ 바이너리로 문제화돼서 한 번 풀어봤는데 어려웠다..이 문제를 통해 알아갈 수 있었던 것이 많았으므로 라업을 한번 써본다.krrr@ubuntu:~/pwn/csaw/arevenge$ file a.out a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=93f2e298bd1e9cd9f8bf146f0b7bdb545b2c6d73, not stripped krrr@ubuntu:~/pwn/csaw/arevenge$ ldd a.out linux-vdso.so.1 (0x00.. 더보기
iretq, fops, tty, tty_ops struct iretq, fops, tty, tty_ops structiretqstruct trap_frame { size_t user_rip ; // instruction pointer size_t user_cs ; // code segment size_t user_rflags ; // CPU flags size_t user_rsp ; // stack pointer size_t user_ss ; // stack segment };fopsstruct file_operations { struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char __user *, size_t, loff_t *).. 더보기
kernel debugging with vmware kernel debugging with vmwareVMware Hypervisor를 이용하여 debugee를 만들고, 이의 kernel을 debugging하는 방법을 소개한다.make debugeeVMware로 분석 대상 kernel이 구축되어 있는 vmx를 로딩하거나, 딱히 상관없다면 편하게 아무 linux나 만들어서 debugee를 만들자.debugee를 만들었다면 먼저 uname -r로 kernel version을 확인하자.ubuntu@ubuntu:~$ uname -r 4.15.0-70-generic그리고, 디버깅을 위해 vmlinux를 추출해야 한다.vmlinux란 정적으로 링크된 실행 파일 형식의 Linux kernel을 말한다.vmlinuz는 vmlinux를 zlib, bzip2 등으로 압축한.. 더보기
2019 hack.lu chat hack.lu 2019 chatubuntu@ubuntu:~/pwn/hack.lu/chat$ ./chat Command Channel: > /h Command Commands: /nc - New Chat Channel - Create and join a new Chat Channel. /jc x - Join Chat Channel - Join the Chat Channel number x. /lc - List Chat Channels - Lists the Chat Channels. /q - Quit - Quit this awesome chat program. /h - Help - Print this help message. > /nc Chat Channel 1: > /h Chat Commands: /e -.. 더보기
peda special instruction 보호되어 있는 글입니다. 더보기
linux kernel module 작성해보기 linux kernel module 작성해보기맥커널을 공부하기에 앞서 겸사겸사 리눅스 커널부터 공부를 시작한다.Linux ubuntu 4.15.0-66-generic #75~16.04.1-Ubuntu SMP Tue Oct 1 14:01:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux 환경에서 테스트를 진행하였다.모든 것의 시작은 hello_world이다라고 생각하니 이러한 기능을 하는 모듈을 하나 만들어보도록 하자! #include #include #include static int __init hello_init(void) { printk("hello_init() hello world!\n"); return 0; } static void __exit hello_exit(vo.. 더보기
return-to-dynamic-linker return-to-dl-resolve return-to-dynamic-linkerx86Elf32_Rel (8 byte)typedef uint32_t Elf32_Addr;typedef uint32_t Elf32_Word;typedef struct{ Elf32_Addr r_offset; /* Address */ Elf32_Word r_info; /* Relocation type and symbol index */} Elf32_Rel;Elf32_Sym (16 byte)xxxxxxxxxxtypedef struct{ Elf32_Word st_name; /* Symbol name (string tbl index) */ Elf32_Addr st_value; /* Symbol value */ Elf32_Word st_.. 더보기
2019 hitcon lazyhouse lazyhouse hitcon 2019 lazyhouse정말.. 어려운 문제였다일단 전체적으로 흘러가는 흐름은 다음과 같다. mmap 셋팅 후 calloc으로 heap, libc leakunsafe unlink로 overlapping chunkhouse of lore로 tcache_pertheread_struct 공격__malloc_hook에 leave;retorw 이용해서 print flag (mprotect 이용해서 shellcode도 가능) 근데, 이 위 과정이 진짜 미쳤다..일단 이 exploit은 balsn의 writeup을 설명해 놓은 https://syedfarazabrar.com/2019-10-24-hitconctf-lazyhouse-balsn-exploit-analysis/ 이 블로그를 .. 더보기