Module: PWN::Plugins::Vsphere
- Defined in:
- lib/pwn/plugins/vsphere.rb
Overview
This plugin is used for interacting w/ VMware ESXI’s REST API
Constant Summary collapse
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
-
0day Inc.
-
.help ⇒ Object
Display Usage for this Module.
-
.login(opts = {}) ⇒ Object
- Supported Method Parameters
-
vsphere_obj = PWN::Plugins::Vsphere.login( host: ‘required - vsphere host or ip’, username: ‘required - username’, password: ‘optional - password (will prompt if nil)’, insecure: ‘optional - ignore ssl checks (defaults to false) ).
-
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::Plugins::HackerOne.logout( vsphere_obj: ‘required vsphere_obj returned from #login method’ ).
Class Method Details
.authors ⇒ Object
- Author(s)
-
0day Inc. <[email protected]>
55 56 57 58 59 |
# File 'lib/pwn/plugins/vsphere.rb', line 55 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.help ⇒ Object
Display Usage for this Module
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/pwn/plugins/vsphere.rb', line 63 public_class_method def self.help puts "USAGE: vsphere_obj = #{self}.login( host: 'required - vsphere host or ip', username: 'required - username', password: 'optional - password (will prompt if nil)', insecure: 'optional - ignore ssl checks (defaults to false) ) vsphere_obj = #{self}.logout( vsphere_obj: 'required vsphere_obj returned from #login method' ) #{self}.authors " end |
.login(opts = {}) ⇒ Object
- Supported Method Parameters
-
vsphere_obj = PWN::Plugins::Vsphere.login(
host: 'required - vsphere host or ip', username: 'required - username', password: 'optional - password (will prompt if nil)', insecure: 'optional - ignore ssl checks (defaults to false)
)
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pwn/plugins/vsphere.rb', line 19 public_class_method def self.login(opts = {}) host = opts[:host].to_s.scrub username = opts[:username].to_s.scrub password = if opts[:password].nil? PWN::Plugins::AuthenticationHelper.mask_password else opts[:password].to_s.scrub end insecure = opts[:insecure] ||= false @@logger.info("Logging into vSphere: #{host}") RbVmomi::VIM.connect( host: host, user: username, password: password, insecure: insecure ) rescue StandardError => e raise e end |
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::Plugins::HackerOne.logout(
vsphere_obj: 'required vsphere_obj returned from #login method'
)
45 46 47 48 49 50 51 |
# File 'lib/pwn/plugins/vsphere.rb', line 45 public_class_method def self.logout(opts = {}) vsphere_obj = opts[:vsphere_obj] @@logger.info('Logging out...') vsphere_obj = nil rescue StandardError => e raise e end |