Class: Msf::Exploit::Remote::HTTP::Kubernetes::Output::JSON
- Inherits:
-
Object
- Object
- Msf::Exploit::Remote::HTTP::Kubernetes::Output::JSON
- Defined in:
- lib/msf/core/exploit/remote/http/kubernetes/output/json.rb
Overview
Outputs Kubernetes API responses in JSON format
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
protected
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(output) ⇒ JSON
constructor
Creates a new ‘Msf::Exploit::Remote::HTTP::Kubernetes::Output::JSON` instance.
- #print_auth(_namespace, auth) ⇒ Object
- #print_claims(claims) ⇒ Object
- #print_enum_failure(_resource, error) ⇒ Object
- #print_error(*_args) ⇒ Object
- #print_good(*_args) ⇒ Object
- #print_json(object) ⇒ Object protected
- #print_namespaces(namespaces) ⇒ Object
- #print_pods(_namespace, pods) ⇒ Object
- #print_secrets(_namespace, pods) ⇒ Object
- #print_status(*_args) ⇒ Object
- #print_version(version) ⇒ Object
Constructor Details
#initialize(output) ⇒ JSON
Creates a new ‘Msf::Exploit::Remote::HTTP::Kubernetes::Output::JSON` instance
8 9 10 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 8 def initialize(output) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly, protected)
Returns the value of attribute output.
52 53 54 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 52 def output @output end |
Instance Method Details
#print_auth(_namespace, auth) ⇒ Object
38 39 40 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 38 def print_auth(_namespace, auth) print_json(auth) end |
#print_claims(claims) ⇒ Object
26 27 28 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 26 def print_claims(claims) print_json(claims) end |
#print_enum_failure(_resource, error) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 18 def print_enum_failure(_resource, error) if error.is_a?(Msf::Exploit::Remote::HTTP::Kubernetes::Error::ApiError) && error.res print_json(error.res.get_json_document) else output.print_error(error.) end end |
#print_error(*_args) ⇒ Object
12 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 12 def print_error(*_args); end |
#print_good(*_args) ⇒ Object
14 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 14 def print_good(*_args); end |
#print_json(object) ⇒ Object (protected)
54 55 56 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 54 def print_json(object) output.print_line(JSON.pretty_generate(object)) end |
#print_namespaces(namespaces) ⇒ Object
34 35 36 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 34 def print_namespaces(namespaces) print_json(namespaces) end |
#print_pods(_namespace, pods) ⇒ Object
42 43 44 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 42 def print_pods(_namespace, pods) print_json(pods) end |
#print_secrets(_namespace, pods) ⇒ Object
46 47 48 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 46 def print_secrets(_namespace, pods) print_json(pods) end |
#print_status(*_args) ⇒ Object
16 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 16 def print_status(*_args); end |
#print_version(version) ⇒ Object
30 31 32 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/output/json.rb', line 30 def print_version(version) print_json(version) end |