Example #1
0
    def startTLS(self):
        """
        Execute a startTLS on both the client and server side.
        """
        contextForClient = ServerTLSContext(self.config.privateKeyFileName,
                                            self.config.certificateFileName)
        contextForServer = ClientTLSContext()

        self.client.tcp.startTLS(contextForClient)
        self.server.tcp.startTLS(contextForServer)
Example #2
0
    def startTLS(self, onTlsReady: typing.Callable[[], None]):
        """
        Execute a startTLS on both the client and server side.
        """
        self.onTlsReady = onTlsReady

        # Establish TLS tunnel with target server...
        contextForServer = ClientTLSContext()
        self.server.tcp.startTLS(contextForServer)

        # Establish TLS tunnel with client.
        reactor.callLater(1, self.doClientTls)
Example #3
0
    def onConnectionConfirm(self, pdu):
        """
        Called when the X224 layer is connected.
        """
        self.log.debug("Connection Confirm received")

        parser = NegotiationResponseParser()
        response = parser.parse(pdu.payload)

        if response.type == NegotiationType.TYPE_RDP_NEG_FAILURE:
            self.log.error(
                "Server returned a TYPE_RDP_NEG_FAILURE packet, most likely because NLA is "
                "enforced by the server and the MITM does not handle NLA.")

        if response.tlsSelected:
            self.tcp.startTLS(ClientTLSContext())
            self.useTLS = True

        self.server.onConnectionConfirm(pdu)
Example #4
0
 def startTLS(self):
     self.log.info("Starting TLS")
     self.tcp.startTLS(ClientTLSContext())