| skipped 30 lines |
31 | 31 | | splitTerms = term.split(" ") |
32 | 32 | | splitTerms[-1] = splitTerms[-1][:3] #cut down on the last item which should be the version number |
33 | 33 | | proc = subprocess.Popen([_searchsploit, *splitTerms], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
34 | | - | self.wfile.write('{}\n'.format(proc.stdout.read())) |
| 34 | + | self.wfile.write('{}\n'.format(proc.stdout.read()).encode()) |
35 | 35 | | print('[$] Closing connection from {}\n'.format(self.client_address[0])) |
36 | 36 | | except Exception as e: |
37 | 37 | | print("[-] Caught exception {}. Closing this connection.".format(e)) |
38 | | - | self.wfile.write("[-] Server caught {}. Closing Connection".format(e)) |
| 38 | + | self.wfile.write("[-] Server caught {}. Closing Connection".format(e).encode()) |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| skipped 33 lines |