CentOS 4 : kernel (CESA-2009:1223) - Nessus

High   Plugin ID: 40753

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

Plugin Overview


ID: 40753
Name: CentOS 4 : kernel (CESA-2009:1223)
Filename: centos_RHSA-2009-1223.nasl
Vulnerability Published: 2009-08-14
This Plugin Published: 2009-08-25
Last Modification Time: 2021-01-04
Plugin Version: 1.21
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: 2009-08-14
Patch Published: 2009-08-24
CVE [?]: CVE-2009-2692, CVE-2009-2698
CPE [?]: cpe:/o:centos:centos:4, p-cpe:/a:centos:centos:kernel, p-cpe:/a:centos:centos:kernel-devel, p-cpe:/a:centos:centos:kernel-doc, p-cpe:/a:centos:centos:kernel-hugemem, p-cpe:/a:centos:centos:kernel-hugemem-devel, p-cpe:/a:centos:centos:kernel-largesmp, p-cpe:/a:centos:centos:kernel-largesmp-devel, p-cpe:/a:centos:centos:kernel-smp, p-cpe:/a:centos:centos:kernel-smp-devel, p-cpe:/a:centos:centos:kernel-xenU, p-cpe:/a:centos:centos:kernel-xenU-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 4.

This update has been rated as having important security impact by the Red Hat Security Response Team.

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

These updated packages fix the following security issues :

* a flaw was found in the SOCKOPS_WRAP macro in the Linux kernel. This macro did not initialize the sendpage operation in the proto_ops structure correctly. A local, unprivileged user could use this flaw to cause a local denial of service or escalate their privileges. (CVE-2009-2692, Important)

* a flaw was found in the udp_sendmsg() implementation in the Linux kernel when using the MSG_MORE flag on UDP sockets. A local, unprivileged user could use this flaw to cause a local denial of service or escalate their privileges. (CVE-2009-2698, Important)

Red Hat would like to thank Tavis Ormandy and Julien Tinnes of the Google Security Team for responsibly reporting these flaws.

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 4 : kernel (CESA-2009:1223) vulnerability:

  1. Metasploit: exploit/linux/local/sock_sendpage
    [Linux Kernel Sendpage Local Privilege Escalation]
  2. Exploit-DB: exploits/android/local/9477.txt
    [EDB-9477: Linux Kernel 2.x (Android) - 'sock_sendpage()' Local Privilege Escalation]
  3. Exploit-DB: exploits/linux/local/9479.c
    [EDB-9479: Linux Kernel 2.4/2.6 (RedHat Linux 9 / Fedora Core 4 < 11 / Whitebox 4 / CentOS 4) - 'sock_sendpage()' Ring0 Privilege Escalation (5)]
  4. Exploit-DB: exploits/linux_x86/local/9542.c
    [EDB-9542: Linux Kernel 2.6 < 2.6.19 (White Box 4 / CentOS 4.4/4.5 / Fedora Core 4/5/6 x86) - 'ip_append_data()' Ring0 Privilege Escalation (1)]
  5. Exploit-DB: exploits/linux/local/9574.txt
    [EDB-9574: Linux Kernel < 2.6.19 (x86/x64) - 'udp_sendmsg' Local Privilege Escalation (2)]
  6. Exploit-DB: exploits/linux/local/9575.c
    [EDB-9575: Linux Kernel < 2.6.19 (Debian 4) - 'udp_sendmsg' Local Privilege Escalation (3)]
  7. Exploit-DB: exploits/linux/local/19933.rb
    [EDB-19933: Linux Kernel 2.4.4 < 2.4.37.4 / 2.6.0 < 2.6.30.4 - 'Sendpage' Local Privilege Escalation (Metasploit)]
  8. GitHub: https://github.com/Al1ex/LinuxEelvation
    [CVE-2009-2692]
  9. GitHub: https://github.com/De4dCr0w/Linux-kernel-EoP-exp
    [CVE-2009-2692]
  10. GitHub: https://github.com/InteliSecureLabs/Linux_Exploit_Suggester
    [CVE-2009-2692]
  11. GitHub: https://github.com/PleXone2019/Linux_Exploit_Suggester
    [CVE-2009-2692]
  12. GitHub: https://github.com/R0B1NL1N/Linux-Kernal-Exploits-m-
    [CVE-2009-2692]
  13. GitHub: https://github.com/R0B1NL1N/Linux-Kernel-Exploites
    [CVE-2009-2692]
  14. GitHub: https://github.com/Snoopy-Sec/Localroot-ALL-CVE
    [CVE-2009-2692]
  15. GitHub: https://github.com/Technoashofficial/kernel-exploitation-linux
    [CVE-2009-2692]
  16. GitHub: https://github.com/cloudsec/exploit
    [CVE-2009-2692]
  17. GitHub: https://github.com/h4x0r-dz/local-root-exploit-
    [CVE-2009-2692]
  18. GitHub: https://github.com/moshekaplan/pentesting_notes
    [CVE-2009-2692]
  19. GitHub: https://github.com/packetforger/localroot
    [CVE-2009-2692]
  20. GitHub: https://github.com/qashqao/linux-xsuggest
    [CVE-2009-2692]
  21. GitHub: https://github.com/qiantu88/Linux--exp
    [CVE-2009-2692]
  22. GitHub: https://github.com/rakjong/LinuxElevation
    [CVE-2009-2692]
  23. GitHub: https://github.com/ram4u/Linux_Exploit_Suggester
    [CVE-2009-2692]
  24. GitHub: https://github.com/skbasava/Linux-Kernel-exploit
    [CVE-2009-2692]
  25. GitHub: https://github.com/tangsilian/android-vuln
    [CVE-2009-2692]
  26. GitHub: https://github.com/taviso/iknowthis
    [CVE-2009-2692]
  27. GitHub: https://github.com/xairy/linux-kernel-exploitation
    [CVE-2009-2692]
  28. GitHub: https://github.com/Al1ex/LinuxEelvation
    [CVE-2009-2698]
  29. GitHub: https://github.com/De4dCr0w/Linux-kernel-EoP-exp
    [CVE-2009-2698]
  30. GitHub: https://github.com/R0B1NL1N/Linux-Kernal-Exploits-m-
    [CVE-2009-2698]
  31. GitHub: https://github.com/R0B1NL1N/Linux-Kernel-Exploites
    [CVE-2009-2698]
  32. GitHub: https://github.com/Snoopy-Sec/Localroot-ALL-CVE
    [CVE-2009-2698]
  33. GitHub: https://github.com/cloudsec/exploit
    [CVE-2009-2698]
  34. GitHub: https://github.com/h4x0r-dz/local-root-exploit-
    [CVE-2009-2698]
  35. GitHub: https://github.com/packetforger/localroot
    [CVE-2009-2698]
  36. GitHub: https://github.com/qiantu88/Linux--exp
    [CVE-2009-2698]
  37. GitHub: https://github.com/rakjong/LinuxElevation
    [CVE-2009-2698]
  38. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/9477.tar.gz
    [EDB-9477]
  39. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/9574.tgz
    [EDB-9574]
  40. GitHub: https://github.com/jdvalentini/CVE-2009-2692
    [CVE-2009-2692: Linux Null pointer dereference]
  41. GitHub: https://github.com/xiaoxiaoleo/CVE-2009-2698
    [CVE-2009-2698: CVE-2009-2698 compiled for CentOS 4.8]
  42. 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 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-2009-1223.nasl nessus plugin source code. This script is Copyright (C) 2009-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-2009:1223 and 
# CentOS Errata and Security Advisory 2009:1223 respectively.
#

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

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

  script_cve_id("CVE-2009-2692", "CVE-2009-2698");
  script_bugtraq_id(36038);
  script_xref(name:"RHSA", value:"2009:1223");

  script_name(english:"CentOS 4 : kernel (CESA-2009:1223)");
  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 4.

This update has been rated as having important security impact by the
Red Hat Security Response Team.

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

These updated packages fix the following security issues :

* a flaw was found in the SOCKOPS_WRAP macro in the Linux kernel. This
macro did not initialize the sendpage operation in the proto_ops
structure correctly. A local, unprivileged user could use this flaw to
cause a local denial of service or escalate their privileges.
(CVE-2009-2692, Important)

* a flaw was found in the udp_sendmsg() implementation in the Linux
kernel when using the MSG_MORE flag on UDP sockets. A local,
unprivileged user could use this flaw to cause a local denial of
service or escalate their privileges. (CVE-2009-2698, Important)

