能力值:
( LV15,RANK:1744 )
|
-
-
[原创]看雪 2024 KCTF 年度赛 第二题 星际生物
补充回复:文末的“出题思路”不知道会被怎样理解,千万别真按这个来出题啊,实际想表达的意思是当前比赛规则不太合理以及给防守方带来的负面引导 难度奖:0解题必然比有解题分数高,想拿防守方第一自然是题目怎么复杂怎么出。但是,这会让攻击方的体验大打折扣。不过,诸如基于1day或新论文的pwn、crypto等,即使做不出来,单看writeup也能学到新知识,攻击方自然有动力积极破解;而加壳加混淆的逆向题则是完全相反的体验了,一来这肯定是重体力劳动,二来即使破解了混淆大概率也只是适应这一道题(相同的时间精力还不如用来破解市面上现有的混淆,至少搞出来能立刻应对一大批现实样本),三来,前述的超难pwn、crypto等,至少出题人一定是会解的,而且需要的知识量和付出的工作量并不会比攻击方少;但是换到以加混淆为考点的reverse,如果出题人给不出合理的去混淆方法,完全可以认定为出题人自己并不会解这道题(至于writeup只给一份序列号生成代码?出题人的题解至少要从攻击方的角度考虑,而不能依靠于仅自己出题时的额外信息(未混淆的代码));当然,本届第三题至少开源了加混淆的代码,已经比过往的一些题目好很多了,点赞作者,不过在此还是希望出题人尽快公开自己的去混淆方法(总不能,出题人自己都没尝试过吧,要真是这样可太过分了)) (当然,现实中的样本,往往面对的各种加壳混淆反调试更加恶心,但这样的任务通常有与之匹配的高额回报。CTF毕竟侧重于技术交流,奖励适中,攻守平衡,出题人会(以不多于攻击方的信息)解自己的题(包括去混淆)应该是验题的一个基本要求;或者,退一步,至少在题目放出时在描述中写清楚,出题人自己有没有尝试过解混淆之类的,给攻击方一个明确的预期) 火力奖:主要问题是,以一血时间衡量难度远远不如以做出人数衡量难度准确。时间因素占比过重,往往容易催生题目的猜谜程度(猜谜总要花时间,而人数基数大猜中的人数也会多)。另外,中午12:00放题,很多人并不能第一时间参与进来(线下赛不存在这个问题),等到晚上再做,可能与一血已经差了一倍的分,已经是严重的不公平了。另外,一血时间有时不能反应真实难度,例如有个别做题人通灵感应确实强大,这不能反应出题目的真实设计。 精致奖:除了前几次有一道BROP的pwn题以外,想要短小精悍难度大,似乎往crypto方向机会更多一些
|
能力值:
( LV15,RANK:1744 )
|
-
-
[KCTF2023 年度赛-Pwn] 第四题 AI控制空间站(VecPass) WriteUp
点赞作者,从解题人的角度考虑的非常全面,包括各种有意无意的坑和解法的稳定性。
题目其实还有两处漏洞,即index为-1时,delete和remake的索引与index做的是无符号比较,所以可以任意取值。对于delete,这相当于能在堆区任意偏移处写12个0,对于remake则是一个堆区任意偏移的四字节常量任意写。
最早没有意识到run函数可以被多次执行,面对15次的限制以为无法通过正常的方式填到vector的最后一项,刚好发现了这两处无符号比较的越界,以为是预期(特别的,create的index用的是有符号比较),没想到是非预期。 所以,可以用remake越界直接填写vector的最后一项,然后delete vector靠前的一项将最后一项的堆块释放,再用delete的越界写0改掉释放堆块的key(显然,这一步对堆块布局的稳定性要求相当高…),破坏tcache double free的检测。index为-1时用delete越界改写后index变为-2,但此后都不能再调用create(否则覆盖了vector堆块前面的头在析构时会出错),所以不能通过正常的方式调用delete触发第二次free。 后来才发现run函数可以调用多次,所以实际触发double free由最后的vector析构完成(发现这里时更坚定的认为这是预期。。。)。 好不容易把one_gadget写入got表,才发现所有的got表项都不满足……上面writeup的是最接近的,有考虑能不能再搞一次任意地址分配改掉堆上内容……由于remake的次数限制不太好搞,再加上不想碰堆风水,以及又发现在两台不同机器上堆地址不一样,还有one_gadget的限制搞不定,放弃……
最后于 2023-9-11 23:36
被mb_mgodlfyn编辑
,原因:
|