How to use sus - 2 common examples

To help you get started, we’ve selected a few sus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patins / sus_ssh / sus.py View on Github external
def handle(self):
            try:
                transport = paramiko.Transport(self.request)
                transport.add_server_key(host_key)
                server = SusServer()
                transport.start_server(server=server)

                channel = transport.accept(20)
                if channel is None:
                    raise Exception('No channel')

                server.event.wait(10)
                if not server.event.is_set():
                    raise Exception('No shell')

                channel.send(f"Enter passphrase for key '/Users/{server.sent_username}/.ssh/id_ed25519': ")

                f = channel.makefile("rU")

                passphrase = f.readline().strip("\r\n")
                channel.send(f"\r\nI'm the server, and your passphrase is: {passphrase}\r\n")
github patins / sus_ssh / sus.py View on Github external
except Exception as e:
                traceback.print_exc()
            finally:
                transport.close()


    return SusTCPHandler

class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
    pass

if __name__ == '__main__':
    HOST, PORT, HOST_KEY_FILENAME = '0.0.0.0', 22, 'host.key'
    host_key = paramiko.RSAKey(filename=HOST_KEY_FILENAME)
    SusTCPHandler = build_sus_tcp_handler(host_key)
    server = ThreadedTCPServer((HOST, PORT), SusTCPHandler)
    server.serve_forever()

sus

Really simple static website URL shortener

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis