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