-
-
[原创] KCTF2501 第一题 少年觉醒 WriteUp
-
发表于: 2025-8-17 16:35 147
-
Step 1
使用windows系统的wsl linux子系统中的file测试目标,如下,显示目标为64位应用
file /mnt/d/pediyctf25/ido/ctf01/checkin.exe /mnt/d/pediyctf25/ido/ctf01/checkin.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Window
Step 2
window命令行运行测试目标,如下,注意到其中的提示信息【Welcome to KCTF 2025!】
d:\pediyctf25\ido\ctf01>checkin.exe Welcome to KCTF 2025! 请输入签到口令:
Step 3
使用IDA加载测试目标,执行相应IDAPython脚本,定位到【Welcome to KCTF 2025!】位置,如下
def loadfbs(file): with open(file,'rb') as fin: return fin.read() import idc import idaapi import pefile fp = idaapi.get_input_file_path() pe = pefile.PE(fp) fbs = loadfbs(fp) fbs.count(b'Welcome to KCTF 2025!') # ==> 1 dbase = idaapi.get_imagebase() idc.jumpto(dbase+pe.get_rva_from_offset(fbs.index(b'Welcome to KCTF 2025!')))

Step 4
通过初步xref交叉引用分析,可知目标是rust编译的工程;也是标准的rust长度字符串结构{char* cstr,size_t len};
同时在【Welcome to KCTF 2025!】后面附近,我们夜发现了其他敏感字符串信息,如下


Step 5
通过【Welcome to KCTF 2025!】的引用,我们初步假定xprint函数名;通过【签到成功】的引用,我们定为到关键业务逻辑,如下

在sub_140001560函数中,我们发现了更加敏感的信息,通过伪码,我们得到【flag{kctf_time_leap_2025}】,尝试提交成功。


最后于 2025-9-2 09:54
被HHHso编辑
,原因:
赞赏
他的文章
赞赏
雪币:
留言: