Sha256: cfb9fbef727d8cb66adc24d616c0dd67a1c7155e396c495d5a8aadac7949aad3
Contents?: true
Size: 1.68 KB
Versions: 669
Compression:
Stored size: 1.68 KB
Contents
# frozen_string_literal: true require 'bunny' module PWN module Plugins # This plugin is used to interact w/ RabbitMQ via ruby. module RabbitMQ # Supported Method Parameters:: # PWN::Plugins::RabbitMQ.open( # hostname: 'required', # port: 'optional - defaults to 5672', # username: 'optional', # password: 'optional' # ) public_class_method def self.open(opts = {}) host = opts[:hostname].to_s port = opts[:port].to_i port = 5672 unless port.positive? user = opts[:username].to_s pass = opts[:password].to_s this_amqp_obj = Bunny.new("amqp://#{user}:#{pass}@#{host}:#{port}") this_amqp_obj.start rescue StandardError => e raise e end # Supported Method Parameters:: # PWN::Plugins::RabbitMQ.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', port: 'optional - defaults to 5672', username: 'optional', password: 'optional' ) #{self}.close( amqp_oject: amqp_conn1 ) #{self}.authors } end end end end
Version data entries
669 entries across 669 versions & 1 rubygems