Class: Ronin::CLI::Commands::EmailAddr Private

Inherits:
ValueProcessorCommand show all
Defined in:
lib/ronin/cli/commands/email_addr.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Processes email addresses.

Usage

ronin email-addr [options] [EMAIL_ADDR ...]

Options

-f, --file FILE                  Optional file to read values from
-O, --obfuscate                  Obfuscates the email address(es)
    --enum-obfuscations          Enumerate over every obfuscation
-D, --deobfuscate                Deobfuscates the email address(es)
-n, --name                       Extracts the name part of the email address(es)
-m, --mailbox                    Extracts the mailbox part of the email address(es)
-d, --domain                     Extracts the domain part of the email address(es)
-N, --normalize                  Normalizes the email address(es)
-h, --help                       Print help information

Arguments

[EMAIL_ADDR ...]                 The email address(es) to process

Examples

ronin email-addr --deobfuscate "john{DOT}smith{AT}example{DOT}com"
ronin email-addr --input emails.txt --domain

Since:

  • 2.0.0

Instance Attribute Summary

Attributes inherited from ValueProcessorCommand

#files

Instance Method Summary collapse

Methods inherited from ValueProcessorCommand

#initialize, #process_file, #run

Constructor Details

This class inherits a constructor from Ronin::CLI::ValueProcessorCommand

Instance Method Details

#process_value(string) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Processes an individual email address.

Parameters:

  • string (String)

    An individual email address.

Since:

  • 2.0.0



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/ronin/cli/commands/email_addr.rb', line 99

def process_value(string)
  if options[:deobfuscate]
    string = Support::Network::EmailAddress.deobfuscate(string)
  end

  email_address = Support::Network::EmailAddress.parse(string)
  email_address = email_address.normalize if options[:normalize]

  if options[:enum_obfuscations]
    email_address.each_obfuscation do |obfuscated_email|
      puts obfuscated_email
    end
  elsif options[:obfuscate]
    puts email_address.obfuscate
  elsif options[:name]
    puts email_address.name
  elsif options[:mailbox]
    puts email_address.mailbox
  elsif options[:domain]
    puts email_address.domain
  else
    puts email_address
  end
end