일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- DFC 2022
- master canary
- GOT overwrite
- tcache
- Reversing
- heap
- HackCTF
- malware
- RTL
- H4CKING GAME
- heap exploit
- vtable
- heap feng shui
- shellcode
- Dynamic Analysis
- UAF
- _IO_FILE Arbitrary Address Read
- Lazenca
- DFB
- ROP
- 나뭇잎 책
- __environ
- _IO_FILE
- Android
- DreamHack
- srop
- _IO_FILE Arbitrary Address Write
- K-shield Junior
- seccomp
- BOF
- Today
- Total
목록GOT overwrite (3)
Studying Security

Mitigation Vulnerability Analysis IDA disassembler를 이용해 main함수를 살펴보자 get_tier함수가 v6 = 50이라는 인자를 받는걸 보니 이걸로 tier가 결정되는 것 같다 get_tier함수를 들어가 보니 역시 인자에 따라 tier가 나눠지고 tier마다 다른 return값을 되돌려주는 걸 확인할 수 있음 그럼 이 결과 값을 어디다가 쓸까? 바이너리에 들어있는 함수를 살펴보니 play_game이라는 함수가 존재했다 보면 4라는 인자가 Challenger를 의미하고 이때 우리가 원하는 결과 값인 flag를 출력하는 system함수가 들어있다. 이제 해야할 일을 살펴보면 아래와 같이 정리해 볼 수 있다. get_tier함수에 75보다 큰 인자를 주고 chall..

Mitigation Vulnerability Analysis gdb를 통해 rop 바이너리 파일을 살펴보자 vulnerable_function으로 들어가면 read함수가 보인다. read함수로 [ebp-0x88]영역에 값을 입력해 BOF 공격을 수행할 수 있다. rop문제인 만큼 rop를 위해 필요한 함수와 문자열 주소들을 구하기 위한 payload를 작성해보자 ROP payload 구성 write( 1, read_got, 8 ) → read 주소를 획득 → exploit에 필요한 주소 획득 library_base_address = read 주소 - read_offset system = library_base_address + system_offset read( 0, bss, 10 ) → "/bin/sh..

Mitigation Vulnerability Analysis fgets( [ebp-0x808], 0x400, stdin ) snprintf( [ebp-0x408], 0x400, [ebp-0x808]) [ebp-0x808]을 [ebp-0x408]에 출력 → snprintf함수의 경우 Format String Bug 발생 가능 printf( [ebp-0x408] ) 바이너리 파일 실행 (Format String Bug를 이용하기 위해 stack 확인) flag라는 shell을 따오는 함수가 존재함 → FSB를 이용해 printf의 got를 flag함수의 주소로 got overwrite 실시 → printf가 실행되는 대신 flag함수 실행 Exploit code Result