CentOS 5 : kernel (CESA-2012:0721) - Nessus

High   Plugin ID: 59479

This page contains detailed information about the CentOS 5 : kernel (CESA-2012:0721) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 59479
Name: CentOS 5 : kernel (CESA-2012:0721)
Filename: centos_RHSA-2012-0721.nasl
Vulnerability Published: 2012-06-12
This Plugin Published: 2012-06-14
Last Modification Time: 2021-01-04
Plugin Version: 1.17
Plugin Type: local
Plugin Family: CentOS Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/CentOS/release, Host/CentOS/rpm-list, Host/local_checks_enabled

Vulnerability Information


Severity: High
Vulnerability Published: 2012-06-12
Patch Published: 2012-06-12
CVE [?]: CVE-2012-0217, CVE-2012-2934
CPE [?]: cpe:/o:centos:centos:5, p-cpe:/a:centos:centos:kernel, p-cpe:/a:centos:centos:kernel-PAE, p-cpe:/a:centos:centos:kernel-PAE-devel, p-cpe:/a:centos:centos:kernel-debug, p-cpe:/a:centos:centos:kernel-debug-devel, p-cpe:/a:centos:centos:kernel-devel, p-cpe:/a:centos:centos:kernel-doc, p-cpe:/a:centos:centos:kernel-headers, p-cpe:/a:centos:centos:kernel-xen, p-cpe:/a:centos:centos:kernel-xen-devel
Exploited by Malware: True

Synopsis

The remote CentOS host is missing one or more security updates.

Description

Updated kernel packages that fix two security issues are now available for Red Hat Enterprise Linux 5.

The Red Hat Security Response Team has rated this update as having important security impact. Common Vulnerability Scoring System (CVSS) base scores, which give detailed severity ratings, are available for each vulnerability from the CVE links in the References section.

The kernel packages contain the Linux kernel, the core of any Linux operating system.

This update fixes the following security issues :

* It was found that the Xen hypervisor implementation as shipped with Red Hat Enterprise Linux 5 did not properly restrict the syscall return addresses in the sysret return path to canonical addresses. An unprivileged user in a 64-bit para-virtualized guest, that is running on a 64-bit host that has an Intel CPU, could use this flaw to crash the host or, potentially, escalate their privileges, allowing them to execute arbitrary code at the hypervisor level. (CVE-2012-0217, Important)

* It was found that guests could trigger a bug in earlier AMD CPUs, leading to a CPU hard lockup, when running on the Xen hypervisor implementation. An unprivileged user in a 64-bit para-virtualized guest could use this flaw to crash the host. Warning: After installing this update, hosts that are using an affected AMD CPU (refer to Red Hat Bugzilla bug #824966 for a list) will fail to boot. In order to boot such hosts, the new kernel parameter, allow_unsafe, can be used ('allow_unsafe=on'). This option should only be used with hosts that are running trusted guests, as setting it to 'on' reintroduces the flaw (allowing guests to crash the host). (CVE-2012-2934, Moderate)

Note: For Red Hat Enterprise Linux guests, only privileged guest users can exploit the CVE-2012-0217 and CVE-2012-2934 issues.

Red Hat would like to thank the Xen project for reporting these issues. Upstream acknowledges Rafal Wojtczuk as the original reporter of CVE-2012-0217.

Users should upgrade to these updated packages, which contain backported patches to correct these issues. The system must be rebooted for this update to take effect.

Solution

Update the affected kernel packages.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Immunity Canvas, Core Impact)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the CentOS 5 : kernel (CESA-2012:0721) vulnerability:

  1. Metasploit: exploit/freebsd/local/intel_sysret_priv_esc
    [FreeBSD Intel SYSRET Privilege Escalation]
  2. Exploit-DB: exploits/freebsd_x86-64/local/46508.rb
    [EDB-46508: FreeBSD - Intel SYSRET Privilege Escalation (Metasploit)]
  3. GitHub: https://github.com/Apri1y/Red-Team-links
    [CVE-2012-0217]
  4. GitHub: https://github.com/Ascotbe/Kernelhub
    [CVE-2012-0217]
  5. GitHub: https://github.com/Echocipher/Resource-list
    [CVE-2012-0217]
  6. GitHub: https://github.com/Flerov/WindowsExploitDev
    [CVE-2012-0217]
  7. GitHub: https://github.com/Snoopy-Sec/Localroot-ALL-CVE
    [CVE-2012-0217]
  8. GitHub: https://github.com/anoaghost/Localroot_Compile
    [CVE-2012-0217]
  9. GitHub: https://github.com/cranelab/exploit-development
    [CVE-2012-0217]
  10. GitHub: https://github.com/felixlinker/ifc-rv-thesis
    [CVE-2012-0217]
  11. GitHub: https://github.com/hudunkey/Red-Team-links
    [CVE-2012-0217]
  12. GitHub: https://github.com/john-80/-007
    [CVE-2012-0217]
  13. GitHub: https://github.com/lp008/Hack-readme
    [CVE-2012-0217]
  14. GitHub: https://github.com/slimdaddy/RedTeam
    [CVE-2012-0217]
  15. GitHub: https://github.com/xiaoZ-hc/redtool
    [CVE-2012-0217]
  16. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2012-0217]
  17. Immunity Canvas: CANVAS

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2012-0217
CVSS V2 Vector: AV:L/AC:L/Au:N/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:7.2 (High)
Impact Subscore:10.0
Exploitability Subscore:3.9
CVSS Temporal Score:6.3 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.3 (Medium)

