Class: Rex::Post::Meterpreter::Channels::Pools::StreamPool
- Inherits:
-
Rex::Post::Meterpreter::Channels::Pool
- Object
- Rex::Post::Meterpreter::Channel
- Rex::Post::Meterpreter::Channels::Pool
- Rex::Post::Meterpreter::Channels::Pools::StreamPool
- Includes:
- IO::StreamAbstraction
- Defined in:
- lib/rex/post/meterpreter/channels/pools/stream_pool.rb
Overview
StreamPool
This class represents a channel that is associated with a streaming pool that has no definite end-point. While this may seem a paradox given the stream class of channels, it’s in fact dinstinct because streams automatically forward traffic between the two ends of the channel whereas stream pools are always requested data in a single direction.
Instance Attribute Summary
Attributes included from IO::StreamAbstraction
Attributes inherited from Rex::Post::Meterpreter::Channel
#cid, #client, #cls, #flags, #params, #type
Instance Method Summary collapse
-
#cleanup ⇒ Object
Cleans up resources used by the channel.
-
#dio_close_handler(packet) ⇒ Object
Closes the local half of the pool stream.
-
#dio_write_handler(packet, data) ⇒ Object
Transfers data to the local half of the pool for reading.
-
#eof ⇒ Object
This method returns whether or not eof has been returned.
-
#initialize(client, cid, type, flags) ⇒ StreamPool
constructor
Initializes the file channel instance.
-
#seek ⇒ Object
This method seeks to an offset in the pool.
-
#tell ⇒ Object
This method returns the current offset into the pool.
Methods included from IO::StreamAbstraction
#cleanup_abstraction, #close, #initialize_abstraction, #localinfo, #peerinfo, #shutdown, #sysread, #syswrite
Methods inherited from Rex::Post::Meterpreter::Channels::Pool
Methods inherited from Rex::Post::Meterpreter::Channel
_close, #_close, #_read, #_write, #close, #close_read, #close_write, create, #dio_handler, #dio_map, #dio_read_handler, finalize, #flag?, #interactive, #read, request_handler, #synchronous?, #write
Methods included from InboundPacketHandler
#request_handler, #response_handler
Constructor Details
#initialize(client, cid, type, flags) ⇒ StreamPool
Initializes the file channel instance
36 37 38 39 40 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 36 def initialize(client, cid, type, flags) super(client, cid, type, flags) initialize_abstraction end |
Instance Method Details
#cleanup ⇒ Object
Cleans up resources used by the channel.
94 95 96 97 98 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 94 def cleanup super cleanup_abstraction end |
#dio_close_handler(packet) ⇒ Object
Closes the local half of the pool stream.
85 86 87 88 89 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 85 def dio_close_handler(packet) rsock.close return super(packet) end |
#dio_write_handler(packet, data) ⇒ Object
Transfers data to the local half of the pool for reading.
72 73 74 75 76 77 78 79 80 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 72 def dio_write_handler(packet, data) rv = Rex::ThreadSafe.select(nil, [rsock], nil, 0.01) if(rv) rsock.write(data) return true else return false end end |
#eof ⇒ Object
This method returns whether or not eof has been returned.
65 66 67 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 65 def eof return false end |
#seek ⇒ Object
This method seeks to an offset in the pool.
58 59 60 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 58 def seek raise NotImplementedError end |
#tell ⇒ Object
This method returns the current offset into the pool.
51 52 53 |
# File 'lib/rex/post/meterpreter/channels/pools/stream_pool.rb', line 51 def tell raise NotImplementedError end |