힙 함수 보안 검사
Reading time: 5 minutes
tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:
HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
unlink
자세한 정보는 다음을 확인하세요:
수행된 검사 요약입니다:
- 청크의 지정된 크기가 다음 청크에 표시된
prev_size와 동일한지 확인 - 오류 메시지:
corrupted size vs. prev_size - 또한
P->fd->bk == P및P->bk->fw == P확인 - 오류 메시지:
corrupted double-linked list - 청크가 작지 않은 경우,
P->fd_nextsize->bk_nextsize == P및P->bk_nextsize->fd_nextsize == P확인 - 오류 메시지:
corrupted double-linked list (not small)
_int_malloc
자세한 정보는 다음을 확인하세요:
- 빠른 빈 검색 중 검사:
- 청크가 정렬되지 않은 경우:
- 오류 메시지:
malloc(): unaligned fastbin chunk detected 2 - 포워드 청크가 정렬되지 않은 경우:
- 오류 메시지:
malloc(): unaligned fastbin chunk detected - 반환된 청크의 크기가 빠른 빈의 인덱스 때문에 올바르지 않은 경우:
- 오류 메시지:
malloc(): memory corruption (fast) - tcache를 채우는 데 사용된 청크가 정렬되지 않은 경우:
- 오류 메시지:
malloc(): unaligned fastbin chunk detected 3 - 작은 빈 검색 중 검사:
victim->bk->fd != victim인 경우:- 오류 메시지:
malloc(): smallbin double linked list corrupted - 각 빠른 빈 청크에 대해 수행되는 통합 검사:
- 청크가 정렬되지 않은 경우 트리거:
- 오류 메시지:
malloc_consolidate(): unaligned fastbin chunk detected - 청크의 크기가 인덱스에 따라 달라야 하는 크기와 다른 경우:
- 오류 메시지:
malloc_consolidate(): invalid chunk size - 이전 청크가 사용 중이 아니고 이전 청크의 크기가 prev_chunk에 의해 표시된 것과 다른 경우:
- 오류 메시지:
corrupted size vs. prev_size in fastbins - 정렬되지 않은 빈 검색 중 검사:
- 청크 크기가 이상한 경우(너무 작거나 너무 큼):
- 오류 메시지:
malloc(): invalid size (unsorted) - 다음 청크 크기가 이상한 경우(너무 작거나 너무 큼):
- 오류 메시지:
malloc(): invalid next size (unsorted) - 다음 청크에 의해 표시된 이전 크기가 청크의 크기와 다른 경우:
- 오류 메시지:
malloc(): mismatching next->prev_size (unsorted) victim->bck->fd == victim이 아니거나victim->fd == av (arena)가 아닌 경우:- 오류 메시지:
malloc(): unsorted double linked list corrupted - 우리는 항상 마지막 것을 확인하고 있으므로, 그것의 fd는 항상 arena 구조체를 가리켜야 합니다.
- 다음 청크가 이전 청크가 사용 중임을 나타내지 않는 경우:
- 오류 메시지:
malloc(): invalid next->prev_inuse (unsorted) fwd->bk_nextsize->fd_nextsize != fwd인 경우:- 오류 메시지:
malloc(): largebin double linked list corrupted (nextsize) fwd->bk->fd != fwd인 경우:- 오류 메시지:
malloc(): largebin double linked list corrupted (bk) - 인덱스에 따른 큰 빈 검색 중 검사:
bck->fd-> bk != bck인 경우:- 오류 메시지:
malloc(): corrupted unsorted chunks - 다음 더 큰 큰 빈 검색 중 검사:
bck->fd-> bk != bck인 경우:- 오류 메시지:
malloc(): corrupted unsorted chunks2 - Top 청크 사용 중 검사:
chunksize(av->top) > av->system_mem인 경우:- 오류 메시지:
malloc(): corrupted top size
tcache_get_n
tcache_get_n에서의 검사:- 청크가 정렬되지 않은 경우:
- 오류 메시지:
malloc(): unaligned tcache chunk detected
tcache_thread_shutdown
tcache_thread_shutdown에서의 검사:- 청크가 정렬되지 않은 경우:
- 오류 메시지:
tcache_thread_shutdown(): unaligned tcache chunk detected
__libc_realloc
__libc_realloc에서의 검사:- 이전 포인터가 정렬되지 않았거나 크기가 올바르지 않은 경우:
- 오류 메시지:
realloc(): invalid pointer
_int_free
자세한 정보는 다음을 확인하세요:
_int_free시작 시 검사:- 포인터가 정렬되어 있는지:
- 오류 메시지:
free(): invalid pointer - 크기가
MINSIZE보다 크고 크기도 정렬되어 있는 경우: - 오류 메시지:
free(): invalid size _int_freetcache에서의 검사:mp_.tcache_count보다 더 많은 항목이 있는 경우:- 오류 메시지:
free(): too many chunks detected in tcache - 항목이 정렬되지 않은 경우:
- 오류 메시지:
free(): unaligned chunk detected in tcache 2 - 해제된 청크가 이미 해제되었고 tcache에 청크로 존재하는 경우:
- 오류 메시지:
free(): double free detected in tcache 2 _int_free빠른 빈에서의 검사:- 청크의 크기가 유효하지 않은 경우(너무 크거나 작음) 트리거:
- 오류 메시지:
free(): invalid next size (fast) - 추가된 청크가 이미 빠른 빈의 최상위인 경우:
- 오류 메시지:
double free or corruption (fasttop) - 최상위 청크의 크기가 추가하려는 청크의 크기와 다른 경우:
- 오류 메시지:
invalid fastbin entry (free)
_int_free_merge_chunk
_int_free_merge_chunk에서의 검사:- 청크가 최상위 청크인 경우:
- 오류 메시지:
double free or corruption (top) - 다음 청크가 아레나의 경계를 벗어난 경우:
- 오류 메시지:
double free or corruption (out) - 청크가 사용 중으로 표시되지 않은 경우(다음 청크의 prev_inuse에서):
- 오류 메시지:
double free or corruption (!prev) - 다음 청크의 크기가 너무 작거나 너무 큰 경우:
- 오류 메시지:
free(): invalid next size (normal) - 이전 청크가 사용 중이 아닌 경우, 통합을 시도합니다. 그러나
prev_size가 이전 청크에 표시된 크기와 다른 경우: - 오류 메시지:
corrupted size vs. prev_size while consolidating
_int_free_create_chunk
_int_free_create_chunk에서의 검사:- 정렬되지 않은 빈에 청크를 추가할 때,
unsorted_chunks(av)->fd->bk == unsorted_chunks(av)인지 확인: - 오류 메시지:
free(): corrupted unsorted chunks
do_check_malloc_state
do_check_malloc_state에서의 검사:- 정렬되지 않은 빠른 빈 청크인 경우:
- 오류 메시지:
do_check_malloc_state(): unaligned fastbin chunk detected
malloc_consolidate
malloc_consolidate에서의 검사:- 정렬되지 않은 빠른 빈 청크인 경우:
- 오류 메시지:
malloc_consolidate(): unaligned fastbin chunk detected - 잘못된 빠른 빈 청크 크기인 경우:
- 오류 메시지:
malloc_consolidate(): invalid chunk size
_int_realloc
_int_realloc에서의 검사:- 크기가 너무 크거나 너무 작은 경우:
- 오류 메시지:
realloc(): invalid old size - 다음 청크의 크기가 너무 크거나 너무 작은 경우:
- 오류 메시지:
realloc(): invalid next size
tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:
HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
HackTricks