Class: Ronin::Recon::Web::EmailAddresses

Inherits:
Ronin::Recon::WebWorker show all
Defined in:
lib/ronin/recon/builtin/web/email_addresses.rb

Overview

A recon worker that returns email addresses found on website.

Constant Summary

Constants included from Mixins::HTTP

Mixins::HTTP::VALID_STATUS_CODES

Instance Method Summary collapse

Methods inherited from Ronin::Recon::Worker

accepts, concurrency, #initialize, intensity, outputs, register, run

Constructor Details

This class inherits a constructor from Ronin::Recon::Worker

Instance Method Details

#process(url) {|email| ... } ⇒ Object

Extract email addresses found in the pages body.

Parameters:

  • url (Values::URL)

    The URL of the page to extract email addresses from.

Yields:

  • (email)

    Each email address found on the page will be yielded.

Yield Parameters:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/ronin/recon/builtin/web/email_addresses.rb', line 57

def process(url)
  if (body = url.body)
    if body.encoding == Encoding::ASCII_8BIT
      # forcibly convert and scrub binary data into UTF-8 data
      body = body.dup
      body.force_encoding(Encoding::UTF_8)
      body.scrub!
    end

    body.scan(Support::Text::Patterns::EMAIL_ADDRESS) do |email|
      yield EmailAddress.new(email)
    end
  end
end