Class: Ronin::Exploits::CLI::ExploitCommand Private
- Includes:
- ExploitMethods
- Defined in:
- lib/ronin/exploits/cli/exploit_command.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for all commands which load or run exploits.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#exploit ⇒ Exploit?
readonly
private
The initialized exploit object.
-
#exploit_class ⇒ Class<Exploit>?
readonly
private
The loaded exploit class.
Instance Method Summary collapse
-
#initialize_exploit(**kwargs) ⇒ Object
private
Initializes the exploit and sets #exploit.
-
#load_exploit(id) ⇒ Object
private
Loads the exploit and sets #exploit_class.
-
#load_exploit_from(file) ⇒ Object
private
Loads the exploit from the given file and sets #exploit_class.
-
#run(name = nil) ⇒ Object
private
Loads the exploit.
-
#validate_exploit ⇒ Object
private
Validates the exploit.
Instance Attribute Details
#exploit ⇒ Exploit? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The initialized exploit object.
55 56 57 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 55 def exploit @exploit end |
#exploit_class ⇒ Class<Exploit>? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The loaded exploit class.
50 51 52 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 50 def exploit_class @exploit_class end |
Instance Method Details
#initialize_exploit(**kwargs) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the exploit and sets #exploit.
98 99 100 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 98 def initialize_exploit(**kwargs) @exploit = super(@exploit_class,**kwargs) end |
#load_exploit(id) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads the exploit and sets #exploit_class.
78 79 80 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 78 def load_exploit(id) @exploit_class = super(id) end |
#load_exploit_from(file) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads the exploit from the given file and sets #exploit_class.
88 89 90 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 88 def load_exploit_from(file) @exploit_class = super(file) end |
#run(name = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads the exploit.
63 64 65 66 67 68 69 70 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 63 def run(name=nil) if name then load_exploit(name) elsif [:file] then load_exploit_from([:file]) else print_error "must specify --file or a NAME" exit(-1) end end |
#validate_exploit ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Validates the exploit.
111 112 113 |
# File 'lib/ronin/exploits/cli/exploit_command.rb', line 111 def validate_exploit super(@exploit) end |