buuctf_pwn_jarvisoj-fm_writeup
buuctf pwn 板块 jarvisoj_fm 题目,考察 x86 栈上格式化字符串漏洞
- checksec
1 | [*] '/mnt/hgfs/CTF/Pwn_Study/pwn_exercise/BUUCTF/fm' |
- IDA32
1 | int __cdecl main(int argc, const char **argv, const char **envp) |
让 x=4 就可以拿到 shell, 看样子因该是格式化字符串漏洞,验证:
1 | ❯ ./fm |
看到输入的 aaaa 在第十一位输出了 61616161 , 那修改 x 的值就很简单了:
思路
- 输入 x 的地址
- 格式化字符串漏洞,利用
%11$n,将四字节( str(4) )写入%11,也就是 x 的地址的值 - Get shell
解题脚本
1 | from pwn import * |
- Title: buuctf_pwn_jarvisoj-fm_writeup
- Author: xekOnerR
- Created at : 2025-04-20 22:21:51
- Updated at : 2025-04-21 15:02:55
- Link: https://xekoner.xyz/2025/04/20/buuctf_pwn_jarvisoj-fm-writeup/
- License: This work is licensed under CC BY-NC-SA 4.0.