EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120) - Nessus

High   Plugin ID: 109620

This page contains detailed information about the EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 109620
Name: EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120)
Filename: EulerOS_SA-2018-1120.nasl
Vulnerability Published: N/A
This Plugin Published: 2018-05-09
Last Modification Time: 2021-01-06
Plugin Version: 1.17
Plugin Type: local
Plugin Family: Huawei Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/EulerOS/release, Host/EulerOS/rpm-list, Host/EulerOS/sp, Host/local_checks_enabled
Excluded KB Items: Host/EulerOS/uvp_version

Vulnerability Information


Severity: High
Vulnerability Published: N/A
Patch Published: 2018-05-10
CVE [?]: CVE-2018-1087, CVE-2018-8897
CPE [?]: cpe:/o:huawei:euleros:2.0, p-cpe:/a:huawei:euleros:kernel, p-cpe:/a:huawei:euleros:kernel-debuginfo, p-cpe:/a:huawei:euleros:kernel-debuginfo-common-x86_64, p-cpe:/a:huawei:euleros:kernel-devel, p-cpe:/a:huawei:euleros:kernel-headers, p-cpe:/a:huawei:euleros:kernel-tools, p-cpe:/a:huawei:euleros:kernel-tools-libs
Exploited by Malware: True

Synopsis

The remote EulerOS host is missing multiple security updates.

Description

According to the versions of the kernel packages installed, the EulerOS installation on the remote host is affected by the following vulnerabilities :

- A statement in the System Programming Guide of the Intel 64 and IA-32 Architectures Software Developer's Manual (SDM) was mishandled in the development of some or all operating-system kernels, resulting in unexpected behavior for #DB exceptions that are deferred by MOV SS or POP SS, as demonstrated by (for example) privilege escalation in Windows, macOS, some Xen configurations, or FreeBSD, or a Linux kernel crash. The MOV to SS and POP SS instructions inhibit interrupts (including NMIs), data breakpoints, and single step trap exceptions until the instruction boundary following the next instruction (SDM Vol. 3A section 6.8.3). (The inhibited data breakpoints are those on memory accessed by the MOV to SS or POP to SS instruction itself.) Note that debug exceptions are not inhibited by the interrupt enable (EFLAGS.IF) system flag (SDM Vol. 3A section 2.3). If the instruction following the MOV to SS or POP to SS instruction is an instruction like SYSCALL, SYSENTER, INT 3, etc. that transfers control to the operating system at CPL i1/4oe 3, the debug exception is delivered after the transfer to CPL i1/4oe 3 is complete. OS kernels may not expect this order of events and may therefore experience unexpected behavior when it occurs.i1/4^CVE-2018-8897)

- On x86, MOV SS and POP SS behave strangely if they encounter a data breakpoint. If this occurs in a KVM guest, KVM incorrectly thinks that a #DB instruction was caused by the undocumented ICEBP instruction. This results in #DB being delivered to the guest kernel with an incorrect RIP on the stack. On most guest kernels, this will allow a guest user to DoS the guest kernel or even to escalate privilege to that of the guest kernel. (CVE-2018-1087)

Note that Tenable Network Security has extracted the preceding description block directly from the EulerOS security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.

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)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120) vulnerability:

  1. Metasploit: exploit/windows/local/mov_ss
    [Microsoft Windows POP/MOV SS Local Privilege Elevation Vulnerability]
  2. Exploit-DB: exploits/windows/local/44697.txt
    [EDB-44697: Microsoft Windows - 'POP/MOV SS' Privilege Escalation]
  3. Exploit-DB: exploits/windows/local/45024.rb
    [EDB-45024: Microsoft Windows - POP/MOV SS Local Privilege Elevation (Metasploit)]
  4. GitHub: https://github.com/Apri1y/Red-Team-links
    [CVE-2018-8897]
  5. GitHub: https://github.com/CrackerCat/Kernel-Security-Development
    [CVE-2018-8897]
  6. GitHub: https://github.com/Echocipher/Resource-list
    [CVE-2018-8897]
  7. GitHub: https://github.com/ExpLife0011/awesome-windows-kernel-security-development
    [CVE-2018-8897]
  8. GitHub: https://github.com/Ondrik8/exploit
    [CVE-2018-8897]
  9. GitHub: https://github.com/hudunkey/Red-Team-links
    [CVE-2018-8897]
  10. GitHub: https://github.com/john-80/-007
    [CVE-2018-8897]
  11. GitHub: https://github.com/lp008/Hack-readme
    [CVE-2018-8897]
  12. GitHub: https://github.com/pr0code/https-github.com-ExpLife0011-awesome-windows-kernel-security-development
    [CVE-2018-8897]
  13. GitHub: https://github.com/pravinsrc/NOTES-windows-kernel-links
    [CVE-2018-8897]
  14. GitHub: https://github.com/slimdaddy/RedTeam
    [CVE-2018-8897]
  15. GitHub: https://github.com/whiteHat001/Kernel-Security
    [CVE-2018-8897]
  16. GitHub: https://github.com/xiaoZ-hc/redtool
    [CVE-2018-8897]
  17. GitHub: https://www.triplefault.io/2018/05/spurious-db-exceptions-with-pop-ss.html
    [CVE-2018-8897]
  18. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/44697.zip
    [EDB-44697]
  19. GitHub: https://github.com/can1357/CVE-2018-8897
    [CVE-2018-8897: Arbitrary code execution with kernel privileges using CVE-2018-8897.]
  20. GitHub: https://github.com/jiazhang0/pop-mov-ss-exploit
    [CVE-2018-8897: The exploitation for CVE-2018-8897]
  21. GitHub: https://github.com/nmulasmajic/CVE-2018-8897
    [CVE-2018-8897: Implements the POP/MOV SS (CVE-2018-8897) vulnerability by bugchecking the machine ...]
  22. GitHub: https://github.com/nmulasmajic/syscall_exploit_CVE-2018-8897
    [CVE-2018-8897: Implements the POP/MOV SS (CVE-2018-8897) vulnerability by leveraging SYSCALL to ...]

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)
CVSS V3 Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:7.8 (High)
Impact Subscore:5.9
Exploitability Subscore:1.8
CVSS Temporal Score:7.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.5 (High)

