fork download
  1. import java.io.*;
  2. import java.util.*;
  3. import java.util.zip.*;
  4. class Evil {
  5. public static void main(String[] args) throws Exception {
  6. ZipFile zip = new ZipFile("tested.zip");
  7. Enumeration<? extends ZipEntry> entries = zip.entries();
  8. while(entries.hasMoreElements()) {
  9. ZipEntry entry = entries.nextElement();
  10. System.out.print(entry.isDirectory() ? "dir: " : "file: ");
  11. System.out.println(entry.getName());
  12. }
  13. }
  14. }
Success #stdin #stdout 0.08s 2184192KB
stdin
Standard input is empty
stdout
dir: META-INF/
file: META-INF/MANIFEST.MF
file: Evil.class