Class: Rex::Post::Meterpreter::Extensions::Stdapi::Fs::Mount

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

Constant Summary collapse

DRIVE_TYPES =

Used when matching against windows drive types

[
  :unknown,
  :no_root,
  :removable,
  :fixed,
  :remote,
  :cdrom,
  :ramdisk
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Mount

Returns a new instance of Mount.


25
26
27
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb', line 25

def initialize(client)
  self.client = client
end

Instance Attribute Details

#clientObject (protected)

:nodoc:


51
52
53
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb', line 51

def client
  @client
end

Instance Method Details

#show_mountObject


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb', line 29

def show_mount
  request = Packet.create_request(COMMAND_ID_STDAPI_FS_MOUNT_SHOW)

  response = client.send_request(request)

  results = []

  response.each(TLV_TYPE_MOUNT) do |d|
    results << {
      name:        d.get_tlv_value(TLV_TYPE_MOUNT_NAME),
      type:        DRIVE_TYPES[d.get_tlv_value(TLV_TYPE_MOUNT_TYPE)],
      user_space:  d.get_tlv_value(TLV_TYPE_MOUNT_SPACE_USER),
      total_space: d.get_tlv_value(TLV_TYPE_MOUNT_SPACE_TOTAL),
      free_space:  d.get_tlv_value(TLV_TYPE_MOUNT_SPACE_FREE),
      unc:         d.get_tlv_value(TLV_TYPE_MOUNT_UNCPATH)
    }
  end

  results
end