Go back to menu.

Plugin Source


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

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

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

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

  script_cve_id(
    "CVE-2018-1087",
    "CVE-2018-8897"
  );

  script_name(english:"EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120)");
  script_summary(english:"Checks the rpm output for the updated packages.");

  script_set_attribute(attribute:"synopsis", value:
"The remote EulerOS host is missing multiple security updates.");
  script_set_attribute(attribute:"description", value:
"According to the versions of the kernel packages installed, the
EulerOS installation on the remote host is affected by the following
vulnerabilities :

  - A statement in the System Programming Guide of the
    Intel 64 and IA-32 Architectures Software Developer's
    Manual (SDM) was mishandled in the development of some
    or all operating-system kernels, resulting in
    unexpected behavior for #DB exceptions that are
    deferred by MOV SS or POP SS, as demonstrated by (for
    example) privilege escalation in Windows, macOS, some
    Xen configurations, or FreeBSD, or a Linux kernel
    crash. The MOV to SS and POP SS instructions inhibit
    interrupts (including NMIs), data breakpoints, and
    single step trap exceptions until the instruction
    boundary following the next instruction (SDM Vol. 3A
    section 6.8.3). (The inhibited data breakpoints are
    those on memory accessed by the MOV to SS or POP to SS
    instruction itself.) Note that debug exceptions are not
    inhibited by the interrupt enable (EFLAGS.IF) system
    flag (SDM Vol. 3A section 2.3). If the instruction
    following the MOV to SS or POP to SS instruction is an
    instruction like SYSCALL, SYSENTER, INT 3, etc. that
    transfers control to the operating system at CPL i1/4oe 3,
    the debug exception is delivered after the transfer to
    CPL i1/4oe 3 is complete. OS kernels may not expect this
    order of events and may therefore experience unexpected
    behavior when it occurs.i1/4^CVE-2018-8897)

  - On x86, MOV SS and POP SS behave strangely if they
    encounter a data breakpoint. If this occurs in a KVM
    guest, KVM incorrectly thinks that a #DB instruction
    was caused by the undocumented ICEBP instruction. This
    results in #DB being delivered to the guest kernel with
    an incorrect RIP on the stack. On most guest kernels,
    this will allow a guest user to DoS the guest kernel or
    even to escalate privilege to that of the guest kernel.
    (CVE-2018-1087)

Note that Tenable Network Security has extracted the preceding
description block directly from the EulerOS security advisory. Tenable
has attempted to automatically clean and format it as much as possible
without introducing additional issues.");
  # https://developer.huaweicloud.com/ict/en/site-euleros/euleros/security-advisories/EulerOS-SA-2018-1120
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?1f38e229");
  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_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Microsoft Windows POP/MOV SS Local Privilege Elevation Vulnerability');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"patch_publication_date", value:"2018/05/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/05/09");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-debuginfo-common-x86_64");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-headers");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-tools");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-tools-libs");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:huawei:euleros:2.0");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Huawei Local Security Checks");

  script_copyright(english:"This script is Copyright (C) 2018-2021 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/EulerOS/release", "Host/EulerOS/rpm-list", "Host/EulerOS/sp");
  script_exclude_keys("Host/EulerOS/uvp_version");

  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/EulerOS/release");
