forked from toolswatch/vFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_calls.py
executable file
·87 lines (67 loc) · 1.98 KB
/
api_calls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python
# Copyright (C) 2015 ToolsWatch.org
# This file is part of vFeed Vulnerability Database Community API Parser - http://www.toolswatch.org
# See the file 'LICENSE' for copying permission.
# you can import class by class
# from lib.core.methods import CveInfo, CveRisk
import json
from lib.core.methods import *
cve = "CVE-2014-0160"
print "Basic information of", cve
info = CveInfo(cve).get_cve()
print info
print "CWE information related to", cve
cwe = CveInfo(cve).get_cwe()
print cwe
print "CPE information related to", cve
cpe = CveInfo(cve).get_cpe()
print cpe
print "Total of CPEs found is:", len(json.loads(cpe))
print "CVSS information related to", cve
cvss = CveRisk(cve).get_cvss()
print cvss
cve = "CVE-2008-4250"
print "Risk information related to", cve
print "Note that severity includes the CVSS v2 as well"
severity = CveRisk(cve).get_severity()
print severity
cve = "CVE-2015-0222"
print "Ubuntu patches related to", cve
ubuntu = CvePatches(cve).get_ubuntu()
print ubuntu
cve = "CVE-2008-4250"
print "Nessus information related to", cve
nessus = CveScanners(cve).get_nessus()
print nessus
print "Total of Nessus scripts found is:", len(json.loads(nessus))
cve = "CVE-2006-6077"
print "OVAL information related to", cve
oval = CveScanners(cve).get_oval()
print oval
cve = "CVE-2011-3402"
print "Metasploit information related to", cve
metasploit = CveExploit(cve).get_msf()
print metasploit
cve = "CVE-2004-0990"
print "Snort information related to", cve
snort = CveRules(cve).get_snort()
print snort
from lib.core.search import Search
cpe = "cpe:/a:invensys:foxboro"
print "Search for", cpe
Search(cpe)
cwe = "cwe-89"
print "Search for", cwe
Search(cwe)
cve = "CVE-2004-0990"
print "Search for", cve
Search(cve)
oval = "oval:org.mitre.oval:def:17538"
print "Search for", oval
Search(oval)
cve = "CVE-2004-0990"
export = ExportJson(cve).json_dump()
print export
print "Updating the vFeed database from your scripts"
from lib.core.update import Update
Update().update()