本文整理汇总了Python中w3af.core.data.kb.info.Info.get_wasc_ids方法的典型用法代码示例。如果您正苦于以下问题:Python Info.get_wasc_ids方法的具体用法?Python Info.get_wasc_ids怎么用?Python Info.get_wasc_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类w3af.core.data.kb.info.Info
的用法示例。
在下文中一共展示了Info.get_wasc_ids方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_to_json
# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_wasc_ids [as 别名]
def test_to_json(self):
i = Info('Blind SQL injection vulnerability', MockInfo.LONG_DESC, 1,
'plugin_name')
i['test'] = 'foo'
i.add_to_highlight('abc', 'def')
jd = i.to_json()
json_string = json.dumps(jd)
jd = json.loads(json_string)
self.assertEqual(jd['name'], i.get_name())
self.assertEqual(jd['url'], str(i.get_url()))
self.assertEqual(jd['var'], i.get_token_name())
self.assertEqual(jd['response_ids'], i.get_id())
self.assertEqual(jd['vulndb_id'], i.get_vulndb_id())
self.assertEqual(jd['desc'], i.get_desc(with_id=False))
self.assertEqual(jd['long_description'], i.get_long_description())
self.assertEqual(jd['fix_guidance'], i.get_fix_guidance())
self.assertEqual(jd['fix_effort'], i.get_fix_effort())
self.assertEqual(jd['tags'], i.get_tags())
self.assertEqual(jd['wasc_ids'], i.get_wasc_ids())
self.assertEqual(jd['wasc_urls'], list(i.get_wasc_urls()))
self.assertEqual(jd['cwe_urls'], list(i.get_cwe_urls()))
self.assertEqual(jd['references'], BLIND_SQLI_REFS)
self.assertEqual(jd['owasp_top_10_references'], BLIND_SQLI_TOP10_REFS)
self.assertEqual(jd['plugin_name'], i.get_plugin_name())
self.assertEqual(jd['severity'], i.get_severity())
self.assertEqual(jd['attributes'], i.copy())
self.assertEqual(jd['highlight'], list(i.get_to_highlight()))
示例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_wasc_ids [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)
示例3: test_vulndb_id_set
# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_wasc_ids [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)
示例4: test_to_json
# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_wasc_ids [as 别名]
def test_to_json(self):
i = Info("Blind SQL injection vulnerability", MockInfo.LONG_DESC, 1, "plugin_name")
i["test"] = "foo"
i.add_to_highlight("abc", "def")
jd = i.to_json()
json_string = json.dumps(jd)
jd = json.loads(json_string)
self.assertEqual(jd["name"], i.get_name())
self.assertEqual(jd["url"], str(i.get_url()))
self.assertEqual(jd["var"], i.get_token_name())
self.assertEqual(jd["response_ids"], i.get_id())
self.assertEqual(jd["vulndb_id"], i.get_vulndb_id())
self.assertEqual(jd["desc"], i.get_desc(with_id=False))
self.assertEqual(jd["long_description"], i.get_long_description())
self.assertEqual(jd["fix_guidance"], i.get_fix_guidance())
self.assertEqual(jd["fix_effort"], i.get_fix_effort())
self.assertEqual(jd["tags"], i.get_tags())
self.assertEqual(jd["wasc_ids"], i.get_wasc_ids())
self.assertEqual(jd["wasc_urls"], list(i.get_wasc_urls()))
self.assertEqual(jd["cwe_urls"], list(i.get_cwe_urls()))
self.assertEqual(jd["references"], BLIND_SQLI_REFS)
self.assertEqual(jd["owasp_top_10_references"], BLIND_SQLI_TOP10_REFS)
self.assertEqual(jd["plugin_name"], i.get_plugin_name())
self.assertEqual(jd["severity"], i.get_severity())
self.assertEqual(jd["attributes"], i.copy())
self.assertEqual(jd["highlight"], list(i.get_to_highlight()))
示例5: test_vulndb_id_get_from_name
# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_wasc_ids [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)
示例6: test_vulndb_id_set
# 需要导入模块: from w3af.core.data.kb.info import Info [as 别名]
# 或者: from w3af.core.data.kb.info.Info import get_wasc_ids [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)