diff --git a/pom.xml b/pom.xml index cc3c2629..a8353e24 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-core - 2.14.1 + 2.15.0 diff --git a/src/main/java/CommandInjection.java b/src/main/java/CommandInjection.java new file mode 100644 index 00000000..98b7c75b --- /dev/null +++ b/src/main/java/CommandInjection.java @@ -0,0 +1,11 @@ +import java.io.*; +import javax.servlet.http.HttpServletRequest; + +public class CommandInjection { + public static Process runCmd(HttpServletRequest request) throws IOException { + String filename = request.getParameter("filename"); + ProcessBuilder builder = new ProcessBuilder("cat", filename); + Process process = builder.start(); + return(process); + } +}