Red Hat would like to thank Tavis Ormandy and Julien Tinnes of the
Google Security Team for responsibly reporting these flaws.

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/2009-August/016107.html
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.nessus.org/u?2eaa249d"
  );
  # https://lists.centos.org/pipermail/centos-announce/2009-August/016108.html
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.nessus.org/u?9a687bf1"
  );
  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:"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:'Linux Kernel Sendpage Local 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_cwe_id(119);

  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-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-hugemem");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-hugemem-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-largesmp");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-largesmp-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-smp");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-smp-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-xenU");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:kernel-xenU-devel");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:centos:centos:4");

  script_set_attribute(attribute:"vuln_publication_date", value:"2009/08/14");
  script_set_attribute(attribute:"patch_publication_date", value:"2009/08/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2009/08/25");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2009-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:"^4([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "CentOS 4.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 && "ia64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "CentOS", cpu);


flag = 0;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-doc-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-doc-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-hugemem-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-hugemem-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-largesmp-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-largesmp-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-smp-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-smp-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-smp-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-smp-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-xenU-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-xenU-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"i386", reference:"kernel-xenU-devel-2.6.9-89.0.9.EL")) flag++;
if (rpm_check(release:"CentOS-4", cpu:"x86_64", reference:"kernel-xenU-devel-2.6.9-89.0.9.EL")) 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-devel / kernel-doc / kernel-hugemem / 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-2009-1223.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\centos_RHSA-2009-1223.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/centos_RHSA-2009-1223.nasl

Go back to menu.

How to Run


Here is how to run the CentOS 4 : kernel (CESA-2009:1223) 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 4 : kernel (CESA-2009:1223) plugin ID 40753.
  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-2009-1223.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a centos_RHSA-2009-1223.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-2009-1223.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-2009-1223.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: RHSA | Red Hat Security Advisory: CWE | Common Weakness Enumeration:
  • CWE-119 (Weakness) Improper Restriction of Operations within the Bounds of a Memory Buffer
See also: Similar and related Nessus plugins:
  • 43777 - CentOS 5 : kernel (CESA-2009:1222)
  • 40808 - CentOS 3 : kernel (CESA-2009:1233)
  • 44727 - Debian DSA-1862-1 : linux-2.6 - privilege escalation
  • 44729 - Debian DSA-1864-1 : linux-2.6.24 - privilege escalation
  • 44730 - Debian DSA-1865-1 : linux-2.6 - denial of service/privilege escalation
  • 41973 - Fedora 10 : kernel-2.6.27.35-170.2.94.fc10 (2009-10165)
  • 43125 - Fedora 10 : kernel-2.6.27.41-170.2.117.fc10 (2009-13098)
  • 40605 - Fedora 10 : kernel-2.6.27.29-170.2.79.fc10 (2009-8647)
  • 40606 - Fedora 11 : kernel-2.6.29.6-217.2.7.fc11 (2009-8649)
  • 40629 - Fedora 11 : kernel-2.6.29.6-217.2.8.fc11 (2009-8684)
  • 40637 - Mandriva Linux Security Advisory : kernel (MDVSA-2009:205)
  • 40980 - Mandriva Linux Security Advisory : kernel (MDVSA-2009:233)
  • 67914 - Oracle Linux 5 : kernel (ELSA-2009-1222)
  • 67915 - Oracle Linux 4 : kernel (ELSA-2009-1223)
  • 67917 - Oracle Linux 3 : kernel (ELSA-2009-1233)
  • 79465 - OracleVM 2.1 : kernel (OVMSA-2009-0023)
  • 79507 - OracleVM 2.2 : kernel (OVMSA-2013-0039)
  • 40765 - RHEL 5 : kernel (RHSA-2009:1222)
  • 40766 - RHEL 4 : kernel (RHSA-2009:1223)
  • 40795 - RHEL 3 : kernel (RHSA-2009:1233)
  • 63896 - RHEL 5 : kernel (RHSA-2009:1457)
  • 63899 - RHEL 4 : kernel (RHSA-2009:1469)
  • 40658 - Ubuntu 6.06 LTS / 8.04 LTS / 8.10 / 9.04 : linux, linux-source-2.6.15 vulnerability (USN-819-1)
  • 42870 - VMSA-2009-0016 : VMware vCenter and ESX update release and vMA patch release address multiple security issues in third party components.
  • 89117 - VMware ESX / ESXi Multiple Vulnerabilities (VMSA-2009-0016) (remote check)
  • 47150 - VMSA-2010-0010 : ESX 3.5 third-party update for Service Console kernel

Version


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

Go back to menu.