if (isnull(release) || release !~ "^EulerOS") audit(AUDIT_OS_NOT, "EulerOS");
if (release !~ "^EulerOS release 2\.0(\D|$)") audit(AUDIT_OS_NOT, "EulerOS 2.0");

sp = get_kb_item("Host/EulerOS/sp");
if (isnull(sp) || sp !~ "^(2)$") audit(AUDIT_OS_NOT, "EulerOS 2.0 SP2");

uvp = get_kb_item("Host/EulerOS/uvp_version");
if (!empty_or_null(uvp)) audit(AUDIT_OS_NOT, "EulerOS 2.0 SP2", "EulerOS UVP " + uvp);

if (!get_kb_item("Host/EulerOS/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$" && "aarch64" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "EulerOS", cpu);
if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_ARCH_NOT, "i686 / x86_64", cpu);

flag = 0;

pkgs = ["kernel-3.10.0-327.62.59.83.h82",
        "kernel-debuginfo-3.10.0-327.62.59.83.h82",
        "kernel-debuginfo-common-x86_64-3.10.0-327.62.59.83.h82",
        "kernel-devel-3.10.0-327.62.59.83.h82",
        "kernel-headers-3.10.0-327.62.59.83.h82",
        "kernel-tools-3.10.0-327.62.59.83.h82",
        "kernel-tools-libs-3.10.0-327.62.59.83.h82"];

foreach (pkg in pkgs)
  if (rpm_check(release:"EulerOS-2.0", sp:"2", reference:pkg)) 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");
}

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

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/EulerOS_SA-2018-1120.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\EulerOS_SA-2018-1120.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/EulerOS_SA-2018-1120.nasl

Go back to menu.

How to Run


Here is how to run the EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120) 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 Huawei Local Security Checks plugin family.
  6. On the right side table select EulerOS 2.0 SP2 : kernel (EulerOS-SA-2018-1120) plugin ID 109620.
  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 EulerOS_SA-2018-1120.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a EulerOS_SA-2018-1120.nasl -t <IP/HOST>

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

/opt/nessus/bin/nasl -T - EulerOS_SA-2018-1120.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 EulerOS_SA-2018-1120.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 109603 - KB4103716: Windows 10 May 2018 Security Update
  • 109604 - KB4103712: Windows 7 and Windows Server 2008 R2 May 2018 Security Update
  • 109605 - KB4103721: Windows 10 Version 1803 and Windows Server Version 1803 May 2018 Security Update
  • 109606 - KB4103723: Windows 10 Version 1607 and Windows Server 2016 May 2018 Security Update
  • 109607 - KB4103715: Windows 8.1 and Windows Server 2012 R2 May 2018 Security Update
  • 109608 - KB4103727: Windows 10 Version 1709 and Windows Server Version 1709 May 2018 Security Update
  • 109610 - KB4103726: Windows Server 2012 May 2018 Security Update
  • 109611 - KB4103731: Windows 10 Version 1703 May 2018 Security Update
  • 109619 - EulerOS 2.0 SP1 : kernel (EulerOS-SA-2018-1119)
  • 109625 - FreeBSD : FreeBSD -- Mishandling of x86 debug exceptions (521ce804-52fd-11e8-9123-a4badb2f4699)
  • 109629 - Oracle Linux 6 : kernel (ELSA-2018-1319)
  • 109630 - Oracle Linux 6 / 7 : Unbreakable Enterprise kernel (ELSA-2018-4096)
  • 109631 - Oracle Linux 6 : Unbreakable Enterprise kernel (ELSA-2018-4097)
  • 109632 - Oracle Linux 6 / 7 : Unbreakable Enterprise kernel (ELSA-2018-4098)
  • 109633 - RHEL 7 : kernel (RHSA-2018:1318)
  • 109634 - RHEL 6 : kernel (RHSA-2018:1319) (Meltdown)
  • 109635 - RHEL 7 : kernel (RHSA-2018:1345)
  • 109636 - RHEL 6 : kernel (RHSA-2018:1346) (Meltdown)
  • 109637 - RHEL 7 : kernel (RHSA-2018:1347)
  • 109638 - RHEL 7 : kernel (RHSA-2018:1348)
  • 109639 - RHEL 6 : kernel (RHSA-2018:1349)
  • 109640 - RHEL 6 : kernel (RHSA-2018:1350)
  • 109641 - RHEL 6 : kernel (RHSA-2018:1351)
  • 109642 - RHEL 7 : kernel-rt (RHSA-2018:1355)
  • 109643 - Scientific Linux Security Update : kernel on SL6.x i386/x86_64 (20180508) (Meltdown)
  • 109644 - Scientific Linux Security Update : kernel on SL7.x x86_64 (20180508)

Version


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

Go back to menu.