Exemple #1
0
def get_default_temp_db_instance():
    global temp_default_db
    
    if temp_default_db is None:
        create_temp_dir()
        temp_default_db = SQLiteDBMS('%s/main.db' % get_temp_dir())
    return temp_default_db
Exemple #2
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = ajax()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
     kb.kb.clear('ajax', 'ajax')
Exemple #3
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = ajax()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
     kb.kb.clear('ajax', 'ajax')
Exemple #4
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = symfony()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
     self.http_resp = partial(
         HTTPResponse, code=200, geturl=self.url, original_url=self.url, _id=1)
Exemple #5
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
     CachedXMLNode.create_cache_path()
     FindingsCache.create_cache_path()
     HistoryItem().init()
     self.w3af_core = w3afCore()
     self.w3af_core.status.start()
Exemple #6
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = symfony()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
     self.http_resp = partial(HTTPResponse,
                              code=200,
                              geturl=self.url,
                              original_url=self.url,
                              _id=1)
Exemple #7
0
    def setUp(self):
        # Start the proxy server
        create_temp_dir()

        self._proxy = InterceptProxy(self.IP, 0, ExtendedUrllib())
        self._proxy.start()
        self._proxy.wait_for_start()

        port = self._proxy.get_port()

        # Build the proxy opener
        proxy_url = "http://%s:%s" % (self.IP, port)
        proxy_handler = urllib2.ProxyHandler({"http": proxy_url, "https": proxy_url})
        self.proxy_opener = urllib2.build_opener(proxy_handler, urllib2.HTTPHandler)
Exemple #8
0
    def setUp(self):
        # Start the proxy server
        create_temp_dir()

        self._proxy = LocalProxy(self.IP, 0)
        self._proxy.start()
        self._proxy.wait_for_start()
        
        port = self._proxy.get_port()

        # Build the proxy opener
        proxy_handler = urllib2.ProxyHandler({"http": "http://%s:%s"
                                              % (self.IP, port)})
        self.proxy_opener = urllib2.build_opener(proxy_handler,
                                                 urllib2.HTTPHandler)
Exemple #9
0
    def setUp(self):
        # Start the proxy server
        create_temp_dir()

        self._proxy = InterceptProxy(self.IP, 0, ExtendedUrllib())
        self._proxy.start()
        self._proxy.wait_for_start()

        port = self._proxy.get_port()

        # Build the proxy opener
        proxy_handler = urllib2.ProxyHandler(
            {'http': 'http://%s:%s' % (self.IP, port)})
        self.proxy_opener = urllib2.build_opener(proxy_handler,
                                                 urllib2.HTTPHandler)
Exemple #10
0
    def setUp(self):
        # Start the proxy server
        create_temp_dir()

        self._proxy = LocalProxy(self.IP, 0)
        self._proxy.start()
        self._proxy.wait_for_start()

        port = self._proxy.get_port()

        # Build the proxy opener
        proxy_handler = urllib2.ProxyHandler(
            {"http": "http://%s:%s" % (self.IP, port)})
        self.proxy_opener = urllib2.build_opener(proxy_handler,
                                                 urllib2.HTTPHandler)
    def test_upload_file_mock(self):
        exec_method = commands.getoutput
        os = 'linux'

        create_temp_dir()
        cf.cf.save('interface', 'lo')
        cf.cf.save('local_ip_address', '127.0.0.1')
        inbound_port = self.get_usable_port('127.0.0.1')
        echo_linux = ClientlessReverseHTTP(exec_method, os, inbound_port)

        self.assertTrue(echo_linux.can_transfer())

        file_len = 8195
        file_content = 'A' * file_len
        echo_linux.estimate_transfer_time(file_len)

        temp_file_inst = tempfile.NamedTemporaryFile()
        temp_fname = temp_file_inst.name
        upload_success = echo_linux.transfer(file_content, temp_fname)

        self.assertTrue(upload_success)
    def test_upload_file_mock(self):
        exec_method = commands.getoutput
        os = 'linux'

        create_temp_dir()
        cf.cf.save('interface', 'lo')
        cf.cf.save('local_ip_address', '127.0.0.1')
        inbound_port = self.get_usable_port('127.0.0.1')
        echo_linux = ClientlessReverseHTTP(exec_method, os, inbound_port)

        self.assertTrue(echo_linux.can_transfer())

        file_len = 8195
        file_content = 'A' * file_len
        echo_linux.estimate_transfer_time(file_len)

        temp_file_inst = tempfile.NamedTemporaryFile()
        temp_fname = temp_file_inst.name
        upload_success = echo_linux.transfer(file_content, temp_fname)

        self.assertTrue(upload_success)
Exemple #13
0
 def setUp(self):
     create_temp_dir()
Exemple #14
0
 def setUp(self):
     create_temp_dir()
     self.vdb = VariantDB()
Exemple #15
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = html_comments()
 def setUp(self):
     self.temp_dir = create_temp_dir()
Exemple #17
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = wsdl_greper()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
Exemple #18
0
 def setUp(self):
     self.temp_dir = create_temp_dir()
Exemple #19
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = cache_control()
Exemple #20
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = cross_domain_js()
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = form_autocomplete()
Exemple #22
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
     HistoryItem().init()
Exemple #23
0
 def setUp(self):
     MiscSettings().set_default_values()
     create_temp_dir()
     self.vdb = VariantDB()
Exemple #24
0
 def setUp(self):
     create_temp_dir()
     self.pks_se = pks(ExtendedUrllib())
Exemple #25
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = cache_control()
Exemple #26
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = oracle()
 def setUp(self):
     create_temp_dir()
     self.plugin = strange_http_codes()
Exemple #28
0
 def setUp(self):
     MiscSettings().set_default_values()
     create_temp_dir()
     self.vdb = VariantDB()
Exemple #29
0
 def setUp(self):
     create_temp_dir()
     self.plugin = sed()
     self.url = URL("http://www.w3af.com/")
     self.request = HTTPRequest(self.url)
Exemple #30
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = form_autocomplete()
 def setUp(self):
     create_temp_dir()
     self.plugin = strict_transport_security()
 def setUp(self):
     create_temp_dir()
     self.plugin = content_sniffing()
Exemple #33
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
     CachedXMLNode.create_cache_path()
     FindingsCache.create_cache_path()
     HistoryItem().init()
Exemple #34
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = meta_tags()
Exemple #35
0
 def test_special_chars_in_db_filename(self):
     kb.kb.cleanup()
     cf.cf.cleanup()
     cf.cf.save('session_name', 'db_foo-:3128!.db')
     create_temp_dir()
     h1 = HistoryItem()
Exemple #36
0
 def init():
     create_temp_dir()
     HistoryItem().init()
Exemple #37
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
     CachedXMLNode.create_cache_path()
     FindingsCache.create_cache_path()
     HistoryItem().init()
Exemple #38
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = oracle()
 def setUp(self):
     create_temp_dir()
     self.plugin = strange_http_codes()
Exemple #40
0
 def setUp(self):
     create_temp_dir()
     self.pks_se = pks(ExtendedUrllib())
Exemple #41
0
 def setUp(self):
     create_temp_dir()
     self.plugin = expect_ct()
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = strange_headers()
Exemple #43
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
     HistoryItem().init()
Exemple #44
0
 def init():
     create_temp_dir()
     HistoryItem().init()
Exemple #45
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = blank_body()
     self.url = URL('http://www.w3af.com/')
     self.request = FuzzableRequest(self.url)
Exemple #46
0
 def setUp(self):
     kb.kb.cleanup()
     create_temp_dir()
Exemple #47
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = cross_domain_js()
 def setUp(self):
     create_temp_dir()
     self.plugin = strict_transport_security()
Exemple #49
0
 def setUp(self):
     create_temp_dir()
     self.plugin = sed()
     self.url = URL('http://www.w3af.com/')
     self.request = HTTPRequest(self.url)
Exemple #50
0
 def setUp(self):
     create_temp_dir()
Exemple #51
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = get_emails()
Exemple #52
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = strange_headers()
Exemple #53
0
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = url_session()
Exemple #54
0
 def setUp(self):
     create_temp_dir()
     self.vdb = VariantDB()
 def setUp(self):
     create_temp_dir()
     kb.kb.cleanup()
     self.plugin = wsdl_greper()
     self.url = URL("http://www.w3af.com/")
     self.request = FuzzableRequest(self.url)