Apache Chunked Encoding Remote Overflow - Nessus

High   Plugin ID: 11030

This page contains detailed information about the Apache Chunked Encoding 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: 11030
Name: Apache Chunked Encoding Remote Overflow
Filename: apache_chunked_encoding.nasl
Vulnerability Published: 2002-06-19
This Plugin Published: 2002-06-17
Last Modification Time: 2020-06-12
Plugin Version: 1.56
Plugin Type: remote
Plugin Family: Web Servers
Dependencies: apache_http_version.nasl
Required KB Items [?]: installed_sw/Apache

Vulnerability Information


Severity: High
Vulnerability Published: 2002-06-19
Patch Published: N/A
CVE [?]: CVE-2002-0392
CPE [?]: cpe:/a:apache:http_server

Synopsis

The remote web server is vulnerable to a remote code execution attack.

Description

The remote Apache web server is affected by the Apache web server chunk handling vulnerability.

If safe checks are enabled, this may be a false positive since it is based on the version of Apache. Although unpatched Apache versions 1.2.2 and above, 1.3 through 1.3.24, and 2.0 through 2.0.36 are affected, the remote server may be running a patched version of Apache.

Solution

Upgrade to Apache web server version 1.3.26 / 2.0.39 or later.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Immunity Canvas, Core Impact)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Apache Chunked Encoding Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/http/apache_chunked
    [Apache Win32 Chunked Encoding]
  2. Exploit-DB: exploits/windows_x86/remote/16782.rb
    [EDB-16782: Apache (Windows x86) - Chunked Encoding (Metasploit)]
  3. GitHub: https://github.com/attwad/gocvss
    [CVE-2002-0392]
  4. GitHub: https://github.com/rebstan97/AttackGraphGeneration
    [CVE-2002-0392]
  5. Immunity Canvas: CANVAS

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:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:F/RL:O/RC:C
CVSS Base Score:7.3 (High)
Impact Subscore:3.4
Exploitability Subscore:3.9
CVSS Temporal Score:6.8 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.8 (Medium)

Go back to menu.

Plugin Source


This is the apache_chunked_encoding.nasl nessus plugin source code. This script is Copyright (C) 2002-2020 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");

if(description)
{
 script_id(11030);
 script_version("1.56");
 script_cve_id("CVE-2002-0392");
 script_bugtraq_id(5033);

 script_name(english:"Apache Chunked Encoding Remote Overflow");
 script_summary(english:"Checks for version or behavior of Apache");

 script_set_attribute(attribute:"synopsis", value:
"The remote web server is vulnerable to a remote code execution attack." );
 script_set_attribute(attribute:"description", value:
"The remote Apache web server is affected by the Apache web server
chunk handling vulnerability. 

If safe checks are enabled, this may be a false positive since it is
based on the version of Apache. Although unpatched Apache versions
1.2.2 and above, 1.3 through 1.3.24, and 2.0 through 2.0.36 are
affected, the remote server may be running a patched version of
Apache." );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Apache web server version 1.3.26 / 2.0.39 or later.");
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
 script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
 script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L");
 script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
 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:"metasploit_name", value:'Apache Win32 Chunked Encoding');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
 script_set_attribute(attribute:"canvas_package", value:'CANVAS');
 script_set_attribute(attribute:"see_also", value:"http://httpd.apache.org/info/security_bulletin_20020617.txt" );
 script_set_attribute(attribute:"see_also", value:"http://httpd.apache.org/info/security_bulletin_20020620.txt" );

 script_set_attribute(attribute:"plugin_publication_date", value: "2002/06/17");
 script_set_attribute(attribute:"vuln_publication_date", value: "2002/06/19");
 script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/12");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe",value:"cpe:/a:apache:http_server");
 script_end_attributes();

 
 script_category(ACT_MIXED_ATTACK);
 script_family(english:"Web Servers");
 
 script_copyright(english:"This script is Copyright (C) 2002-2020 Tenable Network Security, Inc.");

 script_dependencies("apache_http_version.nasl");
 script_require_keys("installed_sw/Apache");
 script_require_ports("Services/www", 80);
 exit(0);
}

