0
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
1 #! /usr/bin/env python |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
3 # |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
4 # Authors: |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
5 # BenoƮt Allard <benoit.allard@greenbone.net> |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
6 # |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
7 # Copyright: |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
8 # Copyright (C) 2014 Greenbone Networks GmbH |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
9 # |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
10 # This program is free software; you can redistribute it and/or |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
11 # modify it under the terms of the GNU General Public License |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
12 # as published by the Free Software Foundation; either version 2 |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
13 # of the License, or (at your option) any later version. |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
14 # |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
15 # This program is distributed in the hope that it will be useful, |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
18 # GNU General Public License for more details. |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
19 # |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
20 # You should have received a copy of the GNU General Public License |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
21 # along with this program; if not, write to the Free Software |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
23 |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
24 import sys |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
25 |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
26 from farolluz.parsers.cvrf import parse |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
27 |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
28 if __name__ == "__main__": |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
29 with open(sys.argv[1], 'rt') as f: |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
30 cvrf = parse(f) |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
31 cvrf.validate() |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
32 print(cvrf) |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
33 print(cvrf.getHighestCVSS()._vector) |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
34 print(cvrf.getProductList()) |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
35 print(cvrf._producttree._branches) |
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff
changeset
|
36 # print(cvrf._producttree._branches[0]._childs) |