Module: PWN::WWW::AppCobaltIO
- Defined in:
- lib/pwn/www/app_cobalt_io.rb
Overview
This plugin supports app.cobalt.io actions.
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
-
0day Inc.
-
.close(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.close( browser_obj: ‘required - browser_obj returned from #open method’ ).
-
.help ⇒ Object
Display Usage for this Module.
-
.login(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.login( browser_obj: ‘required - browser_obj returned from #open method’, username: ‘required - username’, password: ‘optional - passwd (will prompt if blank)’, mfa: ‘optional - if true prompt for mfa token (defaults to false)’ ).
-
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.logout( browser_obj: ‘required - browser_obj returned from #open method’ ).
-
.open(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.open( browser_type: ‘optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)’, proxy: ‘optional - scheme://proxy_host:port’, with_tor: ‘optional - boolean (defaults to false)’ ).
Class Method Details
.authors ⇒ Object
- Author(s)
-
0day Inc. <[email protected]>
100 101 102 103 104 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 100 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.close(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.close(
browser_obj: 'required - browser_obj returned from #open method')
89 90 91 92 93 94 95 96 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 89 public_class_method def self.close(opts = {}) browser_obj = opts[:browser_obj] PWN::Plugins::TransparentBrowser.close( browser_obj: browser_obj ) rescue StandardError => e raise e end |
.help ⇒ Object
Display Usage for this Module
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 108 public_class_method def self.help puts "USAGE: browser_obj = #{self}.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port', with_tor: 'optional - boolean (defaults to false)' ) puts browser_obj.public_methods browser_obj = #{self}.login( browser_obj: 'required - browser_obj returned from #open method', username: 'required - username', password: 'optional - passwd (will prompt if blank), mfa: 'optional - if true prompt for mfa token (defaults to false)' ) browser_obj = #{self}.logout( browser_obj: 'required - browser_obj returned from #open method' ) #{self}.close( browser_obj: 'required - browser_obj returned from #open method' ) #{self}.authors " end |
.login(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.login(
browser_obj: 'required - browser_obj returned from #open method', username: 'required - username', password: 'optional - passwd (will prompt if blank)', mfa: 'optional - if true prompt for mfa token (defaults to false)')
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 34 public_class_method def self.login(opts = {}) browser_obj = opts[:browser_obj] username = opts[:username].to_s.scrub.strip.chomp password = opts[:password] if password.nil? password = PWN::Plugins::AuthenticationHelper.mask_password else password = opts[:password].to_s.scrub.strip.chomp end mfa = opts[:mfa] browser_obj.goto('https://app.cobalt.io/users/sign_in') # id: 'user_email' doesn't work browser_obj.text_field(index: 9).wait_until(&:present?).set(username) # id: 'user_password' doesn't work browser_obj.text_field(index: 10).wait_until(&:present?).set(password) # name: 'commit' doesn't work browser_obj.(index: 6).click! # no name or id in button element if mfa until browser_obj.url == 'https://app.cobalt.io/dashboard' browser_obj.text_field(id: 'code').wait_until(&:present?).set(PWN::Plugins::AuthenticationHelper.mfa(prompt: 'enter mfa token')) browser_obj.(name: 'commit').click! sleep 3 end print "\n" end browser_obj rescue StandardError => e raise e end |
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.logout(
browser_obj: 'required - browser_obj returned from #open method')
74 75 76 77 78 79 80 81 82 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 74 public_class_method def self.logout(opts = {}) browser_obj = opts[:browser_obj] browser_obj.li(class: 'user-dropdown').wait_until(&:present?).click! browser_obj.link(index: 10).wait_until(&:present?).click! browser_obj rescue StandardError => e raise e end |
.open(opts = {}) ⇒ Object
- Supported Method Parameters
-
browser_obj = PWN::WWW::AppCobaltIO.open(
browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port', with_tor: 'optional - boolean (defaults to false)')
16 17 18 19 20 21 22 23 24 |
# File 'lib/pwn/www/app_cobalt_io.rb', line 16 public_class_method def self.open(opts = {}) browser_obj = PWN::Plugins::TransparentBrowser.open(opts) browser_obj.goto('https://app.cobalt.io') browser_obj rescue StandardError => e raise e end |