Module: PWN::Plugins::RabbitMQ
- Defined in:
- lib/pwn/plugins/rabbit_mq.rb
Overview
This plugin is used to interact w/ RabbitMQ via ruby.
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
0day Inc.
-
.close(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::Plugins::RabbitMQ.close( amqp_oject: amqp_conn1 ).
-
.help ⇒ Object
Display Usage for this Module.
-
.open(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::Plugins::RabbitMQ.open( hostname: 'required', port: 'optional - defaults to 5672', username: 'optional', password: 'optional' ).
Class Method Details
.authors ⇒ Object
- Author(s)
0day Inc. [email protected]
44 45 46 47 48 |
# File 'lib/pwn/plugins/rabbit_mq.rb', line 44 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.close(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::Plugins::RabbitMQ.close( amqp_oject: amqp_conn1 )
35 36 37 38 39 40 |
# File 'lib/pwn/plugins/rabbit_mq.rb', line 35 public_class_method def self.close(opts = {}) this_amqp_obj = opts[:amqp_obj] this_amqp_obj.close_connection rescue StandardError => e raise e end |
.help ⇒ Object
Display Usage for this Module
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/pwn/plugins/rabbit_mq.rb', line 52 public_class_method def self.help puts "USAGE: # Open a session or connection and return a handle. #{self}.open( hostname: 'required - hostname value consumed by #open', port: 'optional - defaults to 5672', username: 'optional - username value consumed by #open', password: 'optional - password value consumed by #open' ) # Close a session previously returned by #open. #{self}.close( amqp_oject: 'optional - amqp oject value consumed by #close', amqp_obj: 'optional - amqp obj value consumed by #close' ) # Print the AUTHOR(S) string for this module. #{self}.authors " constants.sort end |
.open(opts = {}) ⇒ Object
- Supported Method Parameters
PWN::Plugins::RabbitMQ.open( hostname: 'required', port: 'optional - defaults to 5672', username: 'optional', password: 'optional' )
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pwn/plugins/rabbit_mq.rb', line 17 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 |