Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- architecture
- 어셈블리어
- iptables
- .nret core 배포
- epoll_wait
- doupdate
- wrefresh
- ioctl
- packet filter
- .net core 7
- Docker
- DOCKER-USER
- level trigger
- wnourefresh
- BOF
- vtable
- NAPT
- edge trigger
- mvwin
- REDIS
- epoll
- 취약점
- cbpf
- LOB
- packet flow
- C언어
- Compiler
- ncurses
- rfc5508
- 풀이
Archives
- Today
- Total
Tuuna Computer Science
[malloc] malloc & heap 두들이기 3탄 unsortedbin library base address leak 본문
system hacking
[malloc] malloc & heap 두들이기 3탄 unsortedbin library base address leak
GuTTe 2019. 7. 4. 11:05unsorted bin을 통해서 library base address를 leak할 수 있다는 정보를 얻었고 실제로 재현.

ptr1와 ptr2라는 128byte의 malloc을 요청한다.
이는 72byte인 fastbin보다 큰 수이기 때문에 free시 unsortedbin에 들어가게되며 병합되어 small bin으로 가게된다.
이때 ptr1을 처음 free했을 때 unsorted bin에 들어가게 되는데 단일 chunk로서 fd와 bk를 연결할 곳이 없어 fd와 bk모두 main_arena+88의 주소를 가리키게 된다.

그럼 이때 free된 청크를 다시할당하면 UAF취약점이 발생하게 되어 main_arena+88의 주소값을 leak할 수 있게 된다.
main_arena는 libc.so.6 에 존재하므로 해당 라이브러리의 main_arena 오프셋을 구한뒤 88을 빼주면 라이브러리의 주소값을 leak할 수 있다.

해당 라이브러리의 main_arena offset은 0x3c4b20이다.


library base address가 구해졌다.
'system hacking' 카테고리의 다른 글
Dynamic Linker Advancture 1탄 (2) | 2019.07.12 |
---|---|
[malloc] overflow로 인접한 chunk의 heap 주소 구하기 (0) | 2019.07.04 |
[malloc] malloc & heap 찍어누르기 2탄(fastbin dup into stack) (0) | 2019.07.03 |
dlmalloc 조지기 1탄 (5) | 2019.05.28 |
C 코드에 카나리(canary)값 삽입하기 with 인라인 어셈블리 inline assembly (0) | 2019.03.30 |
Comments