Class: Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::MockMagic::MockRailgunClient

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platform, response_tlvs, check_request) ⇒ MockRailgunClient

Returns a new instance of MockRailgunClient.



29
30
31
32
33
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb', line 29

def initialize(platform, response_tlvs, check_request)
  @check_request = check_request
  @response_tlvs = response_tlvs
  @platform = platform
end

Instance Attribute Details

#check_requestObject (readonly)

Returns the value of attribute check_request.



27
28
29
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb', line 27

def check_request
  @check_request
end

#platformObject (readonly)

Returns the value of attribute platform.



27
28
29
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb', line 27

def platform
  @platform
end

#response_tlvsObject (readonly)

Returns the value of attribute response_tlvs.



27
28
29
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb', line 27

def response_tlvs
  @response_tlvs
end

Instance Method Details

#send_request(request) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb', line 35

def send_request(request)
  check_request.call(request)

  (Class.new do
    def initialize(response_tlvs)
      @response_tlvs = response_tlvs
    end
    def get_tlv_value(type)
      return @response_tlvs[type]
    end
  end).new(@response_tlvs)
end