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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(process) ⇒ IO

Initializes the IO instance.



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

def initialize(process)
  self.process = process
end

Instance Attribute Details

#processObject (protected)

:nodoc:



51
52
53
# File 'lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb', line 51

def process
  @process
end

Instance Method Details

#read(length = nil) ⇒ Object

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



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

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.



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

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