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


Python Info.get_owasp_top_10_references方法代码示例

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


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

示例1: test_vulndb_id_get_from_name

# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_owasp_top_10_references [as 别名]
    def test_vulndb_id_get_from_name(self):
        # Since there is no vulndb_id set, the name wins:
        i = Info('Blind SQL injection vulnerability', MockInfo.LONG_DESC, 1,
                 'plugin_name')

        # lazy calculation
        self.assertIsNone(i._vulndb)

        expected_references = [Reference(d['url'], d['title']) for d in BLIND_SQLI_REFS]

        self.assertTrue(i.has_db_details())
        self.assertEqual(i.get_vulndb_id(), 46)
        self.assertIsInstance(i.get_long_description(), basestring)
        self.assertIsInstance(i.get_fix_guidance(), basestring)
        self.assertEqual(i.get_fix_effort(), 50)
        self.assertEqual(i.get_tags(), [u'web', u'sql', u'blind',
                                        u'injection', u'database'])
        self.assertEqual(i.get_wasc_ids(), [])
        self.assertEqual(list(i.get_wasc_urls()), [])
        self.assertEqual(list(i.get_cwe_urls()),
                         [u'https://cwe.mitre.org/data/definitions/89.html'])
        self.assertEqual(i.get_cwe_ids(), [u'89'])
        self.assertEqual(i.get_references(), expected_references)
        self.assertEqual(list(i.get_owasp_top_10_references()),
                         [(u'2013', 1,
                           'https://www.owasp.org/index.php/Top_10_2013-A1')])
        self.assertIsInstance(i.get_vuln_info_from_db(), DBVuln)

        # lazy calculation success
        self.assertIsNotNone(i._vulndb)
开发者ID:BioSoundSystems,项目名称:w3af,代码行数:32,代码来源:test_info.py

示例2: test_vulndb_id_get_from_name

# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_owasp_top_10_references [as 别名]
    def test_vulndb_id_get_from_name(self):
        # Since there is no vulndb_id set, the name wins:
        i = Info("Blind SQL injection vulnerability", MockInfo.LONG_DESC, 1, "plugin_name")

        # lazy calculation
        self.assertIsNone(i._vulndb)

        expected_references = [Reference(d["url"], d["title"]) for d in BLIND_SQLI_REFS]

        self.assertTrue(i.has_db_details())
        self.assertEqual(i.get_vulndb_id(), 46)
        self.assertIsInstance(i.get_long_description(), basestring)
        self.assertIsInstance(i.get_fix_guidance(), basestring)
        self.assertEqual(i.get_fix_effort(), 50)
        self.assertEqual(i.get_tags(), [u"web", u"sql", u"blind", u"injection", u"database"])
        self.assertEqual(i.get_wasc_ids(), [])
        self.assertEqual(list(i.get_wasc_urls()), [])
        self.assertEqual(list(i.get_cwe_urls()), [u"https://cwe.mitre.org/data/definitions/89.html"])
        self.assertEqual(i.get_cwe_ids(), [u"89"])
        self.assertEqual(i.get_references(), expected_references)
        self.assertEqual(
            list(i.get_owasp_top_10_references()), [(u"2013", 1, "https://www.owasp.org/index.php/Top_10_2013-A1")]
        )
        self.assertIsInstance(i.get_vuln_info_from_db(), DBVuln)

        # lazy calculation success
        self.assertIsNotNone(i._vulndb)
开发者ID:breakthesec,项目名称:w3af,代码行数:29,代码来源:test_info.py

示例3: test_vulndb_id_set

# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_owasp_top_10_references [as 别名]
    def test_vulndb_id_set(self):
        # The vulndb_id overrides the 'Blind SQL injection vulnerability' name
        i = Info('Blind SQL injection vulnerability', MockInfo.LONG_DESC, 1,
                 'plugin_name', vulndb_id=17)

        # lazy calculation
        self.assertIsNone(i._vulndb)

        url = 'https://www.owasp.org/index.php/PHP_File_Inclusion'
        title = 'OWASP'
        expected_references = [Reference(url, title)]

        self.assertTrue(i.has_db_details())
        self.assertEqual(i.get_vulndb_id(), 17)
        self.assertIsInstance(i.get_long_description(), basestring)
        self.assertIsInstance(i.get_fix_guidance(), basestring)
        self.assertEqual(i.get_fix_effort(), 50)
        self.assertEqual(i.get_tags(), ['web', 'file', 'inclusion', 'error',
                                        'injection'])
        self.assertEqual(i.get_wasc_ids(), [])
        self.assertEqual(list(i.get_wasc_urls()), [])
        self.assertEqual(list(i.get_cwe_urls()),
                         ['https://cwe.mitre.org/data/definitions/98.html'])
        self.assertEqual(i.get_cwe_ids(), [u'98'])
        self.assertEqual(i.get_references(), expected_references)
        self.assertEqual(list(i.get_owasp_top_10_references()),
                         [(u'2013', 1,
                           'https://www.owasp.org/index.php/Top_10_2013-A1')])
        self.assertIsInstance(i.get_vuln_info_from_db(), DBVuln)

        # lazy calculation success
        self.assertIsNotNone(i._vulndb)
开发者ID:BioSoundSystems,项目名称:w3af,代码行数:34,代码来源:test_info.py

示例4: test_vulndb_id_set

# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_owasp_top_10_references [as 别名]
    def test_vulndb_id_set(self):
        # The vulndb_id overrides the 'Blind SQL injection vulnerability' name
        i = Info("Blind SQL injection vulnerability", MockInfo.LONG_DESC, 1, "plugin_name", vulndb_id=17)

        # lazy calculation
        self.assertIsNone(i._vulndb)

        url = "https://www.owasp.org/index.php/PHP_File_Inclusion"
        title = "OWASP"
        expected_references = [Reference(url, title)]

        self.assertTrue(i.has_db_details())
        self.assertEqual(i.get_vulndb_id(), 17)
        self.assertIsInstance(i.get_long_description(), basestring)
        self.assertIsInstance(i.get_fix_guidance(), basestring)
        self.assertEqual(i.get_fix_effort(), 50)
        self.assertEqual(i.get_tags(), ["web", "file", "inclusion", "error", "injection"])
        self.assertEqual(i.get_wasc_ids(), [])
        self.assertEqual(list(i.get_wasc_urls()), [])
        self.assertEqual(list(i.get_cwe_urls()), ["https://cwe.mitre.org/data/definitions/98.html"])
        self.assertEqual(i.get_cwe_ids(), [u"98"])
        self.assertEqual(i.get_references(), expected_references)
        self.assertEqual(
            list(i.get_owasp_top_10_references()), [(u"2013", 1, "https://www.owasp.org/index.php/Top_10_2013-A1")]
        )
        self.assertIsInstance(i.get_vuln_info_from_db(), DBVuln)

        # lazy calculation success
        self.assertIsNotNone(i._vulndb)
开发者ID:breakthesec,项目名称:w3af,代码行数:31,代码来源:test_info.py


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