Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities - Nessus

High   Plugin ID: 103698

This page contains detailed information about the Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 103698
Name: Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities
Filename: tomcat_8_5_23.nasl
Vulnerability Published: 2017-10-03
This Plugin Published: 2017-10-06
Last Modification Time: 2022-04-11
Plugin Version: 1.14
Plugin Type: combined
Plugin Family: Web Servers
Dependencies: apache_tomcat_nix_installed.nbin, tomcat_error_version.nasl, tomcat_win_installed.nbin
Required KB Items [?]: installed_sw/Apache Tomcat

Vulnerability Information


Severity: High
Vulnerability Published: 2017-10-03
Patch Published: 2017-10-03
CVE [?]: CVE-2017-12617
CPE [?]: cpe:/a:apache:tomcat

Synopsis

The remote Apache Tomcat server is affected by a code execution vulnerability.

Description

The version of Apache Tomcat installed on the remote host is 7.0.x prior to 7.0.82 or 8.5.x prior to 8.5.23. It is, therefore, affected by an unspecified vulnerability when running with HTTP PUTs enabled (e.g. via setting the readonly initialization parameter of the Default to false) that makes it possible to upload a JSP file to the server via a specially crafted request. This JSP could then be requested and any code it contained would be executed by the server.

Note that Nessus has not attempted to exploit this issue but has instead relied only on the application's self-reported version number.

Solution

