Sha256: 96f9d5902bc7f103b0fb14685219ee882a9c544882dabcdda06a253e0e0a128b

Contents?: true

Size: 1.31 KB

Versions: 15

Compression:

Stored size: 1.31 KB

Contents

# -*- coding: binary -*-

require 'rex/post/meterpreter/extensions/networkpug/tlv'

module Rex
module Post
module Meterpreter
module Extensions
module NetworkPug

# NetworkPug implements a remote packet recieve/send on a network interface
# on the remote machine

class NetworkPug < Extension

  def initialize(client)
    super(client, 'networkpug')

    client.register_extension_aliases(
      [
        {
          'name' => 'networkpug',
          'ext'  => self
        },
      ])
  end

  def networkpug_start(interface, filter)
    request = Packet.create_request('networkpug_start')
    request.add_tlv(TLV_TYPE_NETWORKPUG_INTERFACE, interface)
    request.add_tlv(TLV_TYPE_NETWORKPUG_FILTER, filter) if(filter and filter != "")
    response = client.send_request(request)

    channel = nil
    channel_id = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)

    if(channel_id)
      channel = Rex::Post::Meterpreter::Channels::Pools::StreamPool.new(
        client,
        channel_id,
        "networkpug_interface",
        CHANNEL_FLAG_SYNCHRONOUS
      )
    end

    return response, channel
  end

  def networkpug_stop(interface)
    request = Packet.create_request('networkpug_stop')
    request.add_tlv(TLV_TYPE_NETWORKPUG_INTERFACE, interface)
    response = client.send_request(request)
  end

end

end; end; end; end; end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.12 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.11 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.10 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.9 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.8 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.7 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.5 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.4 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
dstruct-0.0.1 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.3 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
librex-0.0.999 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
rex-2.0.2 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
librex-0.0.71 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb
librex-0.0.70 lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb