示例#1
0
    def start(self):
        '''
        Starts the work!
        User interface coders: Please remember that you have to call 
        core.plugins.init_plugins() method before calling start.
        
        @return: No value is returned.
        '''
        # If this is not the first scan, I want to clear the old bug data that
        # might be stored in the exception_handler.
        exception_handler.clear()
        
        try:
            self._pre_discovery()
            
            self._fuzzable_request_set.update( self._discover_and_bruteforce() )
            
            if not self._fuzzable_request_set:
                om.out.information('No URLs found during discovery phase.')
                self._w3af_core._end()
                return

            self._post_discovery()
            self._audit()
            self._w3af_core._end()
            
        except w3afException, e:
            self._w3af_core._end(e)
            raise
 def setUp(self):
     exception_handler.clear()
     
     self.status = fake_status()
     self.status.set_running_plugin( 'plugin' )
     self.status.set_phase( 'phase' )
     self.status.set_current_fuzzable_request( 'http://www.w3af.org/' )        
    def tearDown(self):
        if os.path.exists(self.dst):
            os.remove(self.dst)
        
        if os.path.exists(self.dst + 'c'): #pyc file
            os.remove(self.dst + 'c')

        # This is a very special case in which I don't want the assertion in
        # the original tearDown() to trigger on me!
        exception_handler.clear()
        
        super(TestDiscoverExceptions, self).tearDown()