Sha256: 4e9b958b9f6aac0156b597bc4c42fff45dbaf176aecffe961ad4eeefc8480b5d

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby

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

12 entries across 12 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.63 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.54 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.53 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.52 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.51 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.50 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.49 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.48 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.47 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.46 lib/rex/post/meterpreter/channels/pools/file.rb
librex-0.0.44 lib/rex/post/meterpreter/channels/pools/file.rb