sslproto.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:SameKeyProxy 作者: xzhou 项目源码 文件源码
def configure_client_socket(self):
        """This is the socket from mallory to the victim"""
        self.log.debug("SSLProto: Getting common name from socket")
        # Destination is an ssl socket to the server. 
        cert_from_remote_server = self.destination.getpeercert(True)
        # fake_key is the private key and we need to store it somewhere. 
        fake_cert, fake_key = cert_auth.ca.get_fake_cert_and_key_filename(cert_from_remote_server)

        self.log.debug("SSLProtocol: private key" + fake_key)

        self.log.debug("SSLProto: Starting Socket")
        try:
            self.source = ssl.wrap_socket(self.source,
              server_side=True, 
              certfile=fake_cert, 
              keyfile=fake_key,
              ssl_version=ssl.PROTOCOL_SSLv23)
        except:
            self.log.debug("SSLProto: Client Closed SSL Connection")
            traceback.print_exc()       
        self.log.debug("SSLProto: WoWzer!!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号