Sha256: 6fd98c644ffe2a231e29231fbdd70b1f3a97649dd792a0e0500c16ba452ef457

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

# -*- coding: binary -*-

require 'rex/post/meterpreter/extensions/stdapi/stdapi'

module Rex
module Post
module Meterpreter
module Extensions
module Stdapi
module Fs

class Mount

  # Used when matching against windows drive types
  DRIVE_TYPES = [
    :unknown,
    :no_root,
    :removable,
    :fixed,
    :remote,
    :cdrom,
    :ramdisk
  ]

  def initialize(client)
    self.client = client
  end

  def show_mount
    request = Packet.create_request('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

protected
  attr_accessor :client # :nodoc:

end

end; end; end; end; end; end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb
rex-2.0.12 lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb
rex-2.0.11 lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb
rex-2.0.10 lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb
rex-2.0.9 lib/rex/post/meterpreter/extensions/stdapi/fs/mount.rb