Module: PWN::WWW::Pandora
- Defined in:
- lib/pwn/www/pandora.rb
Overview
This plugin supports pandora.com actions.
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
0day Inc.
-
.close(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.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::Pandora.login( browser_obj: 'required - browser_obj returned from #open method', username: 'required - username', password: 'optional - passwd (will prompt if blank)' ).
-
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.logout( browser_obj: 'required - browser_obj returned from #open method' ).
-
.open(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port || tor' ).
Class Method Details
.authors ⇒ Object
- Author(s)
0day Inc. [email protected]
90 91 92 93 94 |
# File 'lib/pwn/www/pandora.rb', line 90 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.close(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.close( browser_obj: 'required - browser_obj returned from #open method' )
79 80 81 82 83 84 85 86 |
# File 'lib/pwn/www/pandora.rb', line 79 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
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/pwn/www/pandora.rb', line 98 public_class_method def self.help puts "USAGE: # Open a session or connection and return a handle. #{self}.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port || tor' ) # Run login and return its result #{self}.login( browser_obj: 'required - browser_obj returned from #open method', username: 'required - username value consumed by #login', password: 'optional - passwd (will prompt if blank)' ) # Run logout and return its result #{self}.logout( browser_obj: 'required - browser_obj returned from #open method' ) # Close a session previously returned by #open. #{self}.close( browser_obj: 'required - browser_obj returned from #open method' ) # Print the AUTHOR(S) string for this module. #{self}.authors " constants.sort end |
.login(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.login( browser_obj: 'required - browser_obj returned from #open method', username: 'required - username', password: 'optional - passwd (will prompt if blank)' )
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/pwn/www/pandora.rb', line 33 public_class_method def self.login(opts = {}) browser_obj = opts[:browser_obj] username = opts[:username].to_s.scrub.strip.chomp password = opts[:password] browser = browser_obj[:browser] if password.nil? password = PWN::Plugins::AuthenticationHelper.mask_password else password = opts[:password].to_s.scrub.strip.chomp end browser.goto('https://www.pandora.com/account/sign-in') browser.text_field(id: 'login_username').wait_until(&:present?).set(username) browser.text_field(id: 'login_password').wait_until(&:present?).set(password) browser.(text: 'Log In').click! browser_obj rescue StandardError => e raise e end |
.logout(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.logout( browser_obj: 'required - browser_obj returned from #open method' )
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/pwn/www/pandora.rb', line 62 public_class_method def self.logout(opts = {}) browser_obj = opts[:browser_obj] browser = browser_obj[:browser] browser.img(alt: 'Account Menu').wait_until(&:present?).click! browser.span(text: 'Sign Out').wait_until(&:present?).click! browser_obj rescue StandardError => e raise e end |
.open(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Pandora.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port || tor' )
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pwn/www/pandora.rb', line 15 public_class_method def self.open(opts = {}) browser_obj = PWN::Plugins::TransparentBrowser.open(opts) browser = browser_obj[:browser] browser.goto('https://www.pandora.com') browser_obj rescue StandardError => e raise e end |