rosieblue
보호되어 있는 글입니다. 내용을 보시려면 비밀번호를 입력해주세요.
article thumbnail
[드림핵(Dreamhack)] tcache_dup
Linux Exploitation/Wargame 2023. 6. 27. 12:52

문제코드 // gcc -o tcache_dup tcache_dup.c -no-pie #include #include #include #include char *ptr[10]; void alarm_handler() { exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(60); } int create(int cnt) { int size; if (cnt > 10) { return -1; } printf("Size: "); scanf("%d", &size); ptr[cnt] = malloc(size); if (!ptr[..

article thumbnail
[Heap] Exploitation : tcache dup
Linux Exploitation/Heap 2023. 6. 27. 09:02

배경지식 : Double Free Bug [Heap] Exploitation : Double Free Bug [Heap] Exploitation : Double Free Bug Double Free Bug Double Free Bug(DFB)는 free(ptr1); free(ptr1);처럼 같은 메모리를 여러번 free했을 때 나타나는 버그이다. 이게 왜 문제인지는 아래에서 설명할 것임 free(ptr1); free(ptr1); free 함수는 포인터를 초 hannahsecurity.tistory.com Duble Free Bug에 대해 모르는 분들은 위 글 꼭읽고 오기! 다시 한번 DFB에 대해 복습해보자. Double Free Bug은 free등으로 동일한 힙 메모리를 중복으로 해제했을 때 일어나는 ..

article thumbnail
[Docker] 도커 실행후 바로 종료되는 오류
Etc 2023. 6. 27. 01:29

sudo docker run -d -t -i 이미지명 /bin/bash 으로 실행하면 잘된다..ㅠㅠ https://forums.docker.com/t/run-container-but-exited-immediately/18811/5 Run container but exited immediately HI Yes I got it. But I dont want right now to run container in interactive mode. I want to just start container only. forums.docker.com

article thumbnail
[드림핵(Dreamhack)] uaf_overwrite
Linux Exploitation/Wargame 2023. 6. 20. 20:10

⬇ 사용한 배경지식 ⬇ [Heap] Memory Corruption : Use After Free(UAF) (1) [Heap] Exploitation : Unsorted Bin Memory Leak // Name: uaf_overwrite.c // Compile: gcc -o uaf_overwrite uaf_overwrite.c #include #include #include #include struct Human { char name[16]; int weight; long age; }; struct Robot { char name[16]; int weight; void (*fptr)(); }; //Human 구조체와 Robot 구조체 크기 동일 //전역변수 human,romot,custom,c_idx ..

article thumbnail
[Heap] Exploitation : fastbin dup & poisoning
Linux Exploitation/Heap 2023. 6. 16. 12:06

이번 포스트는 [Heap] Exploitation : Double Free Bug을 알아야 읽을 수 있다. Fastbin dup & poisoning Fastbin dup fastbin dup은 double free bug을 통해 이미 할당된 청크에 다른 청크를 또 할당하는 기법이다. 아까 위에서 재할당을 통해서 ptr3만 0x602030을 가리키게 했지만 만약 추가적으로 ptr4,ptr5로 두번이나 재할당하게 되면 ptr5또한 0x602030을 가리키게 된다. 그래서 0x602030에 두개의 청크가 할당되게된다. Fastbin Poisoning fastbin poisoning은 이미 해제된 힙 청크의 fd를 조작하여 임의의 주소에 힙 청크를 할당할 수 있게 하는 공격이다. 아까 위에서 ptr3이 0x6..