Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011) - Nessus

High   Plugin ID: 160425

This page contains detailed information about the Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 160425
Name: Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011)
Filename: al2_ALASKERNEL-5_10-2022-011.nasl
Vulnerability Published: 2022-03-07
This Plugin Published: 2022-05-02
Last Modification Time: 2022-05-03
Plugin Version: 1.3
Plugin Type: local
Plugin Family: Amazon Linux Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/AmazonLinux/release, Host/AmazonLinux/rpm-list, Host/local_checks_enabled

Vulnerability Information


Severity: High
Vulnerability Published: 2022-03-07
Patch Published: 2022-03-07
CVE [?]: CVE-2021-4197, CVE-2021-26341, CVE-2021-26401, CVE-2022-0001, CVE-2022-0002, CVE-2022-0435, CVE-2022-0847, CVE-2022-23960
CPE [?]: cpe:/o:amazon:linux:2, p-cpe:/a:amazon:linux:bpftool, p-cpe:/a:amazon:linux:bpftool-debuginfo, p-cpe:/a:amazon:linux:kernel, p-cpe:/a:amazon:linux:kernel-debuginfo, p-cpe:/a:amazon:linux:kernel-debuginfo-common-aarch64, p-cpe:/a:amazon:linux:kernel-debuginfo-common-x86_64, p-cpe:/a:amazon:linux:kernel-devel, p-cpe:/a:amazon:linux:kernel-headers, p-cpe:/a:amazon:linux:kernel-livepatch-5.10.102-99.473, p-cpe:/a:amazon:linux:kernel-tools, p-cpe:/a:amazon:linux:kernel-tools-debuginfo, p-cpe:/a:amazon:linux:kernel-tools-devel, p-cpe:/a:amazon:linux:perf, p-cpe:/a:amazon:linux:perf-debuginfo, p-cpe:/a:amazon:linux:python-perf, p-cpe:/a:amazon:linux:python-perf-debuginfo
Exploited by Malware: True

Synopsis

The remote Amazon Linux 2 host is missing a security update.

Description

The version of kernel installed on the remote host is prior to 5.10.102-99.473. It is, therefore, affected by multiple vulnerabilities as referenced in the ALAS2KERNEL-5.10-2022-011 advisory.

- Some AMD CPUs may transiently execute beyond unconditional direct branches, which may potentially result in data leakage. (CVE-2021-26341)

- LFENCE/JMP (mitigation V2-2) may not sufficiently mitigate CVE-2017-5715 on some AMD CPUs. (CVE-2021-26401)

- An unprivileged write to the file handler flaw in the Linux kernel's control groups and namespaces subsystem was found in the way users have access to some less privileged process that are controlled by cgroups and have higher privileged parent process. It is actually both for cgroup2 and cgroup1 versions of control groups. A local user could use this flaw to crash the system or escalate their privileges on the system. (CVE-2021-4197)

- Non-transparent sharing of branch predictor selectors between contexts in some Intel(R) Processors may allow an authorized user to potentially enable information disclosure via local access. (CVE-2022-0001)

- Non-transparent sharing of branch predictor within a context in some Intel(R) Processors may allow an authorized user to potentially enable information disclosure via local access. (CVE-2022-0002)

- A stack overflow flaw was found in the Linux kernel's TIPC protocol functionality in the way a user sends a packet with malicious content where the number of domain member nodes is higher than the 64 allowed. This flaw allows a remote user to crash the system or possibly escalate their privileges if they have access to the TIPC network. (CVE-2022-0435)

- A flaw was found in the way the flags member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe and push_pipe functions in the Linux kernel and could thus contain stale values. An unprivileged local user could use this flaw to write to pages in the page cache backed by read only files and as such escalate their privileges on the system. (CVE-2022-0847)

