TSC CTF 2025 WriteUP

TSC CTF 2025
gamble_bad_bad
check jackpot_value == 777
蓋掉 buf[20] 777 -> jackpot_value
exp : aaaaaaaaaaaaaaaaaaaa777
What_Happened
1 | encrypted_flag = [ |
TSC{I_Think_you_Fix_2ome_3rror}
Chill_checker
1 | def reverse_transform(a1): |
ENBFQVPZ
localstack
看 Stack 大概是oob
pop , push 40 會出現
xinfo 93824992247152
可以看到這邊定位到 __do_global_dtors_aux
這邊 leak address 就可以算出 process 的 base address
繼續 pop stack 可以看到他慢慢的往 低位置移動
多 pop 幾次就會到 ret function 了
最後再依序 push ret , print_flag 的 address 就可以bypass canary 跳到 print_flag function 去
1 | from pwn import * |
TSC{1_g07_0_point_1n_D474_57ruc7ur3_d0_U_hAv3_anY_1d3a?_haha}
Globalstack
1 | $patchelf --set-interpreter ./share/ld-2.31.so ./share/globalstack |
- pop 一次後會 leak
<_IO_2_1_stdin>
__.*_hook@@GLIBC_2.2.5
- About hook
- one_gadget
execve("/bin/sh", r15, rdx)
- Ans: call
<__after_morecore_hook>
後加上 gadget
1 | #!/usr/bin/python3 |
TSC{fr33_h00k_1s_nO_L0ng3r_fr33_AFt3r_Glibc_2.34_^_^_2d9e302796bcf60e}
Other Writeup
- Title: TSC CTF 2025 WriteUP
- Author: Chihhh Linnn
- Created at : 2025-01-27 22:00:07
- Updated at : 2025-01-27 22:00:07
- Link: https://chihhhs.github.io/2025/01/27/tscctf2025/
- License: This work is licensed under CC BY-NC-SA 4.0.