Class: Rex::Post::Meterpreter::Extensions::Stdapi::Sys::ProcessSubsystem::IO

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb

Overview

This class provides an input/output interface to an executed process’ standard input and output.

Instance Method Summary collapse

Constructor Details

#initialize(process) ⇒ IO

Initializes the IO instance.



32
33
34
# File 'lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb', line 32

def initialize(process)
	self.process = process
end

Instance Method Details

#read(length = nil) ⇒ Object

Reads data from the standard output handle of the executed process.



47
48
49
# File 'lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb', line 47

def read(length = nil)
	return process.channel.read(length)
end

#write(buf) ⇒ Object

Writes the supplied buffer to the standard input handle of the executed process.



40
41
42
# File 'lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb', line 40

def write(buf)
	return process.channel.write(buf)
end