- Certain Arm Cortex and Neoverse processors through 2022-03-08 do not properly restrict cache speculation, aka Spectre-BHB. An attacker can leverage the shared branch history in the Branch History Buffer (BHB) to influence mispredicted branches. Then, cache allocation can allow the attacker to obtain sensitive information. (CVE-2022-23960)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Run 'yum update kernel' to update your system.

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 Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011) vulnerability:

  1. Metasploit: exploit/linux/local/cve_2022_0847_dirtypipe
    [Dirty Pipe Local Privilege Escalation via CVE-2022-0847]
  2. Exploit-DB: exploits/linux/local/50808.c
    [EDB-50808: Linux Kernel 5.8 < 5.16.11 - Local Privilege Escalation (DirtyPipe)]
  3. GitHub: https://github.com/bollwarm/SecToolSet
    [CVE-2022-0435]
  4. GitHub: https://github.com/0xIronGoat/dirty-pipe
    [CVE-2022-0847: Implementation of Max Kellermann's exploit for CVE-2022-0847]
  5. GitHub: https://github.com/2xYuan/CVE-2022-0847
    [CVE-2022-0847: 66666]
  6. GitHub: https://github.com/4luc4rdr5290/CVE-2022-0847
    [CVE-2022-0847]
  7. GitHub: https://github.com/Al1ex/CVE-2022-0847
    [CVE-2022-0847]
  8. GitHub: https://github.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits
    [CVE-2022-0847: A collection of exploits and documentation that can be used to exploit the Linux ...]
  9. GitHub: https://github.com/AyoubNajim/cve-2022-0847dirtypipe-exploit
    [CVE-2022-0847]
  10. GitHub: https://github.com/CYB3RK1D/CVE-2022-0847
    [CVE-2022-0847: dirtypipe]
  11. GitHub: https://github.com/CYB3RK1D/CVE-2022-0847-POC
    [CVE-2022-0847: Dirtypipe]
  12. GitHub: https://github.com/DataDog/dirtypipe-container-breakout-poc
    [CVE-2022-0847: Container Excape PoC for CVE-2022-0847 "DirtyPipe"]
  13. GitHub: https://github.com/Greetdawn/CVE-2022-0847-DirtyPipe
    [CVE-2022-0847]
  14. GitHub: https://github.com/Greetdawn/CVE-2022-0847-DirtyPipe-
    [CVE-2022-0847]
  15. GitHub: https://github.com/ITMarcin2211/CVE-2022-0847-DirtyPipe-Exploit
    [CVE-2022-0847]
  16. GitHub: https://github.com/LP-H4cmilo/CVE-2022-0847_DirtyPipe_Exploits
    [CVE-2022-0847: A collection of exploits and documentation that can be used to exploit the Linux ...]
  17. GitHub: https://github.com/LudovicPatho/CVE-2022-0847
    [CVE-2022-0847: Hacked up Dirty Pipe (CVE-2022-0847) PoC that hijacks a SUID binary to spawn a root ...]
  18. GitHub: https://github.com/LudovicPatho/CVE-2022-0847_dirty-pipe
    [CVE-2022-0847: Hacked up Dirty Pipe (CVE-2022-0847) PoC that hijacks a SUID binary to spawn a root ...]
  19. GitHub: https://github.com/MRNIKO1/Dirtypipe-exploit
    [CVE-2022-0847: Dirty Pipe (CVE-2022-0847) PoC that hijacks a SUID binary to spawn. a root shell. ...]
  20. GitHub: https://github.com/MrP1xel/CVE-2022-0847-dirty-pipe-kernel-checker
    [CVE-2022-0847: Python script to check if your kernel is vulnerable to Dirty pipe CVE-2022-0847]
  21. GitHub: https://github.com/Mustafa1986/CVE-2022-0847-DirtyPipe-Exploit
    [CVE-2022-0847]
  22. GitHub: https://github.com/Nekoox/dirty-pipe
    [CVE-2022-0847: Exploit for Dirty-Pipe (CVE-2022-0847)]
  23. GitHub: https://github.com/Patocoh/Research-Dirty-Pipe
    [CVE-2022-0847: CVE 2022-0847]
  24. GitHub: https://github.com/Shotokhan/cve_2022_0847_shellcode
    [CVE-2022-0847: Implementation of CVE-2022-0847 as a shellcode]
  25. GitHub: https://github.com/T4t4ru/CVE-2022-0847
    [CVE-2022-0847]
  26. GitHub: https://github.com/Udyz/CVE-2022-0847
    [CVE-2022-0847: This is the story of CVE-2022-0847, a vulnerability in the Linux kernel since 5.8 ...]
  27. GitHub: https://github.com/V0WKeep3r/CVE-2022-0847-DirtyPipe-Exploit
    [CVE-2022-0847: CVE-2022-0847-DirtyPipe-Exploit]
  28. GitHub: https://github.com/ahrixia/CVE_2022_0847
    [CVE-2022-0847: CVE-2022-0847: Linux Kernel Privilege Escalation Vulnerability]
  29. GitHub: https://github.com/akecha/Dirty-pipe
    [CVE-2022-0847: CVE-2022-0847 Linux kernel LPE POC]
  30. GitHub: https://github.com/antx-code/CVE-2022-0847
    [CVE-2022-0847: Linux Kernel Local Privilege Escalation Vulnerability CVE-2022-0847.]
  31. GitHub: https://github.com/babyshen/CVE-2022-0847
    [CVE-2022-0847: A root exploit for CVE-2022-0847 (Dirty Pipe)]
  32. GitHub: https://github.com/basharkey/CVE-2022-0847-dirty-pipe-checker
    [CVE-2022-0847: Bash script to check for CVE-2022-0847 "Dirty Pipe"]
  33. GitHub: https://github.com/bbaranoff/CVE-2022-0847
    [CVE-2022-0847]
  34. GitHub: https://github.com/breachnix/dirty-pipe-poc
    [CVE-2022-0847: CVE-2022-0847 POC]
  35. GitHub: https://github.com/carlosevieira/Dirty-Pipe
    [CVE-2022-0847: CVE-2022-0847 exploit one liner]
  36. GitHub: https://github.com/chenaotian/CVE-2022-0847
    [CVE-2022-0847: CVE-2022-0847 POC and Docker and Analysis write up]
  37. GitHub: https://github.com/crowsec-edtech/Dirty-Pipe
    [CVE-2022-0847: CVE-2022-0847 exploit one liner]
  38. GitHub: https://github.com/crusoe112/DirtyPipePython
    [CVE-2022-0847: A Python-based DirtyPipe (CVE-2022-0847) POC to pop a root shell]
  39. GitHub: https://github.com/cspshivam/CVE-2022-0847-dirty-pipe-exploit
    [CVE-2022-0847: An exploit for CVE-2022-0847 dirty-pipe vulnerability]
  40. GitHub: https://github.com/dadhee/CVE-2022-0847_DirtyPipeExploit
    [CVE-2022-0847: A “Dirty Pipe” vulnerability with CVE-2022-0847 and a CVSS score of 7.8 has been ...]
  41. GitHub: https://github.com/drapl0n/dirtypipe
    [CVE-2022-0847: DirtyPipe: Exploit for a new Linux vulnerability known as 'Dirty ...]
  42. GitHub: https://github.com/edsonjt81/CVE-2022-0847-Linux
    [CVE-2022-0847]
  43. GitHub: https://github.com/febinrev/dirtypipez-exploit
    [CVE-2022-0847: CVE-2022-0847 DirtyPipe Exploit.]
  44. GitHub: https://github.com/githublihaha/DirtyPIPE-CVE-2022-0847
    [CVE-2022-0847]
  45. GitHub: https://github.com/gyaansastra/CVE-2022-0847
    [CVE-2022-0847: Dirty Pipe POC]
  46. GitHub: https://github.com/knqyf263/CVE-2022-0847
    [CVE-2022-0847: The Dirty Pipe Vulnerability]
  47. GitHub: https://github.com/logm1lo/CVE-2022-0847_DirtyPipe_Exploits
    [CVE-2022-0847: A collection of exploits and documentation that can be used to exploit the Linux ...]
  48. GitHub: https://github.com/lucksec/CVE-2022-0847
    [CVE-2022-0847]
  49. GitHub: https://github.com/michaelklaan/CVE-2022-0847-Dirty-Pipe
    [CVE-2022-0847]
  50. GitHub: https://github.com/mrchucu1/CVE-2022-0847-Docker
    [CVE-2022-0847: Docker exploit]
  51. GitHub: https://github.com/nanaao/Dirtypipe-exploit
    [CVE-2022-0847: Dirty Pipe (CVE-2022-0847) PoC that hijacks a SUID binary to spawn. a root shell. ...]
  52. GitHub: https://github.com/pentestblogin/pentestblog-CVE-2022-0847
    [CVE-2022-0847]
  53. GitHub: https://github.com/phuonguno98/CVE-2022-0847
    [CVE-2022-0847]
  54. GitHub: https://github.com/phuonguno98/CVE-2022-0847-DirtyPipe-Exploits
    [CVE-2022-0847]
  55. GitHub: https://github.com/puckiestyle/CVE-2022-0847
    [CVE-2022-0847]
  56. GitHub: https://github.com/rahul1406/cve-2022-0847dirtypipe-exploit
    [CVE-2022-0847]
  57. GitHub: https://github.com/realbatuhan/dirtypipetester
    [CVE-2022-0847: Dirty Pipe (CVE-2022-0847) zafiyeti kontrolü]
  58. GitHub: https://github.com/rexpository/Linux-privilege-escalation
    [CVE-2022-0847: Scripted Linux Privilege Escalation for the CVE-2022-0847 "Dirty Pipe" vulnerability ...]
  59. GitHub: https://github.com/rexpository/linux-privilege-escalation
    [CVE-2022-0847: Scripted Linux Privilege Escalation for the CVE-2022-0847 "Dirty Pipe" vulnerability ...]
  60. GitHub: https://github.com/sa-infinity8888/Dirty-Pipe-CVE-2022-0847
    [CVE-2022-0847: CVE-2022-0847 (Dirty Pipe) is an arbitrary file overwrite vulnerability that allows ...]
  61. GitHub: https://github.com/si1ent-le/CVE-2022-0847
    [CVE-2022-0847: CVE-2022-0487]
  62. GitHub: https://github.com/stfnw/Debugging_Dirty_Pipe_CVE-2022-0847
    [CVE-2022-0847: Presentation slides and supplementary material]
  63. GitHub: https://github.com/terabitSec/dirtyPipe-automaticRoot
    [CVE-2022-0847: CVE-2022-0847 Python exploit to get root or write a no write permission, immutable ...]
  64. GitHub: https://github.com/tmoneypenny/CVE-2022-0847
    [CVE-2022-0847: Poc]
  65. GitHub: https://github.com/tufanturhan/CVE-2022-0847-L-nux-PrivEsc
    [CVE-2022-0847]
  66. GitHub: https://github.com/xnderLAN/CVE-2022-0847
    [CVE-2022-0847: Linux “Dirty Pipe” vulnerability gives unprivileged users root access]
  67. GitHub: https://github.com/xndpxs/CVE-2022-0847
    [CVE-2022-0847: Vulnerability in the Linux kernel since 5.8]
  68. GitHub: https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit
    [CVE-2022-0847: A root exploit for CVE-2022-0847 (Dirty Pipe)]
  69. GitHub: https://github.com/arttnba3/CVE-2022-0847
    [CVE-2022-0847: My personal exploit of CVE-2022-0847(dirty pipe)]
  70. GitHub: https://github.com/DanaEpp/pwncat_dirtypipe
    [CVE-2022-0847: Pwncat module that automatically exploits CVE-2022-0847 (dirtypipe)]
  71. GitHub: https://github.com/imfiver/CVE-2022-0847
    [CVE-2022-0847: CVE-2022-0847-DirtyPipe-Exploit CVE-2022-0847 是存在于 Linux内核 5.8 ...]
  72. GitHub: https://github.com/mhanief/dirtypipe
    [CVE-2022-0847: Dirty Pipe Vulnerability Detection Script - RHSB-2022-002 Dirty Pipe - kernel ...]

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-2022-0435
CVSS V2 Vector: AV:N/AC:L/Au:S/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:9.0 (High)
Impact Subscore:10.0
Exploitability Subscore:8.0
CVSS Temporal Score:7.8 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.8 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:8.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.4 (High)

Go back to menu.

Plugin Source


This is the al2_ALASKERNEL-5_10-2022-011.nasl nessus plugin source code. This script is Copyright (C) 2022 and is owned by Tenable, Inc. or an Affiliate thereof.

##
# (C) Tenable, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Amazon Linux 2 Security Advisory ALASKERNEL-5.10-2022-011.
##

include('compat.inc');

if (description)
{
  script_id(160425);
  script_version("1.3");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/05/03");

  script_cve_id(
    "CVE-2021-4197",
    "CVE-2021-26341",
    "CVE-2021-26401",
    "CVE-2022-0001",
    "CVE-2022-0002",
    "CVE-2022-0435",
    "CVE-2022-0847",
    "CVE-2022-23960"
  );
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/05/16");

  script_name(english:"Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011)");

  script_set_attribute(attribute:"synopsis", value:
"The remote Amazon Linux 2 host is missing a security update.");
  script_set_attribute(attribute:"description", value:
"The version of kernel installed on the remote host is prior to 5.10.102-99.473. It is, therefore, affected by multiple
vulnerabilities as referenced in the ALAS2KERNEL-5.10-2022-011 advisory.

  - Some AMD CPUs may transiently execute beyond unconditional direct branches, which may potentially result
    in data leakage. (CVE-2021-26341)

  - LFENCE/JMP (mitigation V2-2) may not sufficiently mitigate CVE-2017-5715 on some AMD CPUs.
    (CVE-2021-26401)

  - An unprivileged write to the file handler flaw in the Linux kernel's control groups and namespaces
    subsystem was found in the way users have access to some less privileged process that are controlled by
    cgroups and have higher privileged parent process. It is actually both for cgroup2 and cgroup1 versions of
    control groups. A local user could use this flaw to crash the system or escalate their privileges on the
    system. (CVE-2021-4197)

  - Non-transparent sharing of branch predictor selectors between contexts in some Intel(R) Processors may
    allow an authorized user to potentially enable information disclosure via local access. (CVE-2022-0001)

  - Non-transparent sharing of branch predictor within a context in some Intel(R) Processors may allow an
    authorized user to potentially enable information disclosure via local access. (CVE-2022-0002)

  - A stack overflow flaw was found in the Linux kernel's TIPC protocol functionality in the way a user sends
    a packet with malicious content where the number of domain member nodes is higher than the 64 allowed.
    This flaw allows a remote user to crash the system or possibly escalate their privileges if they have
    access to the TIPC network. (CVE-2022-0435)

  - A flaw was found in the way the flags member of the new pipe buffer structure was lacking proper
    initialization in copy_page_to_iter_pipe and push_pipe functions in the Linux kernel and could thus
    contain stale values. An unprivileged local user could use this flaw to write to pages in the page cache
    backed by read only files and as such escalate their privileges on the system. (CVE-2022-0847)

  - Certain Arm Cortex and Neoverse processors through 2022-03-08 do not properly restrict cache speculation,
    aka Spectre-BHB. An attacker can leverage the shared branch history in the Branch History Buffer (BHB) to
    influence mispredicted branches. Then, cache allocation can allow the attacker to obtain sensitive
    information. (CVE-2022-23960)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/AL2/ALASKERNEL-5.10-2022-011.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2021-26341.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2021-26401.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2021-4197.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2022-0001.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2022-0002.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2022-0435.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2022-0847.html");
  script_set_attribute(attribute:"see_also", value:"https://alas.aws.amazon.com/cve/html/CVE-2022-23960.html");
  script_set_attribute(attribute:"solution", value:
"Run 'yum update kernel' to update your system.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/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:N/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:"cvss_score_source", value:"CVE-2022-0435");

  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:'Dirty Pipe Local Privilege Escalation via CVE-2022-0847');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2022/03/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2022/03/07");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/05/02");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:bpftool");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:bpftool-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-debuginfo-common-aarch64");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-debuginfo-common-x86_64");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-headers");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-livepatch-5.10.102-99.473");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-tools");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-tools-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:kernel-tools-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:perf");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:perf-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:python-perf");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:python-perf-debuginfo");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux:2");
  script_end_attributes();

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

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

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

  exit(0);
}