Upgrade to Apache Tomcat version 7.0.82 / 8.5.23 or later.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities vulnerability:

  1. Metasploit: exploit/multi/http/tomcat_jsp_upload_bypass
    [Tomcat RCE via JSP Upload Bypass]
  2. Exploit-DB: exploits/java/remote/43008.rb
    [EDB-43008: Tomcat - Remote Code Execution via JSP Upload Bypass (Metasploit)]
  3. Exploit-DB: exploits/windows/webapps/42953.txt
    [EDB-42953: Apache Tomcat < 9.0.1 (Beta) / < 8.5.23 / < 8.0.47 / < 7.0.8 - JSP Upload Bypass / Remote Code Execution (1)]
  4. Exploit-DB: exploits/jsp/webapps/42966.py
    [EDB-42966: Apache Tomcat < 9.0.1 (Beta) / < 8.5.23 / < 8.0.47 / < 7.0.8 - JSP Upload Bypass / Remote Code Execution (2)]
  5. GitHub: https://github.com/3vikram/Application-Vulnerabilities-Payloads
    [CVE-2017-12617]
  6. GitHub: https://github.com/84KaliPleXon3/Payloads_All_The_Things
    [CVE-2017-12617]
  7. GitHub: https://github.com/1120362990/vulnerability-list
    [CVE-2017-12617]
  8. GitHub: https://github.com/Cyberleet1337/Payloadswebhack
    [CVE-2017-12617]
  9. GitHub: https://github.com/Delishsploits/PayloadsAndMethodology
    [CVE-2017-12617]
  10. GitHub: https://github.com/DynamicDesignz/Alien-Framework
    [CVE-2017-12617]
  11. GitHub: https://github.com/GuynnR/Payloads
    [CVE-2017-12617]
  12. GitHub: https://github.com/Kaizhe/attacker
    [CVE-2017-12617]
  13. GitHub: https://github.com/Muhammd/Awesome-Payloads
    [CVE-2017-12617]
  14. GitHub: https://github.com/Prodject/Kn0ck
    [CVE-2017-12617]
  15. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2017-12617]
  16. GitHub: https://github.com/XPR1M3/Payloads_All_The_Things
    [CVE-2017-12617]
  17. GitHub: https://github.com/andrysec/PayloadsAllVulnerability
    [CVE-2017-12617]
  18. GitHub: https://github.com/anhtu97/PayloadAllEverything
    [CVE-2017-12617]
  19. GitHub: https://github.com/apkadmin/PayLoadsAll
    [CVE-2017-12617]
  20. GitHub: https://github.com/chanchalpatra/payload
    [CVE-2017-12617]
  21. GitHub: https://github.com/hktalent/myhktools
    [CVE-2017-12617]
  22. GitHub: https://github.com/ilmari666/cybsec
    [CVE-2017-12617]
  23. GitHub: https://github.com/jptr218/tc_hack
    [CVE-2017-12617: An implementation of CVE-2017-12617]
  24. GitHub: https://github.com/kk98kk0/Payloads
    [CVE-2017-12617]
  25. GitHub: https://github.com/koutto/jok3r-pocs
    [CVE-2017-12617]
  26. GitHub: https://github.com/maya6/-scan-
    [CVE-2017-12617]
  27. GitHub: https://github.com/mrhacker51/ReverseShellCommands
    [CVE-2017-12617]
  28. GitHub: https://github.com/oneplus-x/Sn1per
    [CVE-2017-12617]
  29. GitHub: https://github.com/ozkanbilge/Payloads
    [CVE-2017-12617]
  30. GitHub: https://github.com/qiantu88/CVE-2017-12617
    [CVE-2017-12617]
  31. GitHub: https://github.com/scxiaotan1/Docker
    [CVE-2017-12617]
  32. GitHub: https://github.com/sobinge/PayloadsAllThesobinge
    [CVE-2017-12617]
  33. GitHub: https://github.com/sobinge/--1
    [CVE-2017-12617]
  34. GitHub: https://github.com/tyranteye666/tomcat-cve-2017-12617
    [CVE-2017-12617: Apache Tomcat < 9.0.1 (Beta) / < 8.5.23 / < 8.0.47 / < 7.0.8 - JSP Upload Bypass / ...]
  35. GitHub: https://github.com/unusualwork/Sn1per
    [CVE-2017-12617]
  36. GitHub: https://github.com/woods-sega/woodswiki
    [CVE-2017-12617]
  37. GitHub: https://github.com/ycdxsb/Exploits
    [CVE-2017-12617]
  38. GitHub: https://github.com/ygouzerh/CVE-2017-12617
    [CVE-2017-12617: Proof of Concept - RCE Exploitation : Web Shell on Apache Tomcat - Ensimag January ...]
  39. GitHub: http://www.freebuf.com/vuls/150203.html
    [CVE-2017-12617]
  40. GitHub: https://github.com/cyberheartmi9/CVE-2017-12617
    [CVE-2017-12617: Apache Tomcat < 9.0.1 (Beta) / < 8.5.23 / < 8.0.47 / < 7.0.8 - JSP Upload Bypass / ...]
  41. GitHub: https://github.com/devcoinfet/CVE-2017-12617
    [CVE-2017-12617: Code put together from a few peoples ideas credit given don't use maliciously please ...]
  42. GitHub: https://github.com/LongWayHomie/CVE-2017-12617
    [CVE-2017-12617: CVE-2017-12617 is a critical vulnerability leading to Remote Code Execution (RCE) in ...]
  43. GitHub: https://github.com/zi0Black/POC-CVE-2017-12615-or-CVE-2017-12717
    [CVE-2017-12617: CVE-2017-12617 and CVE-2017-12615 for tomcat server]
  44. D2 Elliot: apache_tomcat_for_windows_http_put_method_file_upload.html
    [Apache Tomcat for Windows HTTP PUT Method File Upload]

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-2017-12617
CVSS V2 Vector: AV:N/AC:M/Au:N/C:P/I:P/A:P/E:H/RL:OF/RC:C
CVSS Base Score:6.8 (Medium)
Impact Subscore:6.4
Exploitability Subscore:8.6
CVSS Temporal Score:5.9 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:5.9 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:8.1 (High)
Impact Subscore:5.9
Exploitability Subscore:2.2
CVSS Temporal Score:7.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.7 (High)

Go back to menu.

Plugin Source


This is the tomcat_8_5_23.nasl nessus plugin source code. This script is Copyright (C) 2017-2022 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(103698);
  script_version("1.14");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2017-12617");
  script_bugtraq_id(100954);
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/04/15");

  script_name(english:"Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities");

  script_set_attribute(attribute:"synopsis", value:
"The remote Apache Tomcat server is affected by a code execution
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Apache Tomcat installed on the remote host is 7.0.x
prior to 7.0.82 or 8.5.x prior to 8.5.23. It is, therefore, affected
by an unspecified vulnerability when running with HTTP PUTs enabled
(e.g. via setting the readonly initialization parameter of the Default
to false) that makes it possible to upload a JSP file to the server
via a specially crafted request. This JSP could then be requested and
any code it contained would be executed by the server.

Note that Nessus has not attempted to exploit this issue but has
instead relied only on the application's self-reported version number.");
  # https://lists.apache.org/thread.html/3fd341a604c4e9eab39e7eaabbbac39c30101a022acc11dd09d7ebcb@%3Cannounce.tomcat.apache.org%3E
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4f047e41");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Apache Tomcat version 7.0.82 / 8.5.23 or later.");
  script_set_attribute(attribute:"agent", value:"all");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/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-2017-12617");

  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:"d2_elliot_name", value:"Apache Tomcat for Windows HTTP PUT Method File Upload");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Tomcat RCE via JSP Upload Bypass');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2017/10/03");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/10/03");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/10/06");

  script_set_attribute(attribute:"plugin_type", value:"combined");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:apache:tomcat");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Web Servers");

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

  script_dependencies("tomcat_error_version.nasl", "tomcat_win_installed.nbin", "apache_tomcat_nix_installed.nbin");
  script_require_keys("installed_sw/Apache Tomcat");

  exit(0);
}

