简介
此次环境是模拟真实环境,漏洞为弱口令和支持在后台部署war文件
环境说明
Tomcat7+权限分为:
manager(后台管理)
manager-gui 拥有html页面权限
manager-status 拥有查看status的权限
manager-script 拥有text接口的权限,和status权限
manager-jmx 拥有jmx权限,和status权限
host-manager(虚拟主机管理)
admin-gui 拥有html页面权限
在conf/tomcat-users.xml文件中配置用户的权限:
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script" />
</tomcat-users>
搭建环境
使用vulhun和docker搭建真实环境
cd vulhun/tomcat/tomcat8
docker-compose up -d
漏洞测试
打开tomcat管理页面http://your-ip:8080/manager/html,输入弱密码tomcat:tomcat,即可访问后台:
将shell.jsp压缩为zip,再将zip后缀改名为war,然后上传war包
上传war包即可直接getshell。