Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. import socket
  2.  
  3. HOST             = ''
  4. PORT             = 3333
  5.  
  6. connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7. connection.bind((HOST, PORT))
  8. connection.listen(5)
  9.  
  10. username = connection.send(raw_input("Enter username: "))
  11. password = connection.send(raw_input("Enter password: "))
  12.  
  13. if username == 'xPl0it' and password == 'scar':
  14.     connection.send("Login successful!")
  15.  
  16. while 1:
  17.     server          = connection.accept()
  18.     data_to_receive = server.recv(1024)
  19.  
  20.     if data_to_receive:
  21.         command = server.send(raw_input("Awaiting command: "))
  22.         if command == 'retrieve SCAR':
  23.             file_handling = open('SCAR.txt', 'r')
  24.             server.send(file_handling.read())
  25.             file_handling.close()
  26.  
  27.         elif command == 'retrieve xPl0it':
  28.             file_handling = open('xPl0it.txt', 'r')
  29.             server.send(file_handling.read())
  30.             file_handling.close()
  31.  
  32.         elif command == 'closecon':
  33.             server.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement