목록Security/Pwnable (146)
cdor1's lab
보호되어 있는 글입니다.
보호되어 있는 글입니다.
use after free, double free bug를 이용한 문제이다. malloc(256), malloc(256), free(0), malloc(256)을 이용해 unsorted bin fd, bk에 적힌 main_arena+88 주소를 leak하고 libc주소를 알아냈다. title, content를 add메뉴에서 title과 content를 입력받는데 매우 취약한 부분이 title을 입력받는 부분과 content의 포인터를 입력받는 부분의 주소가 같다. ex) title이 0x1f200이면 pointer는 0x1f210 그런데 title을 입력받는 부분에서 1byte overflow가 생겨 pointer의 최하위 1바이트를 수정할 수 있다. 이를 이용해 free(1), free(2), free..
Type confusionc++분석하느라 애먹었다 ㅠㅠㅠ root@noe:~/pwnchal# ./checksec.sh --file noe.systems/owner RELRO STACK CANARY NX PIE RPATH RUNPATH FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH noe.systems/owner 1. Apartment에서 Restaurant로 type change해서 fd, bk leak2. pointer 이용해서 main_arena+88 leak 3. pointer 이용해서 malloc_hook overwrite4. get shell from pwn import * s = process('./owner')..
보호되어 있는 글입니다.
C++ ExploitationName Mangling // http://spikez.tistory.com/19Vtable fucntion table // http://thrillfighter.tistory.com/79, https://ko.wikipedia.org/wiki/가상_메소드_테이블Vector & String New & deleteCopy constructor & assignment operatorlab 15 - zoohttps://github.com/cdor1/HITCON-Training C++ 헥스레이 분석하다가 ㅎㅎ..
보호되어 있는 글입니다.
sandbox상에서 돌아가는 프로그램에서 쉘코드를 이용해 플래그를 얻어오는 문제이다.받은 input을 buf(v4, v3)로 실행시켜준다. 하지만 허용되는 syscall에 제한이 있다. flag를 뽑아와야하는데 read, open syscall은 허용되어 있지만 write syscall이 허용되지 않아 나에게 바로 출력해주기 어렵다.그래서 blind sql injection처럼 풀어내야 한다. (with shellcode) from pwn import * elf = ELF("./mute") context.binary = elf flag = '' while 1: for i in string.printable: log.info('Trying ' + i) s = process('./mute') print s...
1번 메뉴를 이용해 청크를 할당할 때나 4번 메뉴를 이용해 청크를 수정할 때56바이트의 청크를 할당했지만 128바이트를 받아 힙 상에서 overflow가 발생한다.그래서 unlink를 이용해 exploit 할 수 있다. 고맙게도 프로그램에 아무런 보호기법이 설정되어있지 않아서 풀 방법을 바로 찾았는데 1.1-1. 청크 3개 할당1-2. 마지막 청크에는 shellcode 삽입1-3. fd전까지 더미로 덮어서 heap_addr leak(마지막 청크 주소 계산)1-4. unlink로 malloc pointer 변경1-5. chunk0 pointer puts_got로 변경1-6. puts_got를 마지막 청크 주소로 overwrite 해서 execute shellcode 2.2-1. 청크 3개 할당2-1. un..
보호되어 있는 글입니다.