Class: Ronin::UI::CLI::Commands::URLs

Inherits:
ResourcesCommand show all
Defined in:
lib/ronin/ui/cli/commands/urls.rb

Overview

The ronin-urls command.

Instance Method Summary collapse

Methods inherited from ResourcesCommand

#execute, model, #print_resources

Methods inherited from ModelCommand

each_query_option, model, #query, query_option, query_options, #setup

Methods inherited from Ronin::UI::CLI::Command

banner, command_name, #execute, #indent, inherited, #initialize, #print_array, #print_exception, #print_hash, #print_section, #print_title, #puts, run, #setup

Constructor Details

This class inherits a constructor from Ronin::UI::CLI::Command

Instance Method Details

Prints a URL.

Parameters:

Since:

  • 1.0.0


75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/ronin/ui/cli/commands/urls.rb', line 75

def print_resource(url)
  return super(url) unless options.verbose?

  print_title url

  indent do
    print_hash 'Host' => url.host_name,
               'Port' => url.port.number,
               'Path' => url.path,
               'Fragment' => url.fragment,
               'Last Scanned' => url.last_scanned_at

    unless url.query_params.empty?
      params = {}

      url.query_params.each do |param|
        params[param.name] = param.value
      end

      print_hash params, :title => 'Query Params'
    end
  end
end