• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python context.get_context函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中w3af.core.data.context.context.get_context函数的典型用法代码示例。如果您正苦于以下问题:Python get_context函数的具体用法?Python get_context怎么用?Python get_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_all

    def test_all(self):
        for context in get_contexts():
            found = False

            expected_context_name = context.get_name()
            for calculated_context in get_context(self.HTML, expected_context_name):
                if calculated_context.get_name() == expected_context_name:
                    found = True

            if not found:
                msg = "The analysis for %s context failed, got %r instead."
                msg = msg % (expected_context_name, get_context(self.HTML, expected_context_name))
                self.assertTrue(False, msg)
开发者ID:johnjohnsp1,项目名称:w3af,代码行数:13,代码来源:test_context.py


示例2: test_payload_with_space_equal_src_executable

    def test_payload_with_space_equal_src_executable(self):
        """
        Related with:
            https://github.com/andresriancho/w3af/issues/1557
            https://github.com/andresriancho/w3af/issues/2919
        """
        html = """
        <html>
            <frame src="5vrws =">
        </html>
        """
        self.assertEqual(get_context(html, '5vrws%20%3D'), [])

        context = get_context(html, '5vrws =')[0]
        self.assertTrue(context.is_executable())
开发者ID:0x554simon,项目名称:w3af,代码行数:15,代码来源:test_context.py


示例3: test_payload_html_inside_comment

 def test_payload_html_inside_comment(self):
     html = """
     <html>
         <!-- <body>PAYLOAD</body> -->
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], HtmlComment)
开发者ID:0x554simon,项目名称:w3af,代码行数:7,代码来源:test_context.py


示例4: test_payload_js2doublequote

 def test_payload_js2doublequote(self):
     html = """
     <html>
         <input type="button" value="ClickMe" onClick="PAYLOAD">
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[1], ScriptText)
开发者ID:0x554simon,项目名称:w3af,代码行数:7,代码来源:test_context.py


示例5: test_style_text

 def test_style_text(self):
     html = """
     <style>foo(); bar(PAYLOAD);</style>
     """
     contexts = get_context(html, 'PAYLOAD')
     self.assertEqual(len(contexts), 1, contexts)
     self.assertIsInstance(contexts[0], CSSText)
开发者ID:andresriancho,项目名称:w3af,代码行数:7,代码来源:test_html.py


示例6: test_script_text

 def test_script_text(self):
     html = """
     <script>foo(); bar(PAYLOAD);</script>
     """
     contexts = get_context(html, 'PAYLOAD')
     self.assertEqual(len(contexts), 1, contexts)
     self.assertIsInstance(contexts[0], ScriptText)
开发者ID:andresriancho,项目名称:w3af,代码行数:7,代码来源:test_html.py


示例7: test_broken_4

 def test_broken_4(self):
     html = """
     <a PAYLOAD="/xyz"></
     """
     contexts = get_context(html, 'PAYLOAD')
     self.assertEqual(len(contexts), 1, contexts)
     self.assertIsInstance(contexts[0], HtmlAttr)
开发者ID:andresriancho,项目名称:w3af,代码行数:7,代码来源:test_html.py


示例8: test_django_500_sample

    def test_django_500_sample(self):
        html = file(os.path.join(self.SAMPLES_DIR, 'django-500.html')).read()
        contexts = get_context(html, "QUBD5 =")

        self.assertEqual(len(contexts), 9)
        for c in contexts:
            self.assertIsInstance(c, HtmlText)
开发者ID:0x554simon,项目名称:w3af,代码行数:7,代码来源:test_context.py


示例9: test_payload_src

 def test_payload_src(self):
     html = """
     <html>
         <img src="PAYLOAD" />
     </html>
     """
     context = get_context(html, 'PAYLOAD')[0]
     self.assertTrue(context.is_executable())
开发者ID:0x554simon,项目名称:w3af,代码行数:8,代码来源:test_context.py


