Files
metasploit-gs/lib/msf/core/modules/external/message.rb
T
Adam Cammack a3e196e31e Support arbitrary external command_stager exploits
So much done, so much more to do.
2017-03-31 17:06:28 -05:00

25 lines
482 B
Ruby

# -*- coding: binary -*-
require 'msf/core/modules/external'
require 'base64'
require 'json'
class Msf::Modules::External::Message
attr_reader :method, :id
attr_accessor :params
def initialize(m)
self.method = m
self.params = {}
self.id = Base64.strict_encode64(SecureRandom.random_bytes(16))
end
def to_json
JSON.generate({jsonrpc: '2.0', id: self.id, method: self.method, params: self.params.to_h})
end
protected
attr_writer :method, :id
end