[Write-up Revenge] 第十九届 CISCN & CCB 初赛 easy_rw
哎哎,赛后半小时才打通本地,第一次接触 off-by-null 题目给了 2 个 binary,libc 版本 2.31,咱们分开来看 1 Proxy1.1 程序分析用 IDA 打开,看 strings view 可以发现套了一层 UPX 壳,直接脱开 主函数监听本地 8888 端口,fork 子进程处理连接 分析 sub_2CAA,接收一个 TLV,格式如下 4 bytes 4 bytes left bytes command payload’s length payload 执行 command 前读 config.txt 得到 n 和 d 保存在 .bss 节上不同 command 功能如下 command function 0xFFFF2525 认证:按小端序接收一个数 x,快速模幂计算 $x^d\enspace\text{mod}\enspace n$,与字符串 ‘hack’ 的哈希进行比较,相同则返回 cookie 0x7F687985 转发:先验证 cookie,然后将 paylaod 剩下部分转发给本地 7777 端口 0x8...
[Write-up Revenge] HKCERT CTF 2025 (Qualifying Round) piano -- Exploiting UAF in QuickJS
挺有意思的一道题,比赛时没有做出来,赛后多花了几天钻研了一下,所以标题取名 Revenge 1 Initial Analysis1.1 The challenge 题目给了需要的库,只需要 patchelf 一下就可以,给的 elf 是 QuickJS version 2025-09-13,这是一个开源的 JavaScript 解释器 12345678910111213141516171819(pwn)secreu@Vanilla:~/code/HKCERT2025/piano$ ./qjs -hQuickJS version 2025-09-13usage: qjs [options] [file [args]]-h --help list options-e --eval EXPR evaluate EXPR-i --interactive go to interactive mode-m --module load as ES6 module (default=autodetect) --script load ...
[pwnable.tw] Starbound
1 程序分析32 位,没开 PIE 123456789(pwn)secreu@Vanilla:~/code/pwnable/starbound$ checksec --file=starbound[*] '/home/secreu/code/pwnable/starbound/starbound' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000) FORTIFY: Enabled Stripped: No 一个小游戏,看起来很复杂 init 函数最后的 cmd_go_back 将 show_main_menu 函数的地址存放在了 .bss:0805817C 上,所以该地址其实是一个 hook,将其命名为 show_options_hook,在 main 函数中会循环调用之,用来展示不同的菜单选...
[Write-up] DASCTF 2025下半年赛 PWN
大伙儿第一次 AK PWN 部分,三道题分别由三个人完成,其中笔者做的是 CV_Manager 1 rcms 保护全开,存在 UAF 第一次任意分配泄露 gift 函数地址、elf 基地址 第二次任意分配到 stdout,泄露 libc 2.28 的 libc,存在 __free_hook,改写为 gift 函数 劫持 __free_hook 到 gift,打 orw exp 如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122from pwn import *from optparse import Option...
[pwnable.tw] Death Note
1 程序分析32 位,基本上啥保护都没开,这里显示开了 Canary,但是实际上反编译看是没有的 12345678910(pwn) secreu@Vanilla:~/code/pwnable/death_note$ checksec --file=death_note[*] '/home/secreu/code/pwnable/death_note/death_note' Arch: i386-32-little RELRO: Partial RELRO Stack: Canary found NX: NX unknown - GNU_STACK missing PIE: No PIE (0x8048000) Stack: Executable RWX: Has RWX segments Stripped: No 1.1 add_note输入一个 index,然后输入 name,用 strdup 分配堆块并将输入的 nam...
[Write-up] 2025华为杯研赛 Note Manager
1 程序分析64 位保护全开,libc 版本是 2.35-0ubuntu3.11 12345678910(pwn) secreu@Vanilla:~/code/2025HWB/note_manager$ checksec --file=note_manager[*] '/home/secreu/code/2025HWB/note_manager/note_manager' Arch: amd64-64-little RELRO: Full RELRO Stack: Canary found NX: NX enabled PIE: PIE enabled RUNPATH: b'/home/secreu/glibc-all-in-one/libs/2.35-0ubuntu3.11_amd64/'(pwn) secreu@Vanilla:~/code/2025HWB/note_manager$ strings libc.so.6 | grep ...
[pwnable.tw] seethefile
1 程序分析32 位,只开了 NX,但是实际上也开了 Canary,libc 版本为 2.23 12345678910(pwn) secreu@Vanilla:~/code/pwnable/seethefile$ checksec --file=seethefile[*] '/home/secreu/code/pwnable/seethefile/seethefile' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000) Stripped: No(pwn) secreu@Vanilla:~/code/pwnable/seethefile$ strings libc_32.so.6 | grep "Ubuntu GLIBC"GNU C Library (Ubuntu GLIBC 2.23-...
[pwnable.tw] Tcache Tear
1 程序分析64 位,没开 PIE,Full RELRO 不能改 GOT 表了,libc 版本 2.27 12345678910(pwn) secreu@Vanilla:~/code/pwnable/tcache_tear$ strings libc-18292bd12d37bfaf58e8dded9db7f1f5da1192cb.so | grep "Ubuntu GLIBC"GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27.(pwn) secreu@Vanilla:~/code/pwnable/tcache_tear$ checksec --file=tcache_tear[*] '/home/secreu/code/pwnable/tcache_tear/tcache_tear' Arch: amd64-64-little RELRO: Full RELRO Stack: Canary fou...
[pwnable.tw] Re-alloc
1 程序分析64 位,没开 PIE,libc 版本为 2.29 1234567891011(pwn) secreu@Vanilla:~/code/pwnable/re-alloc$ checksec --file=re-alloc[*] '/home/secreu/code/pwnable/re-alloc/re-alloc' Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x400000) FORTIFY: Enabled Stripped: No(pwn) secreu@Vanilla:~/code/pwnable/re-alloc$ strings libc-9bb401974abeef59efcdd0ae35c5fc0ce63d3e7b.so | grep "Ubuntu GLIBC"G...
[pwnable.tw] applestore
1 程序分析32 位程序,没开 PIE,部分写保护,libc 版本为 2.23 12345678910(pwn) secreu@Vanilla:~/code/pwnable/applestore$ checksec --file=applestore[*] '/home/secreu/code/pwnable/applestore/applestore' Arch: i386-32-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x8048000) Stripped: No(pwn) secreu@Vanilla:~/code/pwnable/applestore$ strings libc_32.so.6 | grep "Ubuntu GLIBC"GNU C Library (Ubuntu GLIBC 2.23-0ubuntu5) s...