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


Python context.get_context函数代码示例

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


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


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