Module: PWN::WWW::Checkip

Defined in:
lib/pwn/www/checkip.rb

Overview

This plugin supports Checkip actions.

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. <[email protected]>



45
46
47
48
49
# File 'lib/pwn/www/checkip.rb', line 45

public_class_method def self.authors
  "AUTHOR(S):
    0day Inc. <[email protected]>
  "
end

.close(opts = {}) ⇒ Object

Supported Method Parameters

browser_obj = PWN::WWW::Checkip.close(

browser_obj: 'required - browser_obj returned from #open method',

)



34
35
36
37
38
39
40
41
# File 'lib/pwn/www/checkip.rb', line 34

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

.helpObject

Display Usage for this Module



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/pwn/www/checkip.rb', line 53

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 || tor'
    )

    browser_obj = #{self}.close(
      browser_obj: 'required - browser_obj returned from #open method',
    )

    #{self}.authors
  "
end

.open(opts = {}) ⇒ Object

Supported Method Parameters

browser_obj = PWN::WWW::Checkip.open(

browser_type: 'optional - :firefox|:chrome|:ie|:headless (Defaults to :firefox)',
proxy: 'optional - scheme://proxy_host:port || tor'

)



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/pwn/www/checkip.rb', line 16

public_class_method def self.open(opts = {})
  browser_obj = PWN::Plugins::TransparentBrowser.open(opts)

  browser = browser_obj[:browser]
  browser.goto('http://checkip.amazonaws.com')
  public_ip_address = Nokogiri::HTML.parse(browser.html).xpath('//pre').text.chomp
  puts "PUBLIC IP: #{public_ip_address}"

  browser_obj
rescue StandardError => e
  raise e
end