当前位置: 首页>>代码示例>>Python>>正文


Python QSMutant.set_dc方法代码示例

本文整理汇总了Python中w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant.set_dc方法的典型用法代码示例。如果您正苦于以下问题:Python QSMutant.set_dc方法的具体用法?Python QSMutant.set_dc怎么用?Python QSMutant.set_dc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant的用法示例。


在下文中一共展示了QSMutant.set_dc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_delay_controlled_random

# 需要导入模块: from w3af.core.data.fuzzer.mutants.querystring_mutant import QSMutant [as 别名]
# 或者: from w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant import set_dc [as 别名]
 def test_delay_controlled_random(self):
     for expected_result, delays in self.TEST_SUITE:
         print delays
         mock_uri_opener = Mock()
         side_effect = generate_delays(delays, rand_range=(0,2))
         mock_uri_opener.send_mutant = MagicMock(side_effect=side_effect)
         delay_obj = ExactDelay('sleep(%s)')
         
         url = URL('http://moth/?id=1')
         req = FuzzableRequest(url)
         mutant = QSMutant(req)
         mutant.set_dc(url.querystring)
         mutant.set_var('id', 0)
         
         ed = ExactDelayController(mutant, delay_obj, mock_uri_opener)
         controlled, responses = ed.delay_is_controlled()
         
         # This is where we change from test_delay_controlled, the basic
         # idea is that we'll allow false negatives but no false positives
         if expected_result == True:
             expected_result = [True, False]
         else:
             expected_result = [False,]
             
         self.assertIn(controlled, expected_result, delays)
开发者ID:3rdDegree,项目名称:w3af,代码行数:27,代码来源:test_exact_delay_controller.py

示例2: test_delay_controlled

# 需要导入模块: from w3af.core.data.fuzzer.mutants.querystring_mutant import QSMutant [as 别名]
# 或者: from w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant import set_dc [as 别名]
    def test_delay_controlled(self):
        
        for expected_result, delays in self.TEST_SUITE:

            mock_uri_opener = Mock()
            side_effect = generate_delays(delays)
            mock_uri_opener.send_mutant = MagicMock(side_effect=side_effect)
            delay_obj = AproxDelay('%s9!', '1', 10)
            
            url = URL('http://moth/?id=1')
            req = FuzzableRequest(url)
            mutant = QSMutant(req)
            mutant.set_dc(url.querystring)
            mutant.set_token(('id', 0))
            
            ed = AproxDelayController(mutant, delay_obj, mock_uri_opener)
            controlled, responses = ed.delay_is_controlled()
            self.assertEqual(expected_result, controlled, delays)
开发者ID:0x554simon,项目名称:w3af,代码行数:20,代码来源:test_aprox_delay_controller.py

示例3: test_delay_controlled

# 需要导入模块: from w3af.core.data.fuzzer.mutants.querystring_mutant import QSMutant [as 别名]
# 或者: from w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant import set_dc [as 别名]
    def test_delay_controlled(self):
        
        for expected_result, delays in self.TEST_SUITE:
            urllib = ExtendedUrllib()
            side_effect = generate_delays(delays)
            urllib.send_mutant = MagicMock(side_effect=side_effect)

            delay_obj = ExactDelay('sleep(%s)')
            
            url = URL('http://moth/?id=1')
            req = FuzzableRequest(url)
            mutant = QSMutant(req)
            mutant.set_dc(url.querystring)
            mutant.set_token(('id', 0))
            
            ed = ExactDelayController(mutant, delay_obj, urllib)
            controlled, responses = ed.delay_is_controlled()
            self.assertEqual(expected_result, controlled, delays)
开发者ID:andresriancho,项目名称:w3af,代码行数:20,代码来源:test_exact_delay_controller.py


注:本文中的w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant.set_dc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。