include('tomcat_version.inc');

tomcat_check_version(fixed:make_list("7.0.82", "8.5.23"), severity:SECURITY_WARNING, granularity_regex:"^(7(\.0)?|8\.5\.)$");

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

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

Go back to menu.

How to Run


Here is how to run the Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities 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 Web Servers plugin family.
  6. On the right side table select Apache Tomcat 7.0.x < 7.0.82 / 8.5.x < 8.5.23 Multiple Vulnerabilities plugin ID 103698.
  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 tomcat_8_5_23.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a tomcat_8_5_23.nasl -t <IP/HOST>

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 104179 - Amazon Linux AMI : tomcat8 / tomcat80,tomcat7 (ALAS-2017-913)
  • 104256 - CentOS 6 : tomcat6 (CESA-2017:3080)
  • 104257 - CentOS 7 : tomcat (CESA-2017:3081)
  • 104286 - EulerOS 2.0 SP1 : tomcat (EulerOS-SA-2017-1261)
  • 104287 - EulerOS 2.0 SP2 : tomcat (EulerOS-SA-2017-1262)
  • 105995 - Fedora 27 : 1:tomcat (2017-ebb76fc3c9)
  • 104505 - Fedora 26 : 1:tomcat (2017-ef7c118dbc)
  • 104506 - Fedora 25 : 1:tomcat (2017-f499ee7b12)
  • 103718 - FreeBSD : tomcat -- Remote Code Execution (c0dae634-4820-4505-850d-b1c975d0f67d)
  • 106103 - MySQL Enterprise Monitor 3.3.x < 3.3.7.3306 / 3.4.x < 3.4.5.4248 / 4.0.x < 4.0.2.5168 Multiple Vulnerabilities (January 2018 CPU)
  • 127359 - NewStart CGSL MAIN 4.05 : tomcat6 Multiple Vulnerabilities (NS-SA-2019-0117)
  • 104765 - openSUSE Security Update : tomcat (openSUSE-2017-1299)
  • 106299 - Oracle Fusion Middleware Oracle HTTP Server Multiple Vulnerabilities (January 2018 CPU)
  • 104247 - Oracle Linux 6 : tomcat6 (ELSA-2017-3080)
  • 104248 - Oracle Linux 7 : tomcat (ELSA-2017-3081)
  • 106188 - Oracle Database Multiple Vulnerabilities (January 2018 CPU)
  • 109209 - Oracle WebCenter Sites Remote Vulnerability (April 2018 CPU)
  • 104250 - RHEL 6 : tomcat6 (RHSA-2017:3080)
  • 104251 - RHEL 7 : tomcat (RHSA-2017:3081)
  • 104456 - RHEL 6 / 7 : Red Hat JBoss Web Server (RHSA-2017:3113) (Optionsbleed)
  • 106650 - RHEL 7 : JBoss EAP (RHSA-2018:0268)
  • 106651 - RHEL 6 : JBoss EAP (RHSA-2018:0270)
  • 106616 - RHEL 6 : jboss-ec2-eap (RHSA-2018:0275)
  • 107208 - RHEL 6 / 7 : Red Hat JBoss Web Server 3.1.0 Service Pack 2 (RHSA-2018:0466)
  • 104268 - Scientific Linux Security Update : tomcat6 on SL6.x (noarch) (20171030)
  • 104269 - Scientific Linux Security Update : tomcat on SL7.x (noarch) (20171030)
  • 106349 - Oracle iPlanet Web Server 7.0.x < 7.0.27 NSS Unspecified Vulnerability (January 2018 CPU)
  • 150565 - SUSE SLES11 Security Update : tomcat6 (SUSE-SU-2021:14705-1)
  • 104358 - Apache Tomcat 6.0.x < 6.0.24 Multiple Vulnerabilities
  • 103782 - Apache Tomcat 7.0.x < 7.0.82 Multiple Vulnerabilities
  • 103697 - Apache Tomcat 8.0.0.RC1 < 8.0.47 Multiple Vulnerabilities
  • 103699 - Apache Tomcat 9.0.0.M1 < 9.0.1 Multiple Vulnerabilities
  • 105006 - Apache Tomcat HTTP PUT JSP File Upload RCE
  • 110264 - Ubuntu 14.04 LTS / 16.04 LTS / 17.10 / 18.04 LTS : Tomcat vulnerabilities (USN-3665-1)
  • 119237 - Virtuozzo 6 : tomcat6 / tomcat6-admin-webapps / etc (VZLSA-2017-3080)

Version


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

Go back to menu.