first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
12
base/struts2/2.3.30/Dockerfile
Normal file
12
base/struts2/2.3.30/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM maven:3-jdk-8
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
COPY ./ /usr/src/
|
||||
WORKDIR /usr/src
|
||||
|
||||
RUN set -ex \
|
||||
&& mvn compile jetty:help
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["mvn", "jetty:run"]
|
39
base/struts2/2.3.30/pom.xml
Normal file
39
base/struts2/2.3.30/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.pwntester</groupId>
|
||||
<artifactId>Struts2FileUpload</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Struts2FileUpload Maven Webapp</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>2.3.30</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>Struts2FileUpload</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>9.2.11.v20150529</version>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webApp>
|
||||
<contextPath>/</contextPath>
|
||||
</webApp>
|
||||
<httpConnector>
|
||||
<port>8080</port>
|
||||
</httpConnector>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@@ -0,0 +1,55 @@
|
||||
package org.pwntester.action;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import java.io.File;
|
||||
|
||||
public class FileUploadAction extends ActionSupport {
|
||||
|
||||
private String contentType;
|
||||
private File upload;
|
||||
private String fileName;
|
||||
private String caption;
|
||||
|
||||
public String input() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
public String upload() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String getUploadFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setUploadFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getUploadContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public void setUploadContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public File getUpload() {
|
||||
return upload;
|
||||
}
|
||||
|
||||
public void setUpload(File upload) {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
}
|
||||
|
||||
|
3
base/struts2/2.3.30/src/main/resources/global.properties
Normal file
3
base/struts2/2.3.30/src/main/resources/global.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
struts.messages.error.file.too.large = Uploaded File size is too large
|
||||
struts.messages.error.content.type.not.allowed =File type is not allowed.
|
||||
struts.messages.error.file.extension.not.allowed =File extension is not allowed.
|
25
base/struts2/2.3.30/src/main/resources/struts.xml
Normal file
25
base/struts2/2.3.30/src/main/resources/struts.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.custom.i18n.resources" value="global" />
|
||||
<!-- <constant name="struts.multipart.parser" value="jakarta-stream" /> -->
|
||||
<!--constant name="struts.multipart.maxSize" value="1" /-->
|
||||
|
||||
<package name="default" namespace="/" extends="struts-default">
|
||||
<default-action-ref name="doUpload" />
|
||||
<action name="upload" class="org.pwntester.action.FileUploadAction" method="input">
|
||||
<result>pages/upload.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="doUpload" class="org.pwntester.action.FileUploadAction" method="upload">
|
||||
<result name="input">pages/upload.jsp</result>
|
||||
<result>pages/upload-success.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</struts>
|
17
base/struts2/2.3.30/src/main/webapp/WEB-INF/web.xml
Normal file
17
base/struts2/2.3.30/src/main/webapp/WEB-INF/web.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||
|
||||
<web-app>
|
||||
<display-name>Struts 2 Web Application</display-name>
|
||||
|
||||
<filter>
|
||||
<filter-name>struts2</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>struts2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
</web-app>
|
27
base/struts2/2.3.30/src/main/webapp/pages/upload-success.jsp
Normal file
27
base/struts2/2.3.30/src/main/webapp/pages/upload-success.jsp
Normal file
@@ -0,0 +1,27 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Struts2 Showcase - Fileupload sample</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-header">
|
||||
<h1>Fileupload sample</h1>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<s:actionerror cssClass="alert alert-error"/>
|
||||
<s:fielderror cssClass="alert alert-error"/>
|
||||
<s:form action="doUpload" method="POST" enctype="multipart/form-data">
|
||||
<s:file name="upload" label="File"/>
|
||||
<s:textfield name="caption" label="Caption"/>
|
||||
<s:submit cssClass="btn btn-primary"/>
|
||||
</s:form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
31
base/struts2/2.3.30/src/main/webapp/pages/upload.jsp
Normal file
31
base/struts2/2.3.30/src/main/webapp/pages/upload.jsp
Normal file
@@ -0,0 +1,31 @@
|
||||
<%@ page
|
||||
language="java"
|
||||
contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Struts2 Showcase - Fileupload sample</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-header">
|
||||
<h1>Fileupload sample</h1>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<ul>
|
||||
<li>ContentType: <s:property value="uploadContentType" /></li>
|
||||
<li>FileName: <s:property value="uploadFileName" /></li>
|
||||
<li>File: <s:property value="upload" /></li>
|
||||
<li>Caption:<s:property value="caption" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user