Class: Pwnix::Api::Client::ApiClient
- Inherits:
-
Object
- Object
- Pwnix::Api::Client::ApiClient
- Includes:
- HTTParty, HTTPartyTime
- Defined in:
- lib/pwnix-api-client/api_client.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#error_string ⇒ Object
Returns the value of attribute error_string.
-
#modes ⇒ Object
Returns the value of attribute modes.
-
#node ⇒ Object
Returns the value of attribute node.
-
#services ⇒ Object
Returns the value of attribute services.
-
#shell_receiver_config ⇒ Object
Returns the value of attribute shell_receiver_config.
-
#shells ⇒ Object
Returns the value of attribute shells.
-
#system ⇒ Object
Returns the value of attribute system.
Instance Method Summary collapse
- #connected? ⇒ Boolean
-
#initialize(config = {}) ⇒ ApiClient
constructor
A new instance of ApiClient.
Methods included from HTTPartyTime
#clear_errors, #errors, #has_errors?, included, #last_error, #safe_api_call
Constructor Details
#initialize(config = {}) ⇒ ApiClient
Returns a new instance of ApiClient.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/pwnix-api-client/api_client.rb', line 149 def initialize(config={}) @shell_receiver_config = ShellReceiverConfig.new @shells = { "dns" => Shell.new("dns"), "gsm" => Shell.new("gsm"), "http" => Shell.new("http"), "icmp" => Shell.new("icmp"), "ssl" => Shell.new("ssl"), "tcp" => Shell.new("tcp"), "egress_buster" => Shell.new("egress_buster") } @modes = { "normal_mode" => Mode.new("normal_mode") } @node = Node.new @system = System.new @services = { "evil_ap" => Service.new("evil_ap"), "msfrpcd" => Service.new("msfrpcd"), "nac_bypass" => Service.new("nac_bypass"), "passive_recon" => Service.new("passive_recon"), "sshd" => Service.new("sshd"), "stealth" => Service.new("stealth"), "text_to_bash" => Service.new("text_to_bash") } end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
137 138 139 |
# File 'lib/pwnix-api-client/api_client.rb', line 137 def base_uri @base_uri end |
#error_string ⇒ Object
Returns the value of attribute error_string.
144 145 146 |
# File 'lib/pwnix-api-client/api_client.rb', line 144 def error_string @error_string end |
#modes ⇒ Object
Returns the value of attribute modes.
142 143 144 |
# File 'lib/pwnix-api-client/api_client.rb', line 142 def modes @modes end |
#node ⇒ Object
Returns the value of attribute node.
143 144 145 |
# File 'lib/pwnix-api-client/api_client.rb', line 143 def node @node end |
#services ⇒ Object
Returns the value of attribute services.
141 142 143 |
# File 'lib/pwnix-api-client/api_client.rb', line 141 def services @services end |
#shell_receiver_config ⇒ Object
Returns the value of attribute shell_receiver_config.
140 141 142 |
# File 'lib/pwnix-api-client/api_client.rb', line 140 def shell_receiver_config @shell_receiver_config end |
#shells ⇒ Object
Returns the value of attribute shells.
139 140 141 |
# File 'lib/pwnix-api-client/api_client.rb', line 139 def shells @shells end |
#system ⇒ Object
Returns the value of attribute system.
138 139 140 |
# File 'lib/pwnix-api-client/api_client.rb', line 138 def system @system end |
Instance Method Details
#connected? ⇒ Boolean
181 182 183 |
# File 'lib/pwnix-api-client/api_client.rb', line 181 def connected? safe_api_call("/node/connected") == "ok" end |