Sha256: 37a2019ca508b64dffbd89fad950c0b98d6fd15a5b4656d3997dca67130bdbdc

Contents?: true

Size: 1.22 KB

Versions: 15

Compression:

Stored size: 1.22 KB

Contents

# -*- coding: binary -*-

require 'rex/post/meterpreter/channels/pool'
require 'rex/post/meterpreter/extensions/stdapi/tlv'

module Rex
module Post
module Meterpreter
module Channels
module Pools

###
#
# File
# ----
#
# This class represents a channel that is associated with a file
# on the remote half of the meterpreter connection.
#
###
class File < Rex::Post::Meterpreter::Channels::Pool

  ##
  #
  # Factory
  #
  ##

  #
  # This method returns an instance of a file pool channel that can be read
  # from, written to, seeked on, and other interacted with.
  #
  def File.open(client, name, mode = "r", perm = 0)
    return Channel.create(client, 'stdapi_fs_file',
        self, CHANNEL_FLAG_SYNCHRONOUS,
        [
          {
            'type'  => Rex::Post::Meterpreter::Extensions::Stdapi::TLV_TYPE_FILE_PATH,
            'value' => client.unicode_filter_decode( name )
          },
          {
            'type'  => Rex::Post::Meterpreter::Extensions::Stdapi::TLV_TYPE_FILE_MODE,
            'value' => mode + "b"
          },
        ])
  end

  ##
  #
  # Constructor
  #
  ##

  # Initializes the file channel instance
  def initialize(client, cid, type, flags)
    super(client, cid, type, flags)
  end

end

end; end; end; end; end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.12 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.11 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.10 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.9 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.8 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.7 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.5 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.4 lib/rex/post/meterpreter/channels/pools/file.rb
dstruct-0.0.1 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.3 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.999 lib/rex/post/meterpreter/channels/pools/file.rb
rex-2.0.2 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.71 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.70 lib/rex/post/meterpreter/channels/pools/file.rb