Mercurial > farol > farolluz
comparison farolluz/templates/nasl.j2 @ 0:e18b61a73a68
Initial Release
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Tue, 23 Sep 2014 15:19:14 +0200 |
parents | |
children | e29e2d43bf0c |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e18b61a73a68 |
---|---|
1 {# | |
2 # Description: | |
3 # Template for generation of NASL documents | |
4 # | |
5 # Authors: | |
6 # BenoƮt Allard <benoit.allard@greenbone.net> | |
7 # | |
8 # Copyright: | |
9 # Copyright (C) 2014 Greenbone Networks GmbH | |
10 # | |
11 # This program is free software; you can redistribute it and/or | |
12 # modify it under the terms of the GNU General Public License | |
13 # as published by the Free Software Foundation; either version 2 | |
14 # of the License, or (at your option) any later version. | |
15 # | |
16 # This program is distributed in the hope that it will be useful, | |
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 # GNU General Public License for more details. | |
20 # | |
21 # You should have received a copy of the GNU General Public License | |
22 # along with this program; if not, write to the Free Software | |
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
24 -#} | |
25 | |
26 {% import "nasl_core.j2" as nasl_core -%} | |
27 ############################################################################### | |
28 # OpenVAS Vulnerability Test | |
29 # | |
30 # {{ cvrf._title }} ({{ cvrf._tracking._identification._id }}) | |
31 # | |
32 # Authors: | |
33 # System Generated Check | |
34 # | |
35 # Copyright: | |
36 # Copyright (C) {{ now.strftime('%Y') }} Greenbone Networks GmbH, http://www.greenbone.net | |
37 # | |
38 # This program is free software; you can redistribute it and/or modify | |
39 # it under the terms of the GNU General Public License version 2 | |
40 # (or any later version), as published by the Free Software Foundation. | |
41 # | |
42 # This program is distributed in the hope that it will be useful, | |
43 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
44 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
45 # GNU General Public License for more details. | |
46 # | |
47 # You should have received a copy of the GNU General Public License | |
48 # along with this program; if not, write to the Free Software | |
49 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
50 ############################################################################### | |
51 | |
52 if(description) | |
53 { | |
54 script_oid("1.3.6.1.4.1.25623.1.0.{{ script_id }}"); | |
55 script_version("$Revision$"); | |
56 script_tag(name:"check_type", value:"authenticated package test"); | |
57 script_tag(name:"last_modification", value:"$Date$"); | |
58 script_tag(name:"creation_date", value:"{{ now.strftime('%F %T %z (%a, %d %b %Y)') }}"); | |
59 script_cve_id({% for vuln in cvrf._vulnerabilities %}"{{ vuln._cve }}"{% if not loop.last %}, {% endif %}{% endfor %}); | |
60 script_tag(name:"cvss_base", value:"{{ cvrf.getHighestCVSS()._basescore }}"); | |
61 script_tag(name:"cvss_base_vector", value:"{{ cvrf.getHighestCVSS()._vector }}"); | |
62 script_name("{{ cvrf._title }} ({{ cvrf._tracking._identification._id }})"); | |
63 script_tag(name: "summary", value: "{{ nasl_core.notes(cvrf, 'Summary') }}"); | |
64 script_tag(name: "insight", value: "{{ nasl_core.notes(cvrf, 'Details') }}"); | |
65 script_tag(name: "affected" , value: " | |
66 {%- for product in cvrf.getProductList() %} | |
67 {{ product._name }} {% if not loop.last %}, {% endif %} | |
68 | |
69 {%- endfor %}"); | |
70 script_tag(name: "solution" , value:"Please Install the Updated Packages."); | |
71 | |
72 script_xref(name: "{{ cvrf._tracking._id }}", value: "{{ cvrf._tracking._id }}"); | |
73 {%- for ref in cvrf._references %} | |
74 script_xref(name: "URL" , value: "{{ ref._url }}"); | |
75 {%- endfor %} | |
76 script_summary("Check for the {{ cvrf._title }}"); | |
77 script_category(ACT_GATHER_INFO); | |
78 script_copyright("Copyright (C) {{ now.strftime('%Y') }} Greenbone Networks GmbH"); | |
79 script_family("{{ script_family }}"); | |
80 script_dependencies("gather-package-list.nasl"); | |
81 script_mandatory_keys({% if os_cpe %}"HostDetails/OS/{{ os_cpe }}", {% endif %}"login/SSH/success", "ssh/login/release"); | |
82 exit(0); | |
83 } | |
84 | |
85 | |
86 {% if red_hat %}include("pkg-lib-rpm.inc");{% endif %} | |
87 | |
88 release = get_kb_item("ssh/login/release"); | |
89 | |
90 res = ""; | |
91 if(release == NULL){ | |
92 exit(0); | |
93 } | |
94 | |
95 {%- if red_hat %} | |
96 {{ nasl_core.isrpmvuln(cvrf.getProductList(), cvrf._producttree) }} | |
97 {%- else %} | |
98 # Not red_hat | |
99 {%- endif %} | |
100 | |
101 if (__pkg_match) exit(99); # Not vulnerable. | |
102 exit(0); |