本文整理汇总了Python中w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant.set_token方法的典型用法代码示例。如果您正苦于以下问题:Python QSMutant.set_token方法的具体用法?Python QSMutant.set_token怎么用?Python QSMutant.set_token使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类w3af.core.data.fuzzer.mutants.querystring_mutant.QSMutant
的用法示例。
在下文中一共展示了QSMutant.set_token方法的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_token [as 别名]
def test_delay_controlled_random(self):
for expected_result, delays in self.TEST_SUITE:
urllib = ExtendedUrllib()
side_effect = generate_delays(delays, rand_range=(0, 2))
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()
# 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:
expected_result = [True, False]
else:
expected_result = [False]
self.assertIn(controlled, expected_result, delays)
示例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_token [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)
示例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_token [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)