benoit@0: {# benoit@0: # Description: benoit@0: # Template for generation of NASL documents benoit@0: # benoit@0: # Authors: benoit@0: # BenoƮt Allard benoit@0: # benoit@0: # Copyright: benoit@0: # Copyright (C) 2014 Greenbone Networks GmbH benoit@0: # benoit@0: # This program is free software; you can redistribute it and/or benoit@0: # modify it under the terms of the GNU General Public License benoit@0: # as published by the Free Software Foundation; either version 2 benoit@0: # of the License, or (at your option) any later version. benoit@0: # benoit@0: # This program is distributed in the hope that it will be useful, benoit@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of benoit@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the benoit@0: # GNU General Public License for more details. benoit@0: # benoit@0: # You should have received a copy of the GNU General Public License benoit@0: # along with this program; if not, write to the Free Software benoit@0: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. benoit@0: -#} benoit@0: benoit@0: {% import "nasl_core.j2" as nasl_core -%} benoit@0: ############################################################################### benoit@0: # OpenVAS Vulnerability Test benoit@0: # benoit@0: # {{ cvrf._title }} ({{ cvrf._tracking._identification._id }}) benoit@0: # benoit@0: # Authors: benoit@0: # System Generated Check benoit@0: # benoit@0: # Copyright: benoit@0: # Copyright (C) {{ now.strftime('%Y') }} Greenbone Networks GmbH, http://www.greenbone.net benoit@0: # benoit@0: # This program is free software; you can redistribute it and/or modify benoit@0: # it under the terms of the GNU General Public License version 2 benoit@0: # (or any later version), as published by the Free Software Foundation. benoit@0: # benoit@0: # This program is distributed in the hope that it will be useful, benoit@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of benoit@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the benoit@0: # GNU General Public License for more details. benoit@0: # benoit@0: # You should have received a copy of the GNU General Public License benoit@0: # along with this program; if not, write to the Free Software benoit@0: # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. benoit@0: ############################################################################### benoit@0: benoit@0: if(description) benoit@0: { benoit@0: script_oid("1.3.6.1.4.1.25623.1.0.{{ script_id }}"); benoit@0: script_version("$Revision$"); benoit@0: script_tag(name:"check_type", value:"authenticated package test"); benoit@0: script_tag(name:"last_modification", value:"$Date$"); benoit@0: script_tag(name:"creation_date", value:"{{ now.strftime('%F %T %z (%a, %d %b %Y)') }}"); benoit@0: script_cve_id({% for vuln in cvrf._vulnerabilities %}"{{ vuln._cve }}"{% if not loop.last %}, {% endif %}{% endfor %}); benoit@0: script_tag(name:"cvss_base", value:"{{ cvrf.getHighestCVSS()._basescore }}"); benoit@0: script_tag(name:"cvss_base_vector", value:"{{ cvrf.getHighestCVSS()._vector }}"); benoit@0: script_name("{{ cvrf._title }} ({{ cvrf._tracking._identification._id }})"); benoit@0: script_tag(name: "summary", value: "{{ nasl_core.notes(cvrf, 'Summary') }}"); benoit@0: script_tag(name: "insight", value: "{{ nasl_core.notes(cvrf, 'Details') }}"); benoit@0: script_tag(name: "affected" , value: " benoit@0: {%- for product in cvrf.getProductList() %} benoit@0: {{ product._name }} {% if not loop.last %}, {% endif %} benoit@0: benoit@0: {%- endfor %}"); benoit@0: script_tag(name: "solution" , value:"Please Install the Updated Packages."); benoit@0: benoit@0: script_xref(name: "{{ cvrf._tracking._id }}", value: "{{ cvrf._tracking._id }}"); benoit@0: {%- for ref in cvrf._references %} benoit@0: script_xref(name: "URL" , value: "{{ ref._url }}"); benoit@0: {%- endfor %} benoit@0: script_summary("Check for the {{ cvrf._title }}"); benoit@0: script_category(ACT_GATHER_INFO); benoit@0: script_copyright("Copyright (C) {{ now.strftime('%Y') }} Greenbone Networks GmbH"); benoit@0: script_family("{{ script_family }}"); benoit@0: script_dependencies("gather-package-list.nasl"); benoit@0: script_mandatory_keys({% if os_cpe %}"HostDetails/OS/{{ os_cpe }}", {% endif %}"login/SSH/success", "ssh/login/release"); benoit@0: exit(0); benoit@0: } benoit@0: benoit@0: benoit@0: {% if red_hat %}include("pkg-lib-rpm.inc");{% endif %} benoit@0: benoit@0: release = get_kb_item("ssh/login/release"); benoit@0: benoit@0: res = ""; benoit@0: if(release == NULL){ benoit@0: exit(0); benoit@0: } benoit@0: benoit@0: {%- if red_hat %} benoit@0: {{ nasl_core.isrpmvuln(cvrf.getProductList(), cvrf._producttree) }} benoit@0: {%- else %} benoit@0: # Not red_hat benoit@0: {%- endif %} benoit@0: benoit@0: if (__pkg_match) exit(99); # Not vulnerable. benoit@0: exit(0);