class Ronin::CLI::Commands::Bitflip
Prints every bit-flip of the given string(s).
## Usage
ronin bitflip [options] [STRING ...]
## Options
-f, --file FILE Optional file to read values from -N, --numeric Searches for numeric characters (0-9) -O, --octal Searches for octal characters (0-7) -X, --upper-hex Searches for uppercase hexadecimal (0-9, A-F) -x, --lower-hex Searches for lowercase hexadecimal (0-9, a-f) -H, --hex Searches for hexadecimal chars (0-9, a-f, A-F) --upper-alpha Searches for uppercase alpha chars (A-Z) --lower-alpha Searches for lowercase alpha chars (a-z) -A, --alpha Searches for alpha chars (a-z, A-Z) --alpha-num Searches for alpha-numeric chars (a-z, A-Z, 0-9) -P, --punct Searches for punctuation chars -S, --symbols Searches for symbolic chars -s, --space Searches for all whitespace chars -v, --visible Searches for all visible chars -p, --printable Searches for all printable chars -C, --control Searches for all control chars (\x00-\x1f, \x7f) -a, --signed-ascii Searches for all signed ASCII chars (\x00-\x7f) --ascii Searches for all ASCII chars (\x00-\xff) -c, --chars CHARS Searches for all chars in the custom char-set -i, --include-chars CHARS Include the additional chars to the char-set -e, --exclude-chars CHARS Exclude the additional chars from the char-set --prepend STRING Prepends the given string to each output --append STRING Appends the given string to each output -h, --help Print help information
## Arguments
[STRING ...] The string(s) to bit-flip.
## Examples
ronin bitflip --prepend www --append .com microsoft
Public Instance Methods
format_string(string)
click to toggle source
Formats a bit-flipped string.
@param [String] string
The bit-flipped String.
@return [String]
The formatted bit-flipped String.
# File lib/ronin/cli/commands/bitflip.rb, line 119 def format_string(string) string.prepend(options[:prepend]) if options[:prepend] string.concat(options[:append]) if options[:append] if string =~ /\A[[:print:]]+\z/ string else Support::Encoding::Hex.escape(string) end end
process_value(string)
click to toggle source
Prints every bit-flip of a given String.
@param [String] string
# File lib/ronin/cli/commands/bitflip.rb, line 102 def process_value(string) string.each_bit_flip do |bit_flipped| if @char_set =~ bit_flipped puts format_string(bit_flipped) end end end