SAP DB / MaxDB WebDBM Client Database Name Remote Overflow - Nessus

Critical   Plugin ID: 22309

This page contains detailed information about the SAP DB / MaxDB WebDBM Client Database Name Remote Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 22309
Name: SAP DB / MaxDB WebDBM Client Database Name Remote Overflow
Filename: webdbm_database_overflow.nasl
Vulnerability Published: 2006-08-29
This Plugin Published: 2006-09-06
Last Modification Time: 2021-01-19
Plugin Version: 1.19
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: http_version.nasl, os_fingerprint.nasl

Vulnerability Information


Severity: Critical
Vulnerability Published: 2006-08-29
Patch Published: 2006-08-29
CVE [?]: CVE-2006-4305
CPE [?]: N/A

Synopsis

The remote web server is prone to a buffer overflow attack.

Description

The remote host is running SAP DB or MaxDB, a SAP-certified open- source database supporting OLTP and OLAP.

According to its version, the Web DBM component of MaxDB on the remote host reportedly contains a buffer overflow that can be triggered by an HTTP request containing a long database name. An unauthenticated remote attacker may be able to exploit this flaw to execute arbitrary code on the affected host subject to the privileges of the 'wahttp' process.

Note that on Windows the 'wahttp' process runs with 'SYSTEM' privileges so a successful attack may result in a complete compromise of the affected system.

Solution

Upgrade to Web DBM version 7.6.00.31 or later as that is reported to fix the issue.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the SAP DB / MaxDB WebDBM Client Database Name Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/http/maxdb_webdbm_database
    [MaxDB WebDBM Database Parameter Overflow]
  2. Exploit-DB: exploits/windows/remote/16765.rb
    [EDB-16765: MaxDB WebDBM - 'Database' Remote Overflow (Metasploit)]

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:N/AC:L/Au:N/C:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)

Go back to menu.

Plugin Source


This is the webdbm_database_overflow.nasl nessus plugin source code. This script is Copyright (C) 2006-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(22309);
  script_version("1.19");

  script_cve_id("CVE-2006-4305");
  script_bugtraq_id(19660);

  script_name(english:"SAP DB / MaxDB WebDBM Client Database Name Remote Overflow");
  script_summary(english:"Gets version of Web DBM");

 script_set_attribute(attribute:"synopsis", value:
"The remote web server is prone to a buffer overflow attack." );
 script_set_attribute(attribute:"description", value:
"The remote host is running SAP DB or MaxDB, a SAP-certified open-
source database supporting OLTP and OLAP. 

According to its version, the Web DBM component of MaxDB on the remote
host reportedly contains a buffer overflow that can be triggered by an
HTTP request containing a long database name.  An unauthenticated
remote attacker may be able to exploit this flaw to execute arbitrary
code on the affected host subject to the privileges of the 'wahttp'
process. 

Note that on Windows the 'wahttp' process runs with 'SYSTEM'
privileges so a successful attack may result in a complete compromise
of the affected system." );
 script_set_attribute(attribute:"see_also", value:"http://www.symantec.com/content/en/us/enterprise/research/SYMSA-2006-009.txt" );
 script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/444601/30/0/threaded" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Web DBM version 7.6.00.31 or later as that is reported to
fix the issue." );
 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:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
 script_set_attribute(attribute:"exploit_available", value:"false");
 script_set_attribute(attribute:"metasploit_name", value:'MaxDB WebDBM Database Parameter Overflow');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_set_attribute(attribute:"plugin_publication_date", value: "2006/09/06");
 script_set_attribute(attribute:"patch_publication_date", value: "2006/08/29");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/08/29");
 script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/19");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();


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

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

  script_dependencies("http_version.nasl", "os_fingerprint.nasl");
  script_require_ports("Services/www", 9999);

  exit(0);
}


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


# Exit unless we're being paranoid or the target is running Windows
# to avoid false-positives with, say, the Debian MaxDB package.
os = get_kb_item("Host/OS");
if (report_paranoia < 2 && os && "Windows" >!< os) exit(0);


port = get_http_port(default:9999);

# Make sure the banner indicates it's Web DBM.
banner = get_http_banner(port:port);
if (!banner || "Server: SAP-Internet-SapDb-Server" >!< banner) exit(0);