Go back to menu.

Plugin Source


This is the centos_RHSA-2012-0721.nasl nessus plugin source code. This script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were  
# extracted from Red Hat Security Advisory RHSA-2012:0721 and 
# CentOS Errata and Security Advisory 2012:0721 respectively.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(59479);
  script_version("1.17");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/04");

  script_cve_id("CVE-2012-0217", "CVE-2012-2934");
  script_bugtraq_id(53961);
  script_xref(name:"RHSA", value:"2012:0721");

  script_name(english:"CentOS 5 : kernel (CESA-2012:0721)");
  script_summary(english:"Checks rpm output for the updated packages");

  script_set_attribute(
    attribute:"synopsis", 
    value:"The remote CentOS host is missing one or more security updates."
  );
  script_set_attribute(
    attribute:"description", 
    value:
"Updated kernel packages that fix two security issues are now available
for Red Hat Enterprise Linux 5.

The Red Hat Security Response Team has rated this update as having
important security impact. Common Vulnerability Scoring System (CVSS)
base scores, which give detailed severity ratings, are available for
each vulnerability from the CVE links in the References section.

The kernel packages contain the Linux kernel, the core of any Linux
operating system.

This update fixes the following security issues :

* It was found that the Xen hypervisor implementation as shipped with
Red Hat Enterprise Linux 5 did not properly restrict the syscall
return addresses in the sysret return path to canonical addresses. An
unprivileged user in a 64-bit para-virtualized guest, that is running
on a 64-bit host that has an Intel CPU, could use this flaw to crash
the host or, potentially, escalate their privileges, allowing them to
execute arbitrary code at the hypervisor level. (CVE-2012-0217,
Important)

* It was found that guests could trigger a bug in earlier AMD CPUs,
leading to a CPU hard lockup, when running on the Xen hypervisor
implementation. An unprivileged user in a 64-bit para-virtualized
guest could use this flaw to crash the host. Warning: After installing
this update, hosts that are using an affected AMD CPU (refer to Red
Hat Bugzilla bug #824966 for a list) will fail to boot. In order to
boot such hosts, the new kernel parameter, allow_unsafe, can be used
('allow_unsafe=on'). This option should only be used with hosts that
are running trusted guests, as setting it to 'on' reintroduces the
flaw (allowing guests to crash the host). (CVE-2012-2934, Moderate)

Note: For Red Hat Enterprise Linux guests, only privileged guest users
can exploit the CVE-2012-0217 and CVE-2012-2934 issues.

Red Hat would like to thank the Xen project for reporting these
issues. Upstream acknowledges Rafal Wojtczuk as the original reporter
of CVE-2012-0217.

Users should upgrade to these updated packages, which contain
backported patches to correct these issues. The system must be
rebooted for this update to take effect."
  );
  # https://lists.centos.org/pipermail/centos-announce/2012-June/018678.html
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.nessus.org/u?fe9573fb"
  );
  script_set_attribute(
    attribute:"solution", 
    value:"Update the affected kernel packages."
  );
  script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-0217");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'FreeBSD Intel SYSRET Privilege Escalation');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'CANVAS');

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-PAE");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-PAE-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-debug");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-debug-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-doc");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-headers");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-xen");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-xen-devel");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:centos:centos:5");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/06/12");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/06/12");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/06/14");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_family(english:"CentOS Local Security Checks");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/CentOS/release", "Host/CentOS/rpm-list");

  exit(0);
}


