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 |
Tags
- 2018
- anti
- pico
- shellcode
- pwnable.kr
- BOF
- Read
- picoCTF
- Leak
- PMA
- CANARY
- format
- Bug
- string
- practicalmalwareanalysis
- toddler
- rev
- FSB
- Reverse
- Bottle
- shellcraft
- Toddler's Bottle
- writeup
- pwn
- pwnable
- CTF
- Rookiss
- TUCTF
- ASM
- reversing
Archives
- Today
- Total
제리의 블로그
TJCTF 2018 Online Banking 본문
#asm
, #bof
, #shellcode
Online Banking
90 points Binary Exploitation - Unsolved (100 solves)
Written by nthistle
Try out our new online banking service!
nc problem1.tjctf.org 8005
취약점 발견
7 int verify_pin(char* pin) {
8 char pin_check[PIN_SIZE+1];
9 printf("Please verify your PIN first:\nPIN: ");
10 fgets(pin_check, NAME_SIZE+1, stdin);
11 for(int i = 0; i < 4; i ++) {
12 if(pin[i] != pin_check[i])
13 return 0;
14 }
15 return 1;
16 }
BOF 취약점이
verify_pin()
에 있었습니다.지역변수
pin_check
의 크기는 5 이지만fgets
로 33 만큼 받기 때문에 RIP 컨트롤이 가능합니다.보안 세팅이 되어있지 않은 바이너리는
보통 쉘코드를 메모리에 박는 시나리오를 사용합니다.
시나리오
전역변수 name
에 쉘코드를 삽입하고
verify_pin()
에서 BOF를 통해 리턴주소를
미리 삽입해 놓은 쉘코드의 주소로 덮어쓰는 시나리오입니다.
끝
'CTF > pwnable' 카테고리의 다른 글
DefCamp CTF 2018 lucky Exploit (0) | 2018.09.23 |
---|---|
Nihwk CTF 2018 pwn6 (Frame Pointer Overflow) (0) | 2018.08.28 |
mm @ dimigo2018 (0) | 2018.06.27 |
init @ dimigo2018 (0) | 2018.06.27 |
Config Console @ pico2017 (0) | 2018.05.17 |
Comments