예제 #1
0
    def __init__(self,
                 ip,
                 port,
                 urlOpener=ExtendedUrllib(),
                 proxy_cert=Proxy.SSL_CERT):
        """
        :param ip: IP address to bind
        :param port: Port to bind
        :param urlOpener: The urlOpener that will be used to open the requests
                          that arrive from the browser
        :param proxyHandler: A class that will know how to handle requests
                             from the browser
        :param proxy_cert: Proxy certificate to use, this is needed for
                           proxying SSL connections.
        """
        Proxy.__init__(self, ip, port, urlOpener, w3afLocalProxyHandler,
                       proxy_cert)

        self.daemon = True
        self.name = 'LocalProxyThread'

        # Internal vars
        self._request_queue = Queue.Queue()
        self._edited_requests = {}
        self._edited_responses = {}

        # User configured parameters
        self._methods_to_trap = set()
        self._what_to_trap = re.compile('.*')
        self._what_not_to_trap = re.compile(
            '.*\.(gif|jpg|png|css|js|ico|swf|axd|tif)$')
        self._trap = False
        self._fix_content_length = True
예제 #2
0
    def __init__(self, ip, port, urlOpener=ExtendedUrllib(),
                 proxy_cert=Proxy.SSL_CERT):
        """
        :param ip: IP address to bind
        :param port: Port to bind
        :param urlOpener: The urlOpener that will be used to open the requests
                          that arrive from the browser
        :param proxyHandler: A class that will know how to handle requests
                             from the browser
        :param proxy_cert: Proxy certificate to use, this is needed for
                           proxying SSL connections.
        """
        Proxy.__init__(self, ip, port, urlOpener, w3afLocalProxyHandler,
                       proxy_cert)

        self.daemon = True
        self.name = 'LocalProxyThread'

        # Internal vars
        self._request_queue = Queue.Queue()
        self._edited_requests = {}
        self._edited_responses = {}

        # User configured parameters
        self._methods_to_trap = set()
        self._what_to_trap = re.compile('.*')
        self._what_not_to_trap = re.compile('.*\.(gif|jpg|png|css|js|ico|swf|axd|tif)$')
        self._trap = False
        self._fix_content_length = True
예제 #3
0
    def __init__(self, ip, port, url_opener):
        """
        :param ip: IP address to bind
        :param port: Port to bind
        :param url_opener: The urlOpener that will be used to open the requests
                          that arrive from the browser
        """
        Proxy.__init__(self,
                       ip,
                       port,
                       url_opener,
                       handler_klass=InterceptProxyHandler,
                       name='LocalProxyThread')

        # Internal vars
        self.requests_pending_modification = Queue.Queue()
        self.requests_already_modified = Queue.Queue()

        # User configured parameters
        self.methods_to_trap = set()
        self.what_to_trap = re.compile(self.DEFAULT_TRAP)
        self.what_not_to_trap = re.compile(self.DEFAULT_NO_TRAP)
        self.trap = False

        # Forward to handler
        # pylint: disable=E1103
        self.on_request_edit_finished = self._master.on_request_edit_finished
예제 #4
0
    def __init__(self, ip, port, url_opener):
        """
        :param ip: IP address to bind
        :param port: Port to bind
        :param url_opener: The urlOpener that will be used to open the requests
                          that arrive from the browser
        """
        Proxy.__init__(self, ip, port, url_opener,
                       handler_klass=InterceptProxyHandler,
                       name='LocalProxyThread')

        # Internal vars
        self.requests_pending_modification = Queue.Queue()
        self.requests_already_modified = Queue.Queue()

        # User configured parameters
        self.methods_to_trap = set()
        self.what_to_trap = re.compile(self.DEFAULT_TRAP)
        self.what_not_to_trap = re.compile(self.DEFAULT_NO_TRAP)
        self.trap = False

        # Forward to handler
        # pylint: disable=E1103
        self.on_request_edit_finished = self._master.on_request_edit_finished