Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- HOST = ''
- PORT = 3333
- bytes_to_receive = 1024
- connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- connection.bind((HOST, PORT))
- connection.listen(5)
- while 1:
- server = connection.accept()
- server.recv(bytes_to_receive)
- username = server.send(raw_input("Enter username: "))
- password = server.send(raw_input("Enter password: "))
- if username == 'xPl0it' and password == 'scar':
- server.send("Login successful!")
- command = server.send(raw_input("Awaiting command: "))
- if command == 'retrieve':
- file_handling = open('SCAR.txt', 'r')
- server.send(file_handling.read())
- elif command == 'exit':
- connection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement