mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 12:52:44 +08:00
feat: 增加Tomcat测试环境
This commit is contained in:
parent
1f860f22c8
commit
57b6d41737
17
TestDocker/Tomcat/Dockerfile
Normal file
17
TestDocker/Tomcat/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM tomcat:9.0-jdk8
|
||||||
|
|
||||||
|
# 删除默认应用
|
||||||
|
RUN rm -rf /usr/local/tomcat/webapps/*
|
||||||
|
|
||||||
|
# 复制tomcat-users.xml配置文件
|
||||||
|
COPY tomcat-users.xml /usr/local/tomcat/conf/
|
||||||
|
|
||||||
|
# 允许远程访问manager
|
||||||
|
COPY context.xml /usr/local/tomcat/webapps.dist/manager/META-INF/
|
||||||
|
COPY context.xml /usr/local/tomcat/webapps.dist/host-manager/META-INF/
|
||||||
|
|
||||||
|
# 复制默认应用
|
||||||
|
RUN cp -r /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps/
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["catalina.sh", "run"]
|
2
TestDocker/Tomcat/README.txt
Normal file
2
TestDocker/Tomcat/README.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
docker build -t tomcat-weak .
|
||||||
|
docker run -d --name tomcat-test -p 8080:8080 tomcat-weak
|
5
TestDocker/Tomcat/context.xml
Normal file
5
TestDocker/Tomcat/context.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Context antiResourceLocking="false" privileged="true" >
|
||||||
|
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
|
||||||
|
allow=".*" />
|
||||||
|
</Context>
|
19
TestDocker/Tomcat/tomcat-users.xml
Normal file
19
TestDocker/Tomcat/tomcat-users.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?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="admin" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
|
||||||
|
<user username="tomcat" password="tomcat" roles="manager-gui"/>
|
||||||
|
<user username="both" password="both" roles="manager-gui,admin-gui"/>
|
||||||
|
<user username="root" password="root123" roles="manager-gui,manager-script"/>
|
||||||
|
|
||||||
|
</tomcat-users>
|
Loading…
Reference in New Issue
Block a user