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


Python FuzzableRequest.dump方法代码示例

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


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

示例1: test_dump_mangle

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
    def test_dump_mangle(self):
        fr = FuzzableRequest(URL("http://www.w3af.com/"),\
                             headers=Headers([('Host', 'www.w3af.com')]))

        expected = u'\r\n'.join([u'GET http://www.w3af.com/ HTTP/1.1',
                                 u'Host: www.w3af.com',
                                 u'',
                                 u''])
        
        self.assertEqual(fr.dump(), expected)
        
        fr.set_method('POST')
        fr.set_data(KeyValueContainer(init_val=[('data', ['23'])]))
        
        expected = u'\r\n'.join([u'POST http://www.w3af.com/ HTTP/1.1',
                                 u'Host: www.w3af.com',
                                 u'',
                                 u'data=23'])
        
        self.assertEqual(fr.dump(), expected)
开发者ID:andresriancho,项目名称:w3af-kali,代码行数:22,代码来源:test_fuzzable_request.py

示例2: test_dump_case02

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
    def test_dump_case02(self):
        expected = u'\r\n'.join([u'GET http://w3af.com/a/b/c.php HTTP/1.1',
                                 u'Hola: Múndo',
                                 u'',
                                 u'a=b'])

        headers = Headers([(u'Hola', u'Múndo')])
        post_data = KeyValueContainer(init_val=[('a', ['b'])])
        fr = FuzzableRequest(self.url, method='GET', post_data=post_data,
                             headers=headers)

        self.assertEqual(fr.dump(), expected.encode('utf-8'))
开发者ID:andresriancho,项目名称:w3af-kali,代码行数:14,代码来源:test_fuzzable_request.py

示例3: test_dump_case02

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
 def test_dump_case02(self):
     expected = u'\r\n'.join([u'GET http://w3af.com/a/b/c.php HTTP/1.1',
                              u'Hola: Múndo',
                              u'',
                              u''])
     headers = Headers([(u'Hola', u'Múndo')])
     
     #TODO: Note that I'm passing a dc to the FuzzableRequest and it's not
     # appearing in the dump. It might be a bug...
     fr = FuzzableRequest(self.url, method='GET', dc={u'á': ['b']},
                          headers=headers)
     self.assertEqual(fr.dump(), expected)
开发者ID:Adastra-thw,项目名称:Tortazo,代码行数:14,代码来源:test_fuzzable_request.py

示例4: test_dump_case01

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
    def test_dump_case01(self):
        expected = '\r\n'.join(['GET http://w3af.com/a/b/c.php HTTP/1.1',
                                'Hello: World',
                                '',
                                ''])
        headers = Headers([('Hello', 'World')])

        #TODO: Note that I'm passing a dc to the FuzzableRequest and it's not
        # appearing in the dump. It might be a bug...
        fr = FuzzableRequest(self.url, method='GET', dc={'a': ['b']},
                             headers=headers)
        self.assertEqual(fr.dump(), expected)
开发者ID:Adastra-thw,项目名称:Tortazo,代码行数:14,代码来源:test_fuzzable_request.py

示例5: test_dump_case03

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
    def test_dump_case03(self):
        header_value = ''.join(chr(i) for i in xrange(256))
        
        expected = u'\r\n'.join([u'GET http://w3af.com/a/b/c.php HTTP/1.1',
                                 u'Hola: %s' % smart_unicode(header_value),
                                 u'',
                                 u'a=b'])

        headers = Headers([(u'Hola', header_value)])
        post_data = KeyValueContainer(init_val=[('a', ['b'])])
        fr = FuzzableRequest(self.url, method='GET', post_data=post_data,
                             headers=headers)

        self.assertEqual(fr.dump(), expected)
开发者ID:andresriancho,项目名称:w3af-kali,代码行数:16,代码来源:test_fuzzable_request.py

示例6: test_dump_case03

# 需要导入模块: from w3af.core.data.request.fuzzable_request import FuzzableRequest [as 别名]
# 或者: from w3af.core.data.request.fuzzable_request.FuzzableRequest import dump [as 别名]
    def test_dump_case03(self):
        header_value = ''.join(chr(i) for i in xrange(256))
        
        expected = u'\r\n'.join([u'GET http://w3af.com/a/b/c.php HTTP/1.1',
                                 u'Hola: %s' % smart_unicode(header_value),
                                 u'',
                                 u''])

        headers = Headers([(u'Hola', header_value)])
        
        #TODO: Note that I'm passing a dc to the FuzzableRequest and it's not
        # appearing in the dump. It might be a bug...
        fr = FuzzableRequest(self.url, method='GET', dc={u'a': ['b']},
                             headers=headers)
        self.assertEqual(fr.dump(), expected)
开发者ID:Adastra-thw,项目名称:Tortazo,代码行数:17,代码来源:test_fuzzable_request.py


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