看板娘加载中
161 字
1 分钟
ctfshow stack overflow pwn66

shot 1

shot 2

shot 3

shot 4

这里的 check() 函数 "ZZJ loves shell_code,and here is a gift:" 只校验了 shellcode 的字符是否属于该字符串,没有校验顺序。因此有要输入有奇奇怪怪要求的 shellcode 了。

shot 5

按 “A”

shot 6

可惜这些字符组不成完整的 shellcode。所以要想办法让第一位为 \x00 来绕过检查机制。注意后续访问的也是 buf 的首地址,也就是说从 \x00 开始访问,这个 \x00 一定要有意义。

shot 7

直接打一个 "\x00" 是打不通的。我看网上别人的 wp 里,用 b'\x00B\x00' 就打通了。

shot 8

shot 9

ctfshow{1b5bc9d7-5d87-4305-bda3-d23c5597a260}

为什么呢?

ctfshow stack overflow pwn66
https://alf-ovo.cn/posts/ctfshow-stack-overflow-pwn66/
作者
AlF
发布于
2026-05-13
许可协议
CC BY-NC-SA 4.0