include("rpm.inc");
include("hotfixes.inc");

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

var release = get_kb_item("Host/AmazonLinux/release");
if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux");
var os_ver = pregmatch(pattern: "^AL(A|\d)", string:release);
if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux");
var os_ver = os_ver[1];
if (os_ver != "2")
{
  if (os_ver == 'A') os_ver = 'AMI';
  audit(AUDIT_OS_NOT, "Amazon Linux 2", "Amazon Linux " + os_ver);
}

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

if (get_one_kb_item("Host/kpatch/kernel-cves"))
{
  set_hotfix_type("kpatch");
  var cve_list = make_list("CVE-2021-4197", "CVE-2021-26341", "CVE-2021-26401", "CVE-2022-0001", "CVE-2022-0002", "CVE-2022-0435", "CVE-2022-0847", "CVE-2022-23960");
  if (hotfix_cves_check(cve_list))
  {
    audit(AUDIT_PATCH_INSTALLED, "kpatch hotfix for ALASKERNEL-5.10-2022-011");
  }
  else
  {
    __rpm_report = hotfix_reporting_text();
  }
}
var pkgs = [
    {'reference':'bpftool-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'bpftool-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'bpftool-debuginfo-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'bpftool-debuginfo-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-debuginfo-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-debuginfo-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-debuginfo-common-aarch64-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-debuginfo-common-x86_64-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-devel-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-devel-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-headers-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-headers-5.10.102-99.473.amzn2', 'cpu':'i686', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-headers-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-livepatch-5.10.102-99.473-1.0-0.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-livepatch-5.10.102-99.473-1.0-0.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-debuginfo-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-debuginfo-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-devel-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'kernel-tools-devel-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'perf-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'perf-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'perf-debuginfo-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'perf-debuginfo-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'python-perf-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'python-perf-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'python-perf-debuginfo-5.10.102-99.473.amzn2', 'cpu':'aarch64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE},
    {'reference':'python-perf-debuginfo-5.10.102-99.473.amzn2', 'cpu':'x86_64', 'release':'AL2', 'rpm_spec_vers_cmp':TRUE}
];

var flag = 0;
foreach package_array ( pkgs ) {
  var reference = NULL;
  var release = NULL;
  var cpu = NULL;
  var el_string = NULL;
  var rpm_spec_vers_cmp = NULL;
  var allowmaj = NULL;
  if (!empty_or_null(package_array['reference'])) reference = package_array['reference'];
  if (!empty_or_null(package_array['release'])) release = package_array['release'];
  if (!empty_or_null(package_array['cpu'])) cpu = package_array['cpu'];
  if (!empty_or_null(package_array['el_string'])) el_string = package_array['el_string'];
  if (!empty_or_null(package_array['rpm_spec_vers_cmp'])) rpm_spec_vers_cmp = package_array['rpm_spec_vers_cmp'];
  if (!empty_or_null(package_array['allowmaj'])) allowmaj = package_array['allowmaj'];
  if (reference && release) {
    if (rpm_check(release:release, cpu:cpu, reference:reference, el_string:el_string, rpm_spec_vers_cmp:rpm_spec_vers_cmp, allowmaj:allowmaj)) flag++;
  }
}

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

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

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/al2_ALASKERNEL-5_10-2022-011.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\al2_ALASKERNEL-5_10-2022-011.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/al2_ALASKERNEL-5_10-2022-011.nasl

Go back to menu.

How to Run


Here is how to run the Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011) 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 Amazon Linux Local Security Checks plugin family.
  6. On the right side table select Amazon Linux 2 : kernel (ALASKERNEL-5.10-2022-011) plugin ID 160425.
  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 al2_ALASKERNEL-5_10-2022-011.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a al2_ALASKERNEL-5_10-2022-011.nasl -t <IP/HOST>

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

