New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize JSON into MDM Objects #9394

Closed
wants to merge 57 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+16 −7
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Successfully storing creds remotely

  • Loading branch information...
jbarnett-r7 committed Oct 23, 2017
commit ffcec527a70d0dd05d0d1456696509eaaf4d47b4
@@ -3,9 +3,6 @@ module CredentialDataProxy
def create_credential(opts)
begin
data_service = self.get_data_service()
if !data_service.is_a?(Msf::DBManager)
opts[:data] = Base64.urlsafe_encode64(opts[:data]) if opts[:data]
end
data_service.create_credential(opts)
rescue Exception => e
puts "Call to #{data_service.class}#create_credential threw exception: #{e.message}"
@@ -3,18 +3,24 @@ module RemoteSessionDataService
SESSION_API_PATH = '/api/1/msf/session'
def report_session(opts)
if (opts[:session].kind_of? Msf::Session)
opts = convert_msf_session_to_hash(opts[:session])
session = opts[:session]
if (session.kind_of? Msf::Session)
opts = convert_msf_session_to_hash(session)
opts[:session_dto] = true
elsif (opts[:host])
opts[:host] = opts[:host].address
end
#TODO: Fix
opts[:time_stamp] = Time.now.utc
self.post_data_async(SESSION_API_PATH, opts)
sess_db = json_to_open_struct_object(self.post_data(SESSION_API_PATH, opts))
session.db_record = sess_db
end
# def get_session(opts = {})
# json_to_open_struct_object(self.get_data(SESSION_API_PATH, opts), [])
# end
#######
private
#######
@@ -22,6 +22,7 @@ def start_processor_thread()
wrapper.job.call(wrapper.job_args)
rescue Exception => e
puts "Error executing job #{e.message}"
e.backtrace.each { |line| puts "#{line}\n"}
end
end
}
@@ -35,7 +35,11 @@ def self.get_credentials
def self.create_credential
lambda {
job = lambda { |opts| get_db().report_cred(opts) }
job = lambda { |opts|
opts[:origin_type] = opts[:origin_type].to_sym
opts[:private_type] = opts[:private_type].to_sym
get_db().create_credential(opts)
}
exec_report_job(request, &job)
}
end
@@ -156,6 +156,7 @@ def report_session_dto(session_dto)
# This is a live session, we know the host is vulnerable to something.
infer_vuln_from_session_dto(session_dto, session_db_record, workspace)
end
session_db_record
}
end
ProTip! Use n and p to navigate between commits in a pull request.