#
# The script code starts here
#

# We can keep the old HTTP API for this kind of test
include("global_settings.inc");
include("misc_func.inc");
include("http_func.inc");
include("audit.inc");
include("install_func.inc");

get_install_count(app_name:"Apache", exit_if_zero:TRUE);
port = get_http_port(default:80, embedded:TRUE);
install = get_single_install(app_name:"Apache", port:port);

if(get_port_state(port))
{
 failed = "";
 if(!safe_checks() && report_paranoia > 1)
 {
 req = string("GET /index.nes HTTP/1.0\r\n",
		"Transfer-Encoding: chunked\r\n\r\n",
		"1\r\n",
		crap(2), "\r\n\r\n");	
  soc = http_open_socket(port);
  if(soc)
  {
   send(socket:soc, data:req);
   init = recv_line(socket:soc, length:4096);
   http_close_socket(soc);
   
 
   soc = http_open_socket(port);
   if ( ! soc ) exit(0);
   if(preg(pattern:"^HTTP/1\.[0-1] [0-9]* ", string:init))
   {
    # This was a real web server. Let's try again, with malicious data
    req = string("GET /index.nes HTTP/1.0\r\n",
		"Transfer-Encoding: chunked\r\n\r\n",
		"fffffff0\r\n",
		crap(42), "\r\n\r\n");
    send(socket:soc, data:req);
    r = http_recv(socket:soc);
    if(preg(string:r, pattern:"HTTP/1\.[01] [234][0-9][0-9] "))exit(0);
    #display(r);
    for(i=0;i<10;i=i+1)
     {
      # If there is a send error, then it means the remote host
      # abruptly shut the connection down
      n = send(socket:soc, data:crap(5));
      sleep(1);
      if(n < 0)
       {
       security_hole(port);
       exit(0);
       }
      }
    }
    http_close_socket(soc);
  }
  failed = "*** Note : Nessus's attempts to 'exploit' this vulnerability failed.";
 }
 

 banner = get_kb_item_or_exit('www/apache/'+port+'/source', exit_code:1);
 
 serv = strstr(banner, "Server");
 if(preg(pattern:"^Server:.*IBM_HTTP_SERVER/1\.3\.(12\.7|19\.[3-9]|2[0-9]\.)", string:serv))exit(0);
 if(preg(pattern:"^Server:.*Apache(-AdvancedExtranetServer)?/(1\.([0-2]\.[0-9]|3\.([0-9][^0-9]|[0-1][0-9]|2[0-5]))|2\.0.([0-9][^0-9]|[0-2][0-9]|3[0-8]))", string:serv))
 {
   report = NULL;
   if(strlen(failed))
   {
     report = string("\n\n", failed, "\n\n");
   }
   security_hole(port:port, extra:report);
   exit(0);
 }
}

audit(AUDIT_LISTEN_NOT_VULN, "Apache", port, install["version"]);

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

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

Go back to menu.

How to Run


Here is how to run the Apache Chunked Encoding 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 Web Servers plugin family.
  6. On the right side table select Apache Chunked Encoding Remote Overflow plugin ID 11030.
  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 apache_chunked_encoding.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 14968 - Debian DSA-131-1 : apache - remote DoS / exploit
  • 14969 - Debian DSA-132-1 : apache-ssl - remote DoS / exploit
  • 14970 - Debian DSA-133-1 : apache-perl - remote DoS / exploit
  • 22435 - HP-UX PHSS_32380 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22436 - HP-UX PHSS_32423 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22437 - HP-UX PHSS_33252 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22438 - HP-UX PHSS_33253 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22439 - HP-UX PHSS_33256 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22440 - HP-UX PHSS_33257 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 22441 - HP-UX PHSS_33280 : HP OpenView Operations, Remote Unauthorized Access and Denial of Service (DoS) (HPSBMA02149 SSRT050968 rev.1)
  • 14778 - Mandrake Linux Security Advisory : apache (MDKSA-2002:039-2)
  • 12305 - RHEL 2.1 : apache (RHSA-2002:126)

Version


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

Go back to menu.