/opt/nessus/bin/nasl -T - al2_ALASKERNEL-5_10-2022-011.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 al2_ALASKERNEL-5_10-2022-011.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 159186 - Oracle Linux 8 : Unbreakable Enterprise kernel (ELSA-2022-9244)
  • 159302 - CentOS 8 : kernel (CESA-2022:0825)
  • 159395 - Ubuntu 20.04 LTS : Linux kernel (Intel IOTG) vulnerabilities (USN-5362-1)
  • 159521 - RHEL 8 : kpatch-patch (RHSA-2022:1186)
  • 159538 - RHEL 8 : kernel-rt (RHSA-2022:1209)
  • 159539 - RHEL 8 : kernel (RHSA-2022:1213)
  • 159579 - Ubuntu 20.04 LTS : Linux kernel vulnerabilities (USN-5368-1)
  • 159729 - Ubuntu 20.04 LTS : Linux kernel (BlueField) vulnerabilities (USN-5377-1)
  • 159749 - SUSE SLED12 / SLES12 Security Update : kernel (SUSE-SU-2022:1196-1)
  • 159811 - EulerOS 2.0 SP9 : kernel (EulerOS-SA-2022-1450)
  • 159815 - EulerOS 2.0 SP9 : kernel (EulerOS-SA-2022-1429)
  • 159949 - EulerOS 2.0 SP10 : kernel (EulerOS-SA-2022-1489)
  • 159983 - EulerOS 2.0 SP10 : kernel (EulerOS-SA-2022-1508)
  • 160189 - Oracle Linux 7 : Unbreakable Enterprise kernel-container (ELSA-2022-9314)
  • 160190 - Oracle Linux 7 : Unbreakable Enterprise kernel (ELSA-2022-9313)
  • 160241 - RHEL 8 : kernel (RHSA-2022:1589)
  • 160288 - RHEL 8 : kpatch-patch (RHSA-2022:1619)
  • 160469 - Debian DSA-5127-1 : linux - security update
  • 160581 - EulerOS Virtualization 2.9.0 : kernel (EulerOS-SA-2022-1630)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file al2_ALASKERNEL-5_10-2022-011.nasl version 1.3. For more plugins, visit the Nessus Plugin Library.

Go back to menu.