include("audit.inc");
include("global_settings.inc");
include("rpm.inc");


if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
release = get_kb_item("Host/CentOS/release");
if (isnull(release) || "CentOS" >!< release) audit(AUDIT_OS_NOT, "CentOS");
os_ver = pregmatch(pattern: "CentOS(?: Linux)? release ([0-9]+)", string:release);
if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "CentOS");
os_ver = os_ver[1];
if (! preg(pattern:"^5([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "CentOS 5.x", "CentOS " + os_ver);

if (!get_kb_item("Host/CentOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);


cpu = get_kb_item("Host/cpu");
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "CentOS", cpu);


flag = 0;
if (rpm_check(release:"CentOS-5", reference:"kernel-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", cpu:"i386", reference:"kernel-PAE-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", cpu:"i386", reference:"kernel-PAE-devel-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-debug-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-debug-devel-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-devel-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-doc-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-headers-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-xen-2.6.18-308.8.2.el5")) flag++;
if (rpm_check(release:"CentOS-5", reference:"kernel-xen-devel-2.6.18-308.8.2.el5")) flag++;


if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_HOLE,
    extra      : rpm_report_get()
  );
  exit(0);
}
else
{
  tested = pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, "kernel / kernel-PAE / kernel-PAE-devel / kernel-debug / etc");
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/centos_RHSA-2012-0721.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\centos_RHSA-2012-0721.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/centos_RHSA-2012-0721.nasl

Go back to menu.

How to Run


Here is how to run the CentOS 5 : kernel (CESA-2012:0721) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select CentOS Local Security Checks plugin family.
  6. On the right side table select CentOS 5 : kernel (CESA-2012:0721) plugin ID 59479.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl centos_RHSA-2012-0721.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a centos_RHSA-2012-0721.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - centos_RHSA-2012-0721.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state centos_RHSA-2012-0721.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: RHSA | Red Hat Security Advisory: See also: Similar and related Nessus plugins:
  • 59779 - Debian DSA-2501-1 : xen - several vulnerabilities
  • 60088 - Debian DSA-2508-1 : kfreebsd-8 - privilege escalation
  • 59748 - FreeBSD : FreeBSD -- Privilege escalation when returning from kernel (aed44c4e-c067-11e1-b5e0-000c299b62e1)
  • 70184 - GLSA-201309-24 : Xen: Multiple vulnerabilities
  • 74682 - openSUSE Security Update : xen (openSUSE-SU-2012:0886-1)
  • 74683 - openSUSE Security Update : xen (openSUSE-2012-404)
  • 68539 - Oracle Linux 5 : kernel (ELSA-2012-0721-1)
  • 68540 - Oracle Linux 5 : kernel (ELSA-2012-0721)
  • 79476 - OracleVM 3.0 : xen (OVMSA-2012-0020)
  • 79477 - OracleVM 3.1 : xen (OVMSA-2012-0021)
  • 79478 - OracleVM 2.2 : xen (OVMSA-2012-0022)
  • 84140 - OracleVM 3.2 : xen (OVMSA-2015-0068) (POODLE) (Venom)
  • 64039 - RHEL 5 : kernel (RHSA-2012:0720)
  • 59467 - RHEL 5 : kernel (RHSA-2012:0721)
  • 61326 - Scientific Linux Security Update : kernel on SL5.x i386/x86_64 (20120612)
  • 59460 - MS12-042: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (2711167)
  • 76829 - Oracle Solaris Critical Patch Update : oct2012_SRU10_5
  • 64233 - SuSE 11.1 Security Update : Xen (SAT Patch Number 6399)
  • 59469 - SuSE 10 Security Update : Xen (ZYPP Patch Number 8180)
  • 68573 - Oracle Linux 5 : kernel (ELSA-2012-1061-1)
  • 68574 - Oracle Linux 5 : kernel (ELSA-2012-1061)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file centos_RHSA-2012-0721.nasl version 1.17. For more plugins, visit the Nessus Plugin Library.

Go back to menu.