Sha256: 0bbebf8c0d1958583f25525661686fdf0de15e959e3c90cd7347e62ac633a39a

Contents?: true

Size: 1.52 KB

Versions: 51

Compression:

Stored size: 1.52 KB

Contents

# frozen_string_literal: true

require 'bunny'

module PWN
  module Plugins
    # This plugin is used to interact w/ RabbitMQ via ruby.
    module RabbitMQHole
      # Supported Method Parameters::
      # PWN::Plugins::RabbitMQHole.open(
      #   hostname: 'required',
      #   username: 'optional',
      #   password: 'optional'
      # )

      public_class_method def self.open(opts = {})
        host = opts[:hostname].to_s
        user = opts[:username].to_s
        pass = opts[:password].to_s

        this_amqp_obj = Bunny.new("amqp://#{user}:#{pass}@#{host}")
        this_amqp_obj.start
      rescue StandardError => e
        raise e
      end

      # Supported Method Parameters::
      # PWN::Plugins::RabbitMQHole.close(
      #   amqp_oject: amqp_conn1
      # )

      public_class_method def self.close(opts = {})
        this_amqp_obj = opts[:amqp_obj]
        this_amqp_obj.close_connection
      rescue StandardError => e
        raise e
      end

      # Author(s):: 0day Inc. <request.pentest@0dayinc.com>

      public_class_method def self.authors
        "AUTHOR(S):
          0day Inc. <request.pentest@0dayinc.com>
        "
      end

      # Display Usage for this Module

      public_class_method def self.help
        puts %{USAGE:
          amqp_conn1 = #{self}.open(
            hostname: 'required',
            username: 'optional',
            password: 'optional'
          )

          #{self}.close(
            amqp_oject: amqp_conn1
          )

          #{self}.authors
        }
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
pwn-0.4.400 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.399 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.398 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.396 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.394 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.393 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.391 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.390 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.389 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.388 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.387 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.386 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.385 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.384 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.383 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.382 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.381 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.380 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.378 lib/pwn/plugins/rabbit_mq_hole.rb
pwn-0.4.377 lib/pwn/plugins/rabbit_mq_hole.rb