Class: Ronin::CLI::Commands::Bitsquat Private
- Inherits:
-
ValueProcessorCommand
- Object
- Core::CLI::Command
- Ronin::CLI::Command
- ValueProcessorCommand
- Ronin::CLI::Commands::Bitsquat
- Defined in:
- lib/ronin/cli/commands/bitsquat.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 bit-flips of a domain.
Usage
ronin bitsquat [] [DOMAIN ...]
Options
-f, --file FILE Optional file to read values from
--has-addresses Print bitsquat domains with addresses
--registered Print bitsquat domains that are already registered
--unregistered Print bitsquat domains that can be registered
-h, --help Print help information
Arguments
[DOMAIN ...] The domain to bit-flip
Constant Summary collapse
- VALID_HOST_NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Regular expression for a valid host name.
/\A#{Support::Text::Patterns::HOST_NAME}\z/
Instance Attribute Summary
Attributes inherited from ValueProcessorCommand
Instance Method Summary collapse
-
#each_bit_squat(domain) {|bitsquat_host| ... } ⇒ Object
private
Enumerates over each bitsquat of the domain.
-
#process_value(domain) ⇒ Object
private
Queries the bit-flips of a domain.
Methods inherited from ValueProcessorCommand
#initialize, #process_file, #run
Constructor Details
This class inherits a constructor from Ronin::CLI::ValueProcessorCommand
Instance Method Details
#each_bit_squat(domain) {|bitsquat_host| ... } ⇒ 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 bitsquat of the domain.
106 107 108 109 110 111 112 113 114 |
# File 'lib/ronin/cli/commands/bitsquat.rb', line 106 def each_bit_squat(domain) domain.each_bit_flip do |bit_flipped| bit_flipped.force_encoding(Encoding::UTF_8) if bit_flipped.valid_encoding? && bit_flipped =~ VALID_HOST_NAME yield Support::Network::Host.new(bit_flipped) end 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.
Queries the bit-flips of a domain.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/ronin/cli/commands/bitsquat.rb', line 74 def process_value(domain) if [:has_addresses] each_bit_squat(domain) do |host| puts host if host.has_addresses? end elsif [:registered] each_bit_squat(domain) do |host| puts host if host.registered? end elsif [:unregistered] each_bit_squat(domain) do |host| puts host if host.unregistered? end else each_bit_squat(domain) do |host| puts host end end end |