示例10: test_payload_href

 def test_payload_href(self):
     html = """
     <html>
         <a href="PAYLOAD">foo</a>
     </html>
     """
     context = get_context(html, 'PAYLOAD')[0]
     self.assertTrue(context.is_executable())
开发者ID:0x554simon,项目名称:w3af,代码行数:8,代码来源:test_context.py


示例11: test_payload_text_can_break

 def test_payload_text_can_break(self):
     html = """
     <html>
         <a>PAYLOAD<</a>
     </html>
     """
     context = get_context(html, 'PAYLOAD<')[0]
     self.assertTrue(context.can_break('PAYLOAD<'))
开发者ID:0x554simon,项目名称:w3af,代码行数:8,代码来源:test_context.py


示例12: test_payload_handler

 def test_payload_handler(self):
     html = """
     <html>
         <a onclick="PAYLOAD">foo</a>
     </html>
     """
     context = get_context(html, "PAYLOAD")[0]
     self.assertTrue(context.is_executable())
开发者ID:johnjohnsp1,项目名称:w3af,代码行数:8,代码来源:test_context.py


示例13: test_payload_double_script

 def test_payload_double_script(self):
     html = """
     <html>
         <script>foo</script>
             PAYLOAD
         <script>bar</script>
     </html>
     """
     self.assertIsInstance(get_context(html, "PAYLOAD")[0], HtmlText)
开发者ID:johnjohnsp1,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例14: test_payload_script_single_quote2

 def test_payload_script_single_quote2(self):
     html = """
     <html>
         <script type="text/javascript">//<!--
             init({login:'',foo:'PAYLOAD'})
         </script>
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], ScriptSingleQuote)
开发者ID:0x554simon,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例15: test_payload_script_single_quote

 def test_payload_script_single_quote(self):
     html = """
     <html>
         <script foo='PAYLOAD'>
             bar
         </script>
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], HtmlAttrSingleQuote)
开发者ID:0x554simon,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例16: test_payload_html_inside_script_with_comment

 def test_payload_html_inside_script_with_comment(self):
     html = """
     <html>
         <script>
             <!-- <body>PAYLOAD</body> -->
         </script>
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], ScriptText)
开发者ID:0x554simon,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例17: test_payload_html_inside_comment

 def test_payload_html_inside_comment(self):
     html = """
     <html>
         <!-- <body>PAYLOAD</body> -->
     </html>
     """
     contexts = get_context(html, 'PAYLOAD')
     self.assertEqual(len(contexts), 1)
     self.assertIsInstance(contexts[0], HtmlComment)
开发者ID:andresriancho,项目名称:w3af,代码行数:9,代码来源:test_html.py


示例18: test_payload_script_broken_double_close

 def test_payload_script_broken_double_close(self):
     html = """
     <html>
         <script>foo</script>
             PAYLOAD
         </script>
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], HtmlText)
开发者ID:0x554simon,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例19: test_payload_script_broken_double_open

 def test_payload_script_broken_double_open(self):
     html = """
     <html>
         <script>foo
             PAYLOAD
         <script>bar</script>
     </html>
     """
     self.assertIsInstance(get_context(html, 'PAYLOAD')[0], ScriptText)
开发者ID:0x554simon,项目名称:w3af,代码行数:9,代码来源:test_context.py


示例20: test_payload_tag_name_close

    def test_payload_tag_name_close(self):
        html = """
        <foo>
        </PAYLOAD>
        """
        contexts = get_context(html, 'PAYLOAD')
        self.assertEqual(len(contexts), 1, contexts)

        self.assertIsInstance(contexts[0], HtmlTagClose)
开发者ID:andresriancho,项目名称:w3af,代码行数:9,代码来源:test_html.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python disk_dict.DiskDict类代码示例发布时间:2022-05-26
下一篇:
Python scalable_bloom.ScalableBloomFilter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap