MCPcopy Index your code
hub / github.com/Afant1/JavaSearchTools / Test

Method Test

JarFileReader.java:6–20  ·  view source on GitHub ↗
(String jarName,String classname)

Source from the content-addressed store, hash-verified

4
5public class JarFileReader {
6 public static void Test(String jarName,String classname) throws IOException {
7 URL url1 = new URL("jar:file:"+jarName.replaceAll("\\","/")+"!"+classname);
8 URL url2 = new URL("jar:file:"+jarName.replaceAll("\\","/")+"!"+classname);
9// 标准输入流
10 try {
11 InputStream is1 = url1.openStream();
12 InputStream is2 = url2.openStream();
13 if (processEvilPackage(is1)&&processReadObject(is2)) {
14 System.out.println(classname + " this class maybe have XXE!!!!!!!!!");
15 }
16 }catch (Exception e)
17 {
18 System.out.println(classname + " java.io.FileNotFoundException");
19 }
20 }
21
22 private static boolean processEvilPackage(InputStream input) throws IOException {
23 InputStreamReader isr = new InputStreamReader(input);

Callers 1

searchDirMethod · 0.95

Calls 2

processEvilPackageMethod · 0.95
processReadObjectMethod · 0.95

Tested by

no test coverage detected