Module: PWN::WWW::Duckduckgo
- Defined in:
- lib/pwn/www/duckduckgo.rb
Overview
This plugin supports Duckduckgo actions.
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
0day Inc.
-
.close(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.close( browser_obj: 'required - browser_obj returned from #open method' ).
-
.help ⇒ Object
Display Usage for this Module.
-
.onion(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.onion( browser_obj: 'required - browser_obj returned from #open method', ).
-
.open(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port || tor' ).
-
.search(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.search( browser_obj: 'required - browser_obj returned from #open method', q: 'required - search string' ).
Class Method Details
.authors ⇒ Object
- Author(s)
0day Inc. [email protected]
81 82 83 84 85 |
# File 'lib/pwn/www/duckduckgo.rb', line 81 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.close(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.close( browser_obj: 'required - browser_obj returned from #open method' )
70 71 72 73 74 75 76 77 |
# File 'lib/pwn/www/duckduckgo.rb', line 70 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
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/pwn/www/duckduckgo.rb', line 89 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 a search using the open session. #{self}.search( browser_obj: 'required - browser_obj returned from #open method', q: 'required - search string' ) # Run onion and return its result #{self}.onion( 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 |
.onion(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.onion( browser_obj: 'required - browser_obj returned from #open method', )
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/pwn/www/duckduckgo.rb', line 54 public_class_method def self.onion(opts = {}) browser_obj = opts[:browser_obj] browser = browser_obj[:browser] browser.goto('http://3g2upl4pq6kufc4m.onion') browser_obj rescue StandardError => e raise e end |
.open(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.open( browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)', proxy: 'optional - scheme://proxy_host:port || tor' )
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pwn/www/duckduckgo.rb', line 13 public_class_method def self.open(opts = {}) browser_obj = PWN::Plugins::TransparentBrowser.open(opts) browser = browser_obj[:browser] browser.goto('https://duckduckgo.com') browser_obj rescue StandardError => e raise e end |
.search(opts = {}) ⇒ Object
- Supported Method Parameters
browser_obj = PWN::WWW::Duckduckgo.search( browser_obj: 'required - browser_obj returned from #open method', q: 'required - search string' )
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/pwn/www/duckduckgo.rb', line 30 public_class_method def self.search(opts = {}) browser_obj = opts[:browser_obj] q = opts[:q].to_s browser = browser_obj[:browser] browser.text_field(name: 'q').wait_until(&:present?).set(q) if browser.url == 'https://duckduckgo.com/' || browser.url == 'http://3g2upl4pq6kufc4m.onion/' browser.(id: 'search_button_homepage').click! else browser.(id: 'search_button').click! end browser_obj rescue StandardError => e raise e end |