Class: Ronin::UI::CLI::Commands::Creds

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

Overview

The ronin-creds command.

Instance Method Summary collapse

Methods inherited from ResourcesCommand

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, #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

#executeObject

Queries the Credential model.

Since:

  • 1.0.0


53
54
55
56
57
# File 'lib/ronin/ui/cli/commands/creds.rb', line 53

def execute
  if options.list?
    super
  end
end

Prints a credential.

Parameters:

  • cred (Credential)

    The credential to display.

Since:

  • 1.0.0


69
70
71
72
73
74
75
76
77
78
# File 'lib/ronin/ui/cli/commands/creds.rb', line 69

def print_resource(cred)
  case cred
  when ServiceCredential
    puts "#{cred}\t(#{cred.open_port.ip_address} #{cred.open_port})"
  when WebCredential
    puts "#{cred}\t(#{cred.url})"
  else
    super(cred)
  end
end