# Get the version number.
r = http_send_recv3(method:"GET", item:"/webdbm?Page=VERSION", port:port);
if (isnull(r)) exit(0);
res = r[2];

ver = NULL;
build = NULL;
pat = '<td class="(dbmSTbvCellStd|dbmSTbvCellLast|table[0-9]).*>(&nbsp;)*([0-9][
0-9.-]+) *(&nbsp;)*</';
matches = egrep(pattern:pat, string:res);
if (matches)
{
  foreach match (split(matches))
  {
    match = chomp(match);
    m = eregmatch(pattern:pat, string:match);
    if (!isnull(m))
    {
      if ("table" >< m[1] && m[3] !~ "^[0-9]{3}-") ver = chomp(m[3]);
      if ("CellStd" >< m[1]) ver = chomp(m[3]);
      if ("CellLast" >< m[1] || ("table" >< m[1] && m[3] =~ "^[0-9]{3}-"))
      {
        build = m[3];
        if (build =~ "^([0-9][0-9][0-9])-.*")
        {
          build = ereg_replace(pattern:"^([0-9][0-9][0-9])-.*", replace:"\1", string:build);
          build = int(build);
        }
      }
    }
  }
}
if (isnull(ver)) exit(0);
if (!isnull(build)) ver += "." + build;


# There's a problem if the version is under 7.6.00.31.
iver = split(ver, sep:'.', keep:FALSE);
if (
  int(iver[0]) < 7 ||
  (
    int(iver[0]) == 7 &&
    (
      int(iver[1]) < 6 ||
      (int(iver[1]) == 6 && int(iver[2]) == 0 && !isnull(iver[3]) && int(iver[3]) < 31)
    )
  )
)
{
  report = string(
    "According to its banner, MaxDB / SAP DB version ", ver, " is installed\n",
    "on the remote host.\n"
  );
  security_hole(port:port, extra: report);
}

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

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

Go back to menu.

How to Run


Here is how to run the SAP DB / MaxDB WebDBM Client Database Name Remote Overflow 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 SAP DB / MaxDB WebDBM Client Database Name Remote Overflow plugin ID 22309.
  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 webdbm_database_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 22904 - Debian DSA-1190-1 : maxdb-7.5.00 - buffer overflow
  • 25681 - SAP DB / MaxDB Web Server DBM_INTERN_TEST Event Buffer Overflow
  • 72258 - SAP Host Agent SOAP Web Service Information Disclosure (SAP Note 1816536)
  • 62293 - SAP Host Control SOAP Web Service 'Database/Name' Command Execution (SAP Note 1341333)
  • 146272 - SAP BusinessObjects Business Intelligence Platform SSRF Vulnerability (direct check)
  • 29924 - SAP DB / MaxDB Cons Program Arbitrary Command Execution
  • 36163 - SAP GUI KWEdit ActiveX Control SaveDocumentAs() Insecure Method
  • 40617 - SAP SAPgui MDrmSap ActiveX (mdrmsap.dll) Buffer Overflow
  • 32194 - SAP MaxDB Multiple Vulnerabilities
  • 148400 - SAP NetWeaver AS Java Monitoring Directory Traversal (2234971)
  • 138506 - SAP NetWeaver AS Java Multiple Vulnerabilities
  • 139583 - SAP NetWeaver AS Java DoS (2941315)
  • 150787 - SAP NetWeaver AS JAVA Information Disclosure (3023299)
  • 150717 - SAP NetWeaver AS ABAP XSS (June 2021)
  • 151762 - SAP NetWeaver AS ABAP and ABAP Information Disclosure (3044754)
  • 150718 - SAP NetWeaver AS JAVA Missing XML Validation (3053066)
  • 157848 - SAP NetWeaver AS Desynchronization (ICMAD)
  • 145705 - SAP NetWeaver AS Java and AS ABAP Multiple Vulnerabilities (Jan 2021)
  • 154918 - SAP NetWeaver AS Java Directory Traversal Vulnerability (2547431)
  • 138762 - SAP NetWeaver : Authentication Bypass (CVE-2020-6287) (Direct Check)
  • 36073 - SAP GUI Moniker Creation Multiple Vulnerabilities
  • 145532 - SAP Solution Manager Missing Authentication (2890213)

Version


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

Go back to menu.