def setUp(self): ''' This is a rather complex setUp since I need to move the exception_raise.py plugin to the plugin directory in order to be able to run it afterwards. In the tearDown method, I'll remove the file. ''' self.src = os.path.join('core', 'controllers', 'tests', 'exception_raise.py') self.dst = os.path.join('plugins', 'crawl', 'exception_raise.py') shutil.copy(self.src, self.dst) self.w3afcore = w3afCore() target_opts = create_target_option_list(URL('http://moth/')) self.w3afcore.target.set_options(target_opts) self.w3afcore.plugins.set_plugins([ 'exception_raise', ], 'crawl') # Verify env and start the scan self.w3afcore.plugins.init_plugins() self.w3afcore.verify_environment() self.exception_plugin = self.w3afcore.plugins.plugins['crawl'][0]
def test_send_mangled(self): self.w3afcore.plugins.set_plugins(['self_reference'], 'evasion') self.w3afcore.plugins.set_plugins(['sqli'], 'audit') target_opts = create_target_option_list(URL('http://moth/')) self.w3afcore.target.set_options(target_opts) # Verify env and start the scan self.w3afcore.plugins.init_plugins() self.w3afcore.verify_environment() sref = self.w3afcore.plugins.plugins['evasion'][0] def return_arg(request): return request sref.modify_request = MagicMock(side_effect=return_arg) self.w3afcore.start() self.assertGreater(sref.modify_request.call_count, 15)
def setUp(self): ''' This is a rather complex setUp since I need to move the exception_raise.py plugin to the plugin directory in order to be able to run it afterwards. In the tearDown method, I'll remove the file. ''' self.src = os.path.join('core', 'controllers', 'tests', 'exception_raise.py') self.dst = os.path.join('plugins', 'crawl', 'exception_raise.py') shutil.copy(self.src, self.dst) self.w3afcore = w3afCore() target_opts = create_target_option_list(URL('http://moth/')) self.w3afcore.target.set_options(target_opts) self.w3afcore.plugins.set_plugins(['exception_raise',], 'crawl') # Verify env and start the scan self.w3afcore.plugins.init_plugins() self.w3afcore.verify_environment() self.exception_plugin = self.w3afcore.plugins.plugins['crawl'][0]
def setUp(self): """ This is a rather complex setUp since I need to move the count.py plugin to the plugin directory in order to be able to run it afterwards. In the tearDown method, I'll remove the file. """ self.src = os.path.join("core", "controllers", "tests", "count.py") self.dst = os.path.join("plugins", "crawl", "count.py") shutil.copy(self.src, self.dst) self.w3afcore = w3afCore() target_opts = create_target_option_list(URL("http://moth/")) self.w3afcore.target.set_options(target_opts) self.w3afcore.plugins.set_plugins(["count"], "crawl") # Verify env and start the scan self.w3afcore.plugins.init_plugins() self.w3afcore.verify_environment() self.count_plugin = self.w3afcore.plugins.plugins["crawl"][0]