Method: Rex::Proto::PJL::Client#info

Defined in:
lib/rex/proto/pjl/client.rb

#info(category) ⇒ String

Send an INFO request and read the response

Parameters:

  • category (String)

    INFO category

Returns:

  • (String)

    INFO response



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rex/proto/pjl/client.rb', line 32

def info(category)
  categories = {
    :id => Info::ID,
    :status => Info::STATUS,
    :variables => Info::VARIABLES,
    :filesys => Info::FILESYS
  }

  unless categories.has_key?(category)
    raise ArgumentError, "Unknown INFO category"
  end

  @sock.put("#{categories[category]}\n")
  @sock.get(DEFAULT_TIMEOUT)
end