Class Rex::Post::Meterpreter::Channel
In: lib/rex/post/meterpreter/channel.rb
Parent: Object

The channel class represents a logical data pipe that exists between the client and the server. The purpose and behavior of the channel depends on which type it is. The three basic types of channels are streams, datagrams, and pools. Streams are basically equivalent to a TCP connection. Bidirectional, connection-oriented streams. Datagrams are basically equivalent to a UDP session. Bidirectional, connectionless. Pools are basically equivalent to a uni-directional connection, like a file handle. Pools denote channels that only have requests flowing in one direction.

Methods

Included Modules

Rex::Post::Meterpreter::InboundPacketHandler

Attributes

cid  [R]  The unique channel identifier.
cls  [R]  The class of channel (stream, datagram, pool).
flags  [R]  Any channel-specific flag, like synchronous IO.
type  [R]  The type of channel.

Public Class methods

Creates a logical channel between the client and the server based on a given type.

Initializes the instance‘s attributes, such as client context, class identifier, type, and flags.

Class request handler for all channels that dispatches requests to the appropriate class instance‘s DIO handler

Public Instance methods

Closes the channel.

Reads data from the remote half of the channel.

Writes data to the remote half of the channel.

Wrapper around the low-level close.

Close the channel for future reads.

Close the channel for future writes.

Handles dispatching I/O requests based on the request packet. The default implementation does nothing with direct I/O requests.

Maps packet request methods to DIO request identifiers on a per-instance basis as other instances may add custom dio handlers.

Checks to see if a flag is set on the instance‘s flags attribute.

Wrapper around the low-level channel read operation.

Returns whether or not the channel is operating synchronously.

Wrapper around the low-level write.

Protected Instance methods

Cleans up any lingering resources

[Validate]