Class: Ronin::CLI::Commands::Typosquat Private
- Inherits:
-
ValueProcessorCommand
- Object
- Core::CLI::Command
- Ronin::CLI::Command
- ValueProcessorCommand
- Ronin::CLI::Commands::Typosquat
- Includes:
- TypoOptions
- Defined in:
- lib/ronin/cli/commands/typosquat.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.
Finds typo squatted domains.
Usage
ronin typosquat [] [DOMAIN ...]
Options
-f, --file FILE Optional file to read values from
--omit-chars Toggles whether to omit repeated characters
--repeat-chars Toggles whether to repeat single characters
--swap-chars Toggles whether to swap certain common character pairs
--change-suffix Toggles whether to change the suffix of words
-A, --has-addresses Print typo squat domains with addresses
-r, --registered Print typo squat domains that are already registered
-u, --unregistered Print typo squat domains that can be registered
-h, --help Print help information
Arguments
DOMAIN The domain to typo squat
Instance Attribute Summary
Attributes inherited from ValueProcessorCommand
Instance Method Summary collapse
-
#each_typo_squat(domain) {|typo_domain| ... } ⇒ Object
private
Enumerates over each typosquat of the domain.
-
#process_value(domain) ⇒ Object
private
Processes each word.
Methods included from TypoOptions
included, #initialize, #typo_generator
Methods inherited from ValueProcessorCommand
#initialize, #process_file, #run
Instance Method Details
#each_typo_squat(domain) {|typo_domain| ... } ⇒ 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.
Enumerates over each typosquat of the domain.
113 114 115 116 117 118 119 120 121 |
# File 'lib/ronin/cli/commands/typosquat.rb', line 113 def each_typo_squat(domain) domain = Support::Network::Domain.new(domain) suffix = domain.suffix name = domain.name.chomp(suffix) typo_generator.each_substitution(name) do |typo| yield Support::Network::Domain.new("#{typo}#{suffix}") end end |
#process_value(domain) ⇒ 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 each word.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ronin/cli/commands/typosquat.rb', line 75 def process_value(domain) if [:has_addresses] each_typo_squat(domain) do |typo_domain| if typo_domain.has_addresses? puts typo_domain end end elsif [:registered] each_typo_squat(domain) do |typo_domain| if typo_domain.registered? puts typo_domain end end elsif [:unregistered] each_typo_squat(domain) do |typo_domain| if typo_domain.unregistered? puts typo_domain end end else each_typo_squat(domain) do |typo_domain| puts typo_domain end end end |