Ejemplo n.º 1
0
    def __init__(self,
                 apptunnel_client,
                 parameters=["facebook.com", "/apptunnel/main.html"]):

        self.session_id = 0
        self.packet_id = 0
        self.apptunnel_client = apptunnel_client
        self.HTTPHostParameter = parameters[0]
        self.HTTPURLParameter = parameters[1]
        self.HTTPHeader = self.create_HTTP_header()
        self.logger = add_logger("main.http_apps")
Ejemplo n.º 2
0
    def __init__(self, send_queue, connections, appmodule, is_tunnel_sender=False, is_client=False):

        Thread.__init__(self)

        self.send_queue = send_queue
        self.connections = connections
        self.appmodule_main = appmodule
        self.is_tunnel_sender = is_tunnel_sender
        #
        if is_client and is_tunnel_sender:
            self.connections[0].set_keepalive_timer(0)
        self.logger = add_logger("main.servers.senddata")
        self.running = True
Ejemplo n.º 3
0
    def __init__(self, address, port, client, apptunnel, receive_queue, send_queue,
                 name="Default", use_ssl=False, certificate_file="", key_file=None, access_internal=True):

        Thread.__init__(self)

        self.socket_list = []
        self.connections = []
        self.receive_queue = receive_queue
        self.send_queue = send_queue
        self.address = address
        self.port = port
        # Main socket is used for accepting new connection, not receiving data
        self.new_socket = None
        self.server_state = True
        self.client = client
        self.access_internal = access_internal
        self.apptunnel = apptunnel
        self.logger = add_logger("main.servers.{}".format(name))
        self.name = name
        self.use_ssl = use_ssl
        self.certificate_file = certificate_file
        self.key_file = key_file
Ejemplo n.º 4
0
    def __init__(self, proxy_connections, apptunnel_connections,
                 apptunnel_queue, proxy_queue, apptunnel_send_queue, proxy_send_queue,
                 app_instance, proxy_server_thread, is_client, proxy_ip = None, proxy_port = None, access_internal = True):

        Thread.__init__(self)

        self._stop = Event()

        self.proxy_connections = proxy_connections
        self.apptunnel_connections = apptunnel_connections
        self.apptunnel_queue = apptunnel_queue
        self.apptunnel_send_queue = apptunnel_send_queue
        self.proxy_queue = proxy_queue
        self.proxy_send_queue = proxy_send_queue
        self.app_instance = app_instance
        self.proxy_server_thread = proxy_server_thread
        self.is_client = is_client
        self.access_internal = access_internal
        self.proxy_ip = proxy_ip
        self.proxy_port = proxy_port
        self.logger = add_logger("main.workers")
        self.payload_with_problem = ""
        if use_builtin_base64: self.logger.debug("Using builtin base64 library. To increase connection "
                                                 "speed use pybase64 library.")
Ejemplo n.º 5
0
    def __init__(self, HTTPPayload="", HTTPHeader=""):

        self.HTTPHeader = HTTPHeader
        self.HTTPPayload = HTTPPayload
        self.logger = add_logger("main.http_apps.packet")